ATR回调止损

This commit is contained in:
zhangkun9038@dingtalk.com 2025-05-04 21:37:15 +08:00
parent bd1e0cf271
commit b39440dd48

View File

@ -636,20 +636,3 @@ class OKXRegressionStrategy(IStrategy):
dataframe.loc[callback_condition, 'exit_long'] = 1
return dataframe
dataframe['below_bb_upper'] = dataframe['close'] < dataframe['bb_upper']
# 获取高时间框架趋势1小时均线
dataframe['trend_up'] = dataframe['close'] > dataframe['trend_1h']
dataframe['trend_down'] = dataframe['close'] < dataframe['trend_1h']
# 综合回调止损条件
callback_condition = (
dataframe['callback_condition_atr'] &
((dataframe['in_overbought'] | (~dataframe['below_bb_upper']))) &
dataframe['trend_down']
)
# 应用回调止损逻辑
dataframe.loc[callback_condition, 'exit_long'] = 1
return dataframe