ATR回调止损
This commit is contained in:
parent
bd1e0cf271
commit
b39440dd48
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user