up
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run
This commit is contained in:
parent
b6b9a62c35
commit
8777726441
@ -143,10 +143,6 @@ class FreqaiExampleStrategy(IStrategy):
|
||||
try:
|
||||
label_period = self.freqai_info["feature_parameters"]["label_period_candles"]
|
||||
|
||||
# 重新定义目标变量 up_or_down,预测未来价格变化方向
|
||||
dataframe["up_or_down"] = np.where(
|
||||
dataframe["close"].shift(-label_period) / dataframe["close"] - 1 > 0, 1, 0
|
||||
)
|
||||
# 确保目标变量是二维数组
|
||||
if dataframe["up_or_down"].ndim == 1:
|
||||
dataframe["up_or_down"] = dataframe["up_or_down"].values.reshape(-1, 1)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user