Add check_symbols.py for ETH perpetuals filtering and enhance backtester with size handling
- Introduced `check_symbols.py` to load and filter ETH perpetual markets from the OKX exchange using CCXT. - Updated the backtester to normalize signals to a 5-tuple format, incorporating size management for trades. - Enhanced portfolio functions to support variable size and leverage adjustments based on initial capital. - Added a new method in `CryptoQuantClient` for chunked historical data fetching to avoid API limits. - Improved market symbol normalization in `market.py` to handle different formats. - Updated regime strategy parameters based on recent research findings for optimal performance.
This commit is contained in:
@@ -80,14 +80,23 @@ def _build_registry() -> dict[str, StrategyConfig]:
|
||||
"regime": StrategyConfig(
|
||||
strategy_class=RegimeReversionStrategy,
|
||||
default_params={
|
||||
'horizon': 96,
|
||||
'z_window': 24,
|
||||
'stop_loss': 0.06,
|
||||
'take_profit': 0.05
|
||||
# Optimal from walk-forward research (research/horizon_optimization_results.csv)
|
||||
'horizon': 102, # 4.25 days - best Net PnL
|
||||
'z_window': 24, # 24h rolling Z-score window
|
||||
'z_entry_threshold': 1.0, # Enter when |Z| > 1.0
|
||||
'profit_target': 0.005, # 0.5% target for ML labels
|
||||
'stop_loss': 0.06, # 6% stop loss
|
||||
'take_profit': 0.05, # 5% take profit
|
||||
'train_ratio': 0.7, # 70% train / 30% test
|
||||
'trend_window': 0, # Disabled SMA filter
|
||||
'use_funding_filter': True, # Enabled Funding filter
|
||||
'funding_threshold': 0.005 # 0.005% threshold (Proven profitable)
|
||||
},
|
||||
grid_params={
|
||||
'horizon': [72, 96, 120],
|
||||
'stop_loss': [0.04, 0.06, 0.08]
|
||||
'horizon': [84, 96, 102, 108, 120],
|
||||
'z_entry_threshold': [0.8, 1.0, 1.2],
|
||||
'stop_loss': [0.04, 0.06, 0.08],
|
||||
'funding_threshold': [0.005, 0.01, 0.02]
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user