SpectralStrategy更新:TA品种

This commit is contained in:
2025-11-29 21:07:15 +08:00
parent 687d8a180b
commit 444a1dfed1
10 changed files with 5244 additions and 204 deletions

View File

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