From a73e4f8e41f7bd6fd97cb788f297828533cd95c0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 16 Aug 2022 09:49:53 +0200 Subject: [PATCH] Truncate amount before comparing for closure --- freqtrade/persistence/trade_model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/persistence/trade_model.py b/freqtrade/persistence/trade_model.py index 25b290bfb..66b0b2ddb 100644 --- a/freqtrade/persistence/trade_model.py +++ b/freqtrade/persistence/trade_model.py @@ -621,7 +621,8 @@ class LocalTrade(): else: logger.warning( f'Got different open_order_id {self.open_order_id} != {order.order_id}') - if isclose(order.safe_amount_after_fee, self.amount, abs_tol=MATH_CLOSE_PREC): + amount_tr = amount_to_precision(self.amount, self.amount_precision, self.precision_mode) + if isclose(order.safe_amount_after_fee, amount_tr, abs_tol=MATH_CLOSE_PREC): self.close(order.safe_price) else: self.recalc_trade_from_orders()