1、新增傅里叶策略
2、新增策略管理、策略重启功能
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user