From af0d719b2c50e390993cd21f49a0c4a64f7c69b0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 2 Jan 2025 15:03:29 +0100 Subject: [PATCH] chore: prevent error exiting when an order is already open and due for cancelation --- freqtrade/freqtradebot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index fd1f586b4..e1130f1f3 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1974,7 +1974,11 @@ class FreqtradeBot(LoggingMixin): return amount trade_base_currency = self.exchange.get_pair_base_currency(pair) - wallet_amount = self.wallets.get_free(trade_base_currency) + # Free + Used - open orders will eventually still be canceled. + wallet_amount = self.wallets.get_free(trade_base_currency) + self.wallets.get_used( + trade_base_currency + ) + logger.debug(f"{pair} - Wallet: {wallet_amount} - Trade-amount: {amount}") if wallet_amount >= amount: return amount