From f98efdbe0787d9ea543d0589508f9511be2ea778 Mon Sep 17 00:00:00 2001 From: mrpabloyeah Date: Mon, 17 Nov 2025 13:09:48 +0100 Subject: [PATCH] Fix backtesting exception when no data is available for a pair --- 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 9dc878fae..8a260cd76 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -1425,7 +1425,7 @@ class Backtesting: # Row is treated as "current incomplete candle". # entry / exit signals are shifted by 1 to compensate for this. row = data[pair][row_index] - except IndexError: + except (IndexError, KeyError): # missing Data for one pair at the end. # Warnings for this are shown during data loading return None