up
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run

This commit is contained in:
zhangkun9038@dingtalk.com 2025-04-28 12:25:20 +08:00
parent 82ed0e90e9
commit 328769e0e1

View File

@ -222,7 +222,19 @@ class FreqaiExampleStrategy(IStrategy):
"exit_long"
] = 1
return df
def populate_entry_trend(self, df: DataFrame, metadata: dict) -> DataFrame:
# 改进买入信号条件
enter_long_conditions = [
(df["rsi"] < df["buy_rsi_pred"]) & (df["rsi"].shift(1) >= df["buy_rsi_pred"]), # RSI 下穿买入阈值
df["volume"] > df["volume"].rolling(window=10).mean(), # 成交量高于近期均值
df["close"] > df["bb_middleband"] # 价格高于布林带中轨
]
if enter_long_conditions:
df.loc[
reduce(lambda x, y: x & y, enter_long_conditions),
["enter_long", "enter_tag"]
] = (1, "long")
return df
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