Fix backtesting exception when no data is available for a pair

pull/12529/head
mrpabloyeah 6 months ago
parent e67c2eefff
commit f98efdbe07

@ -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

Loading…
Cancel
Save