diff --git a/vnpy/app/cta_strategy/backtesting.py b/vnpy/app/cta_strategy/backtesting.py index 58e5dabb..b78a8017 100644 --- a/vnpy/app/cta_strategy/backtesting.py +++ b/vnpy/app/cta_strategy/backtesting.py @@ -229,6 +229,8 @@ class BacktestingEngine: progress = 0 while start < self.end: + end = min(end, self.end) # Make sure end time stays within set range + if self.mode == BacktestingMode.BAR: data = load_bar_data( self.symbol,