波动率 AI 强制持有逻辑准确判断(尤其是亏损时的判断)
This commit is contained in:
parent
d812319450
commit
418559b51d
@ -882,8 +882,11 @@ class FreqaiPrimer(IStrategy):
|
||||
# 确保概率在 [0, 1] 范围内(分类器输出可能有浮点误差)
|
||||
exit_prob = max(0.0, min(1.0, exit_prob))
|
||||
|
||||
# 从 kwargs 获取当前利润,freqtrade 会传入 current_profit
|
||||
current_profit = float(kwargs.get('current_profit', 0.0))
|
||||
# 获取当前利润:优先从 trade 对象获取,其次从 kwargs 获取
|
||||
if hasattr(trade, 'calc_profit_ratio'):
|
||||
current_profit = trade.calc_profit_ratio(rate)
|
||||
else:
|
||||
current_profit = float(kwargs.get('current_profit', 0.0))
|
||||
|
||||
# 获取出场一字基础阈值
|
||||
base_threshold = self.ml_exit_signal_threshold.value
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user