Improve error-handling

This commit is contained in:
Matthias
2023-05-02 21:40:44 +02:00
parent 13974d2508
commit 0d1d25e868
+12 -10
View File
@@ -1824,16 +1824,18 @@ class FreqtradeBot(LoggingMixin):
# Must also run for partial exits # Must also run for partial exits
# TODO: Margin will need to use interest_rate as well. # TODO: Margin will need to use interest_rate as well.
# interest_rate = self.exchange.get_interest_rate() # interest_rate = self.exchange.get_interest_rate()
trade.set_liquidation_price(self.exchange.get_liquidation_price( try:
pair=trade.pair, trade.set_liquidation_price(self.exchange.get_liquidation_price(
open_rate=trade.open_rate, pair=trade.pair,
is_short=trade.is_short, open_rate=trade.open_rate,
amount=trade.amount, is_short=trade.is_short,
stake_amount=trade.stake_amount, amount=trade.amount,
leverage=trade.leverage, stake_amount=trade.stake_amount,
wallet_balance=trade.stake_amount, leverage=trade.leverage,
)) wallet_balance=trade.stake_amount,
))
except DependencyException:
logger.warning('Unable to calculate liquidation price')
# Updating wallets when order is closed # Updating wallets when order is closed
self.wallets.update() self.wallets.update()
Trade.commit() Trade.commit()