From 33be14e7e22d9687235e85769a6be544afc05c00 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 27 Feb 2022 17:09:29 +0100 Subject: [PATCH] Update stake_amount calculation with multiple entries when using leverage --- freqtrade/persistence/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index de3ed3154..8d85c775b 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -891,7 +891,7 @@ class LocalTrade(): if total_amount > 0: # Leverage not updated, as we don't allow changing leverage through DCA at the moment. self.open_rate = total_stake / total_amount - self.stake_amount = total_stake + self.stake_amount = total_stake / (self.leverage or 1.0) self.amount = total_amount self.fee_open_cost = self.fee_open * self.stake_amount self.recalc_open_trade_value()