From 98acb0f4ff535e23209ff336ab142ac24ca06ff2 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Tue, 6 Jul 2021 22:34:08 -0600 Subject: [PATCH] set initial_stop_loss in stoploss helper --- freqtrade/persistence/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index 76a5bf34e..97cb25e14 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -310,8 +310,11 @@ class LocalTrade(): self.stop_loss = max(stop_loss, liquidation_price) else: self.stop_loss = liquidation_price + self.initial_stop_loss = liquidation_price self.liquidation_price = liquidation_price else: + if not self.stop_loss: + self.initial_stop_loss = stop_loss self.stop_loss = stop_loss def set_stop_loss(self, stop_loss: float):