1、新增傅里叶策略

2、新增策略管理、策略重启功能
This commit is contained in:
2025-11-20 16:10:16 +08:00
parent 2ae9f2db9e
commit 2c917a467a
19 changed files with 3368 additions and 6643 deletions

File diff suppressed because one or more lines are too long

View File

@@ -73,8 +73,8 @@ class DualModeKalmanStrategy(Strategy):
# 卡尔曼滤波器状态
self.Q = kalman_process_noise
self.R = kalman_measurement_noise
self.P = 1.0;
self.x_hat = 0.0;
self.P = 1.0
self.x_hat = 0.0
self.kalman_initialized = False
self._atr_history: deque = deque(maxlen=self.atr_lookback)
@@ -105,7 +105,8 @@ class DualModeKalmanStrategy(Strategy):
self._atr_history.append(current_atr)
if current_atr <= 0 or len(self._atr_history) < self.atr_lookback: return
if not self.kalman_initialized: self.x_hat = closes[-1]; self.kalman_initialized = True
if not self.kalman_initialized: self.x_hat = closes[-1]
self.kalman_initialized = True
x_hat_minus = self.x_hat
P_minus = self.P + self.Q
K = P_minus / (P_minus + self.R)