From e81489807d418130ed287099b2a74f81d45c0323 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 15 Jan 2025 18:11:46 +0100 Subject: [PATCH] fix: prevent multiple intra-candle trades --- freqtrade/optimize/backtesting.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 91b2bb4fd..5ecb0d800 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -1534,6 +1534,11 @@ class Backtesting: # Pair has had open trades which closed in the current main candle. # Skip this pair for this timeframe continue + if pair_has_open_trades and pair not in pairs_with_open_trades: + # auto-lock for pairs that have open trades + # Necessary for detail - to capture trades that open and close within + # the same main candle + pairs_with_open_trades.append(pair) if ( is_first