added trailing_only_offset_is_reached option
This commit is contained in:
parent
628d9577a2
commit
c122eab77b
@ -331,6 +331,10 @@ class IStrategy(ABC):
|
|||||||
f"with offset {sl_offset:.4g} "
|
f"with offset {sl_offset:.4g} "
|
||||||
f"since we have profit {current_profit:.4f}%")
|
f"since we have profit {current_profit:.4f}%")
|
||||||
|
|
||||||
|
# if trailing_only_offset_is_reached is true,
|
||||||
|
# we update trailing stoploss only if offset is reached.
|
||||||
|
tsl_only_offset = self.config.get('trailing_only_offset_is_reached', False)
|
||||||
|
if tsl_only_offset and current_profit > sl_offset:
|
||||||
trade.adjust_stop_loss(current_rate, stop_loss_value)
|
trade.adjust_stop_loss(current_rate, stop_loss_value)
|
||||||
|
|
||||||
return SellCheckTuple(sell_flag=False, sell_type=SellType.NONE)
|
return SellCheckTuple(sell_flag=False, sell_type=SellType.NONE)
|
||||||
|
Loading…
Reference in New Issue
Block a user