From ffebdd2ecd8a4aee1bfd71c02b82dfcefb82ded0 Mon Sep 17 00:00:00 2001 From: 1122455801 Date: Sat, 15 Jun 2019 19:00:06 +0800 Subject: [PATCH] Update backtesting.py --- vnpy/app/cta_strategy/backtesting.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vnpy/app/cta_strategy/backtesting.py b/vnpy/app/cta_strategy/backtesting.py index 22ebd22e..45a1c48e 100644 --- a/vnpy/app/cta_strategy/backtesting.py +++ b/vnpy/app/cta_strategy/backtesting.py @@ -214,6 +214,10 @@ class BacktestingEngine: if not self.end: self.end = datetime.now() + if self.start >= self.end: + self.output("起始日期必须小于结束日期") + return + self.history_data.clear() # Clear previously loaded history data # Load 30 days of data each time and allow for progress update