SpectralStrategy更新
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user