SpectralStrategy更新

This commit is contained in:
2025-11-29 16:35:02 +08:00
parent 29199f9492
commit 687d8a180b
35 changed files with 40381 additions and 1153 deletions

View File

@@ -107,7 +107,7 @@ class SpectralTrendStrategy(Strategy):
position_volume = self.get_current_positions().get(self.symbol, 0)
# 获取历史价格 (使用完整历史)
closes = np.array([b.close for b in bar_history], dtype=float)
closes = np.array([b.close for b in bar_history[-self.spectral_window:]], dtype=float)
# 【核心】计算频域趋势强度 (显式傅里叶)
trend_strength, dominant_freq = self.calculate_trend_strength(closes)