stable1 6
This commit is contained in:
parent
ae6330a89e
commit
ebd83c9374
@ -351,17 +351,17 @@ class FreqaiExampleStrategy(IStrategy):
|
||||
]
|
||||
|
||||
# 如果 MACD 列存在,则添加 MACD 金叉条件
|
||||
if "macd" in df.columns and "macdsignal" in df.columns:
|
||||
enter_long_conditions.append((df["macd"] > df["macdsignal"]))
|
||||
if "macd" in dataframe.columns and "macdsignal" in dataframe.columns:
|
||||
enter_long_conditions.append((df["macd"] > dataframe["macdsignal"]))
|
||||
|
||||
# 确保模型预测为买入
|
||||
enter_long_conditions.append((df["do_predict"] == 1))
|
||||
enter_long_conditions.append((dataframe["do_predict"] == 1))
|
||||
if enter_long_conditions:
|
||||
df.loc[
|
||||
dataframe.loc[
|
||||
reduce(lambda x, y: x & y, enter_long_conditions),
|
||||
["enter_long", "enter_tag"]
|
||||
] = (1, "long")
|
||||
return df
|
||||
return dataframe
|
||||
def confirm_trade_entry(
|
||||
self, pair: str, order_type: str, amount: float, rate: float,
|
||||
time_in_force: str, current_time, entry_tag, side: str, **kwargs
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user