From 3264d7b8900c3d9d955248a212009f1dbd5642c4 Mon Sep 17 00:00:00 2001 From: Marek Cieplucha Date: Tue, 4 Oct 2022 20:27:13 +0200 Subject: [PATCH] Fix for #7534 in backtesting --- freqtrade/optimize/backtesting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 376c2de7c..83159dfe4 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -1045,7 +1045,7 @@ class Backtesting: if requested_rate: self._enter_trade(pair=trade.pair, row=row, trade=trade, requested_rate=requested_rate, - requested_stake=(order.remaining * order.price), + requested_stake=(order.remaining * order.price / trade.leverage), direction='short' if trade.is_short else 'long') self.replaced_entry_orders += 1 else: