From c122eab77b52d0cc9fd942f5a130ad0b04a1e236 Mon Sep 17 00:00:00 2001 From: misagh Date: Sat, 9 Mar 2019 20:13:35 +0100 Subject: [PATCH] added trailing_only_offset_is_reached option --- freqtrade/strategy/interface.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 1d6147357..29976fb4a 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -331,7 +331,11 @@ class IStrategy(ABC): f"with offset {sl_offset:.4g} " f"since we have profit {current_profit:.4f}%") - trade.adjust_stop_loss(current_rate, stop_loss_value) + # 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) return SellCheckTuple(sell_flag=False, sell_type=SellType.NONE)