This commit is contained in:
parent
e6a35a8506
commit
cd213ca366
@ -378,12 +378,12 @@ class FreqaiPrimer(IStrategy):
|
||||
# 条件 3:快速拉升退出
|
||||
# 检测最近 5 根 K 线(约 15 分钟)涨幅超过 3%,且有最低 2% 利润,结合 StochRSI 超买
|
||||
min_profit = 0.02 # 最低利润 2%
|
||||
rapid_rise_threshold = self.linear_map(trend_score, 0, 100, 4.0, 2.5) # 熊市 4%,牛市 2.5%
|
||||
rapid_rise_threshold = self.linear_map(trend_score, 0, 100, 3.5, 2) # 熊市 4%,牛市 2.5%
|
||||
cond3 = (
|
||||
(dataframe["short_term_return"] > rapid_rise_threshold) & # 短期快速拉升
|
||||
(dataframe["close"] / dataframe["close"].shift(5) - 1 > min_profit) & # 确保最低利润
|
||||
(dataframe["stochrsi_k"] > 80) & # 超买确认
|
||||
(dataframe["adx"] > 20) # 趋势强度
|
||||
(dataframe["stochrsi_k"] > 70) & # 超买确认
|
||||
(dataframe["volume_z_score"] > 1.0)
|
||||
)
|
||||
|
||||
# 综合卖出条件:根据 trend_score 调整逻辑
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user