Skip to content

Latest commit

 

History

History
309 lines (229 loc) · 6.36 KB

File metadata and controls

309 lines (229 loc) · 6.36 KB

Contributing to Quantitative Trading System

Thank you for your interest in contributing to our quantitative trading system! This document provides guidelines and information for contributors.

🤝 How to Contribute

Types of Contributions

We welcome various types of contributions:

  • 🐛 Bug Reports: Report bugs and issues
  • ✨ Feature Requests: Suggest new features
  • 📝 Documentation: Improve documentation
  • 💻 Code Contributions: Submit code improvements
  • 🧪 Tests: Add or improve tests
  • 🌐 Translations: Help with internationalization

Getting Started

  1. Fork the repository
  2. Clone your fork
    git clone https://github.com/yourusername/tradingsystem.git
    cd tradingsystem
  3. Create a virtual environment
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  4. Install dependencies
    pip install -e .[test,dev]

📋 Development Guidelines

Code Style

  • Python: Follow PEP 8 style guide
  • C++: Follow Google C++ Style Guide
  • Type Hints: Use type hints for all Python functions
  • Docstrings: Add docstrings for all functions and classes

Testing

  • Write tests for new features
  • Ensure all tests pass before submitting
  • Maintain test coverage above 80%
# Run tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=data_service --cov-report=html

Code Quality

# Run linting
flake8 data_service/
black data_service/
isort data_service/

# Run type checking
mypy data_service/

🔄 Pull Request Process

  1. Create a feature branch

    git checkout -b feature/your-feature-name
  2. Make your changes

    • Write clear, descriptive commit messages
    • Keep commits focused and atomic
    • Add tests for new functionality
  3. Test your changes

    pytest tests/ -v
    flake8 data_service/
  4. Update documentation

    • Update README if needed
    • Add docstrings for new functions
    • Update example files if applicable
  5. Submit a Pull Request

    • Use a clear title and description
    • Reference any related issues
    • Include screenshots for UI changes

Pull Request Template

## Description
Brief description of changes

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Test addition
- [ ] Other (please describe)

## Testing
- [ ] All tests pass
- [ ] New tests added
- [ ] Manual testing completed

## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No breaking changes

🐛 Bug Reports

When reporting bugs, please include:

  • Environment: OS, Python version, dependencies
  • Steps to reproduce: Clear, step-by-step instructions
  • Expected behavior: What should happen
  • Actual behavior: What actually happens
  • Screenshots: If applicable
  • Logs: Error messages and stack traces

✨ Feature Requests

When requesting features, please include:

  • Use case: Why this feature is needed
  • Proposed solution: How you think it should work
  • Alternatives: Other approaches considered
  • Mockups: UI mockups if applicable

📚 Documentation

Writing Documentation

  • Use clear, concise language
  • Include code examples
  • Add screenshots for UI features
  • Keep documentation up to date

Documentation Structure

docs/
├── getting-started.md
├── installation.md
├── usage.md
├── api-reference.md
├── contributing.md
└── examples/
    ├── basic-usage.md
    ├── advanced-features.md
    └── troubleshooting.md

🧪 Testing Guidelines

Test Structure

# tests/test_module.py
import pytest
from data_service.module import ClassName

class TestClassName:
    def test_method_name(self):
        """Test description"""
        # Arrange
        obj = ClassName()
        
        # Act
        result = obj.method()
        
        # Assert
        assert result == expected_value

Test Categories

  • Unit Tests: Test individual functions/classes
  • Integration Tests: Test module interactions
  • End-to-End Tests: Test complete workflows
  • Performance Tests: Test system performance

🔧 Development Setup

Required Tools

  • Python 3.8+
  • Git
  • C++17 compiler (for backend)
  • CMake 3.12+ (for backend)

IDE Setup

VS Code Extensions:

  • Python
  • C/C++
  • GitLens
  • Python Test Explorer

PyCharm:

  • Enable type checking
  • Configure code style
  • Set up testing framework

Pre-commit Hooks

# Install pre-commit
pip install pre-commit

# Install hooks
pre-commit install

# Run manually
pre-commit run --all-files

📊 Performance Guidelines

  • Profile code before optimization
  • Use appropriate data structures
  • Minimize memory allocations
  • Consider async/await for I/O operations
  • Cache expensive computations

🔒 Security Guidelines

  • Never commit API keys or secrets
  • Validate all user inputs
  • Use parameterized queries
  • Follow OWASP guidelines
  • Regular security audits

🌍 Internationalization

  • Use UTF-8 encoding
  • Support multiple languages
  • Consider timezone handling
  • Localize number formats
  • Provide translation files

📈 Release Process

Versioning

We use Semantic Versioning:

  • MAJOR: Breaking changes
  • MINOR: New features, backward compatible
  • PATCH: Bug fixes, backward compatible

Release Checklist

  • All tests pass
  • Documentation updated
  • Changelog updated
  • Version bumped
  • Release notes written
  • Tagged and pushed

🤝 Community Guidelines

Code of Conduct

  • Be respectful and inclusive
  • Help others learn
  • Provide constructive feedback
  • Follow project conventions
  • Respect maintainers' time

Communication

  • Use GitHub Issues for discussions
  • Be clear and concise
  • Provide context and examples
  • Respond to feedback promptly
  • Ask questions when unsure

📞 Getting Help

  • GitHub Issues: For bugs and feature requests
  • Discussions: For questions and discussions
  • Wiki: For detailed documentation
  • Email: For private matters

🙏 Recognition

Contributors will be recognized in:

  • README contributors section
  • Release notes
  • Project documentation
  • GitHub contributors page

Thank you for contributing to our quantitative trading system! 🚀