From 8a49d620687d3c367cec1efbec6d4e5ab41c8137 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 29 Mar 2023 06:49:11 +0200 Subject: [PATCH] Don't update liquidation price for closed trades --- freqtrade/freqtradebot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 42db121e9..9746ac3d8 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1811,7 +1811,7 @@ class FreqtradeBot(LoggingMixin): # TODO: should shorting/leverage be supported by Edge, # then this will need to be fixed. trade.adjust_stop_loss(trade.open_rate, self.strategy.stoploss, initial=True) - if order.get('side') == trade.entry_side or trade.amount > 0: + if order.get('side') == trade.entry_side or (trade.amount > 0 and trade.is_open): # Must also run for partial exits # TODO: Margin will need to use interest_rate as well. # interest_rate = self.exchange.get_interest_rate()