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:
2026-01-13 21:55:34 +08:00
parent e6d69ed04d
commit 10bb371054
3 changed files with 294 additions and 384 deletions

View File

@@ -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]
}
)
}