Skip to content

Commit af0d719

Browse files
committed
chore: prevent error exiting when an order is already open and due for cancelation
1 parent 0919d4c commit af0d719

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

freqtrade/freqtradebot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,11 @@ def _safe_exit_amount(self, trade: Trade, pair: str, amount: float) -> float:
19741974
return amount
19751975

19761976
trade_base_currency = self.exchange.get_pair_base_currency(pair)
1977-
wallet_amount = self.wallets.get_free(trade_base_currency)
1977+
# Free + Used - open orders will eventually still be canceled.
1978+
wallet_amount = self.wallets.get_free(trade_base_currency) + self.wallets.get_used(
1979+
trade_base_currency
1980+
)
1981+
19781982
logger.debug(f"{pair} - Wallet: {wallet_amount} - Trade-amount: {amount}")
19791983
if wallet_amount >= amount:
19801984
return amount

0 commit comments

Comments
 (0)