From b69f598e51986752395ba60ea8e18cd4a883d9f6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 24 Aug 2024 16:34:03 +0200 Subject: [PATCH] refactor: move more code into cross conditional --- freqtrade/freqtradebot.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index d65ee8d0f..7e826d19e 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -2163,12 +2163,11 @@ class FreqtradeBot(LoggingMixin): Updates liquidation price for all trades in cross margin mode. TODO: this is missing a dedicated test! """ - total_wallet_stake = 0.0 - if self.config["dry_run"] and self.exchange.margin_mode == MarginMode.CROSS: - # Parameters only needed for cross margin - total_wallet_stake = self.wallets.get_total(self.config["stake_currency"]) - if self.exchange.margin_mode == MarginMode.CROSS: + total_wallet_stake = 0.0 + if self.config["dry_run"]: + # Parameters only needed for cross margin + total_wallet_stake = self.wallets.get_total(self.config["stake_currency"]) logger.info("Updating liquidation price for all open trades.") for t in Trade.get_open_trades(): # TODO: This should be done in a batch update