From 20a7a6e0d80dca1b082113bc8bc2aaeb90cc210c Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 29 May 2022 09:51:47 +0200 Subject: [PATCH] Fix wrong partial exit notification --- freqtrade/freqtradebot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 5e4a37fe4..892c651bf 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1708,10 +1708,12 @@ class FreqtradeBot(LoggingMixin): sub_trade = not isclose(order_obj.safe_amount_after_fee, trade.amount, abs_tol=constants.MATH_CLOSE_PREC) - if not trade.is_open: + if order_obj.ft_order_side == trade.exit_side: + # Exit notification if send_msg and not stoploss_order and not trade.open_order_id: self._notify_exit(trade, '', True, sub_trade=sub_trade, order=order_obj) - self.handle_protections(trade.pair, trade.trade_direction) + if not trade.is_open: + self.handle_protections(trade.pair, trade.trade_direction) elif send_msg and not trade.open_order_id and not stoploss_order: # Enter fill self._notify_enter(trade, order_obj, fill=True, sub_trade=sub_trade)