From 8d2e83067b5740e498fc2b6d98c18535405e043f Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Fri, 26 Apr 2019 09:33:25 +0800 Subject: [PATCH] [Fix]close #1632 --- vnpy/app/cta_strategy/backtesting.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vnpy/app/cta_strategy/backtesting.py b/vnpy/app/cta_strategy/backtesting.py index fdeff439..e4aa25c7 100644 --- a/vnpy/app/cta_strategy/backtesting.py +++ b/vnpy/app/cta_strategy/backtesting.py @@ -226,6 +226,8 @@ class BacktestingEngine: # Use the first [days] of history data for initializing strategy day_count = 0 + ix = 0 + for ix, data in enumerate(self.history_data): if self.datetime and data.datetime.day != self.datetime.day: day_count += 1