34 lines
1.3 KiB
Python
34 lines
1.3 KiB
Python
|
|
# 策略配置(Python格式)
|
|||
|
|
from src.indicators.indicators import ZScoreATR, BollingerBandwidth
|
|||
|
|
|
|||
|
|
CONFIG = {
|
|||
|
|
"name": "傅里叶趋势策略",
|
|||
|
|
"version": "1.0",
|
|||
|
|
"enabled": True,
|
|||
|
|
|
|||
|
|
"strategy_class": "futures_trading_strategies.rb.Spectral.SpectralTrendStrategy.SpectralTrendStrategy",
|
|||
|
|
|
|||
|
|
"engine_params": {
|
|||
|
|
"symbol": "KQ.m@SHFE.rb",
|
|||
|
|
"duration_seconds": 900,
|
|||
|
|
"roll_over_mode": True,
|
|||
|
|
"history_length": 1000,
|
|||
|
|
# 支持Python对象
|
|||
|
|
"close_bar_delta": __import__('datetime').timedelta(minutes=58)
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
"strategy_params": {
|
|||
|
|
'main_symbol': 'rb', # <-- 替换为你的交易品种代码,例如 'GC=F' (黄金期货), 'ZC=F' (玉米期货)
|
|||
|
|
'trade_volume': 3,
|
|||
|
|
# 'order_direction': ['SELL', 'BUY'],
|
|||
|
|
# 'indicators': [BollingerBandwidth(20, 2.0, 1.8, 5), BollingerBandwidth(20, 2.0, 1.8, 5),],
|
|||
|
|
'model_indicator': BollingerBandwidth(20, 2.0, 0.5, 3.5),
|
|||
|
|
'bars_per_day': 23,
|
|||
|
|
'spectral_window_days': 4, # STFT窗口大小(天)
|
|||
|
|
'low_freq_days': 4, # 低频下限(天)
|
|||
|
|
'high_freq_days': 2, # 高频上限(天)
|
|||
|
|
'trend_strength_threshold': 0.8, # 相变临界值
|
|||
|
|
'exit_threshold': 0.4, # 退出阈值
|
|||
|
|
'enable_log': True
|
|||
|
|
}
|
|||
|
|
}
|