- 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.
31 lines
971 B
Python
31 lines
971 B
Python
"""
|
|
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
|
|
from .data_types import StrategySignal, SignalType, StrategyResult
|
|
from .manager import StrategyManager, StrategyConfig, StrategyType, StrategyCategory, get_strategy_manager
|
|
|
|
__all__ = [
|
|
'BaseStrategy',
|
|
'StrategyFactory',
|
|
'StrategySignal',
|
|
'SignalType',
|
|
'StrategyResult',
|
|
'StrategyManager',
|
|
'StrategyConfig',
|
|
'StrategyType',
|
|
'StrategyCategory',
|
|
'get_strategy_manager'
|
|
] |