diff --git a/freqtrade/templates/FreqaiExampleStrategy.py b/freqtrade/templates/FreqaiExampleStrategy.py index f448fb25..2fef97c0 100644 --- a/freqtrade/templates/FreqaiExampleStrategy.py +++ b/freqtrade/templates/FreqaiExampleStrategy.py @@ -145,9 +145,9 @@ class FreqaiExampleStrategy(IStrategy): # 生成更复杂的目标变量 up_or_down # Ensure the target variable is reshaped correctly - dataframe["up_or_down"] = np.where( - dataframe["close"].shift(-label_period) > dataframe["close"], 1, 0 - ).reshape(-1, 1) # Reshape to 2D array + dataframe["up_or_down"] = np.where( + dataframe["close"].shift(-label_period) > dataframe["close"], 1, 0 + ).reshape(-1, 1) # Reshape to 2D array # 生成 %-volatility 特征 dataframe["%-volatility"] = dataframe["close"].pct_change().rolling(20).std()