- 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.
55 lines
1.5 KiB
JSON
55 lines
1.5 KiB
JSON
{
|
|
"type": "ema_crossover",
|
|
"name": "EMA Crossover",
|
|
"description": "Exponential Moving Average crossover strategy that generates buy signals when fast EMA crosses above slow EMA and sell signals when fast EMA crosses below slow EMA.",
|
|
"category": "trend_following",
|
|
"parameter_schema": {
|
|
"fast_period": {
|
|
"type": "int",
|
|
"description": "Period for fast EMA calculation",
|
|
"min": 5,
|
|
"max": 50,
|
|
"default": 12,
|
|
"required": true
|
|
},
|
|
"slow_period": {
|
|
"type": "int",
|
|
"description": "Period for slow EMA calculation",
|
|
"min": 10,
|
|
"max": 200,
|
|
"default": 26,
|
|
"required": true
|
|
},
|
|
"min_price_change": {
|
|
"type": "float",
|
|
"description": "Minimum price change percentage to validate signal",
|
|
"min": 0.0,
|
|
"max": 10.0,
|
|
"default": 0.5,
|
|
"required": false
|
|
}
|
|
},
|
|
"default_parameters": {
|
|
"fast_period": 12,
|
|
"slow_period": 26,
|
|
"min_price_change": 0.5
|
|
},
|
|
"metadata": {
|
|
"required_indicators": ["ema"],
|
|
"timeframes": ["1h", "4h", "1d"],
|
|
"market_conditions": ["trending"],
|
|
"risk_level": "medium",
|
|
"difficulty": "beginner",
|
|
"signals": {
|
|
"buy": "Fast EMA crosses above slow EMA",
|
|
"sell": "Fast EMA crosses below slow EMA"
|
|
},
|
|
"performance_notes": "Works best in trending markets, may generate false signals in sideways markets"
|
|
},
|
|
"validation_rules": {
|
|
"fast_period_less_than_slow": {
|
|
"rule": "fast_period < slow_period",
|
|
"message": "Fast period must be less than slow period"
|
|
}
|
|
}
|
|
} |