Implement Regime Reversion Strategy and remove regime_detection.py
- Introduced `RegimeReversionStrategy` for ML-based regime detection and mean reversion trading. - Added feature engineering and model training logic within the new strategy. - Removed the deprecated `regime_detection.py` file to streamline the codebase. - Updated the strategy factory to include the new regime strategy configuration.
This commit is contained in:
@@ -36,6 +36,7 @@ def _build_registry() -> dict[str, StrategyConfig]:
|
||||
# Import here to avoid circular imports
|
||||
from strategies.examples import MaCrossStrategy, RsiStrategy
|
||||
from strategies.supertrend import MetaSupertrendStrategy
|
||||
from strategies.regime_strategy import RegimeReversionStrategy
|
||||
|
||||
return {
|
||||
"rsi": StrategyConfig(
|
||||
@@ -76,6 +77,19 @@ def _build_registry() -> dict[str, StrategyConfig]:
|
||||
'period3': 12, 'multiplier3': 1.0
|
||||
}
|
||||
),
|
||||
"regime": StrategyConfig(
|
||||
strategy_class=RegimeReversionStrategy,
|
||||
default_params={
|
||||
'horizon': 96,
|
||||
'z_window': 24,
|
||||
'stop_loss': 0.06,
|
||||
'take_profit': 0.05
|
||||
},
|
||||
grid_params={
|
||||
'horizon': [72, 96, 120],
|
||||
'stop_loss': [0.04, 0.06, 0.08]
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user