4.0 - 1.0 Implement strategy engine foundation with modular components
- Introduced a new `strategies` package containing the core structure for trading strategies, including `BaseStrategy`, `StrategyFactory`, and various strategy implementations (EMA, RSI, MACD).
- Added utility functions for signal detection and validation in `strategies/utils.py`, enhancing modularity and maintainability.
- Updated `pyproject.toml` to include the new `strategies` package in the build configuration.
- Implemented comprehensive unit tests for the strategy foundation components, ensuring reliability and adherence to project standards.
These changes establish a solid foundation for the strategy engine, aligning with project goals for modularity, performance, and maintainability.
2025-06-12 14:41:16 +08:00
|
|
|
"""
|
|
|
|
|
Strategy Engine Package
|
|
|
|
|
|
|
|
|
|
This package provides strategy calculation and signal generation capabilities
|
|
|
|
|
optimized for the TCP Trading Platform's market data and technical indicators.
|
|
|
|
|
|
|
|
|
|
IMPORTANT: Mirrors Indicator Patterns
|
|
|
|
|
- Follows the same architecture as data/common/indicators/
|
|
|
|
|
- Uses BaseStrategy abstract class pattern
|
|
|
|
|
- Implements factory pattern for dynamic strategy loading
|
|
|
|
|
- Supports JSON-based configuration management
|
|
|
|
|
- Integrates with existing technical indicators system
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from .base import BaseStrategy
|
|
|
|
|
from .factory import StrategyFactory
|
2025-06-12 18:39:11 +08:00
|
|
|
from data.common.data_types import StrategySignal, SignalType, StrategyResult
|
4.0 - 2.0 Implement strategy configuration utilities and templates
- Introduced `config_utils.py` for loading and managing strategy configurations, including functions for loading templates, generating dropdown options, and retrieving parameter schemas and default values.
- Added JSON templates for EMA Crossover, MACD, and RSI strategies, defining their parameters and validation rules to enhance modularity and maintainability.
- Implemented `StrategyManager` in `manager.py` for managing user-defined strategies with file-based storage, supporting easy sharing and portability.
- Updated `__init__.py` to include new components and ensure proper module exports.
- Enhanced error handling and logging practices across the new modules for improved reliability.
These changes establish a robust foundation for strategy management and configuration, aligning with project goals for modularity, performance, and maintainability.
2025-06-12 15:17:35 +08:00
|
|
|
from .manager import StrategyManager, StrategyConfig, StrategyType, StrategyCategory, get_strategy_manager
|
2025-06-12 18:29:39 +08:00
|
|
|
from .data_integration import StrategyDataIntegrator, StrategyDataIntegrationConfig, get_strategy_data_integrator
|
|
|
|
|
from .validation import StrategySignalValidator, ValidationConfig
|
|
|
|
|
from .batch_processing import BacktestingBatchProcessor, BatchProcessingConfig
|
|
|
|
|
from .realtime_execution import RealTimeStrategyProcessor, RealTimeConfig, get_realtime_strategy_processor
|
4.0 - 1.0 Implement strategy engine foundation with modular components
- Introduced a new `strategies` package containing the core structure for trading strategies, including `BaseStrategy`, `StrategyFactory`, and various strategy implementations (EMA, RSI, MACD).
- Added utility functions for signal detection and validation in `strategies/utils.py`, enhancing modularity and maintainability.
- Updated `pyproject.toml` to include the new `strategies` package in the build configuration.
- Implemented comprehensive unit tests for the strategy foundation components, ensuring reliability and adherence to project standards.
These changes establish a solid foundation for the strategy engine, aligning with project goals for modularity, performance, and maintainability.
2025-06-12 14:41:16 +08:00
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
|
'BaseStrategy',
|
|
|
|
|
'StrategyFactory',
|
|
|
|
|
'StrategySignal',
|
|
|
|
|
'SignalType',
|
4.0 - 2.0 Implement strategy configuration utilities and templates
- Introduced `config_utils.py` for loading and managing strategy configurations, including functions for loading templates, generating dropdown options, and retrieving parameter schemas and default values.
- Added JSON templates for EMA Crossover, MACD, and RSI strategies, defining their parameters and validation rules to enhance modularity and maintainability.
- Implemented `StrategyManager` in `manager.py` for managing user-defined strategies with file-based storage, supporting easy sharing and portability.
- Updated `__init__.py` to include new components and ensure proper module exports.
- Enhanced error handling and logging practices across the new modules for improved reliability.
These changes establish a robust foundation for strategy management and configuration, aligning with project goals for modularity, performance, and maintainability.
2025-06-12 15:17:35 +08:00
|
|
|
'StrategyResult',
|
|
|
|
|
'StrategyManager',
|
|
|
|
|
'StrategyConfig',
|
|
|
|
|
'StrategyType',
|
|
|
|
|
'StrategyCategory',
|
2025-06-12 18:29:39 +08:00
|
|
|
'get_strategy_manager',
|
|
|
|
|
'StrategyDataIntegrator',
|
|
|
|
|
'StrategyDataIntegrationConfig',
|
|
|
|
|
'get_strategy_data_integrator',
|
|
|
|
|
'StrategySignalValidator',
|
|
|
|
|
'ValidationConfig',
|
|
|
|
|
'BacktestingBatchProcessor',
|
|
|
|
|
'BatchProcessingConfig',
|
|
|
|
|
'RealTimeStrategyProcessor',
|
|
|
|
|
'RealTimeConfig',
|
|
|
|
|
'get_realtime_strategy_processor'
|
4.0 - 1.0 Implement strategy engine foundation with modular components
- Introduced a new `strategies` package containing the core structure for trading strategies, including `BaseStrategy`, `StrategyFactory`, and various strategy implementations (EMA, RSI, MACD).
- Added utility functions for signal detection and validation in `strategies/utils.py`, enhancing modularity and maintainability.
- Updated `pyproject.toml` to include the new `strategies` package in the build configuration.
- Implemented comprehensive unit tests for the strategy foundation components, ensuring reliability and adherence to project standards.
These changes establish a solid foundation for the strategy engine, aligning with project goals for modularity, performance, and maintainability.
2025-06-12 14:41:16 +08:00
|
|
|
]
|