This commit is contained in:
vn.py 2018-06-10 11:18:35 +08:00
parent d33a585b0f
commit 5fb1cafc0d
2 changed files with 3 additions and 2 deletions

View File

@ -234,8 +234,8 @@ class BacktestingEngine(object):
self.output(u'开始回测')
self.strategy.inited = True
self.strategy.onInit()
self.strategy.inited = True
self.output(u'策略初始化完成')
self.strategy.trading = True

View File

@ -430,8 +430,9 @@ class CtaEngine(object):
strategy = self.strategyDict[name]
if not strategy.inited:
strategy.inited = True
self.callStrategyFunc(strategy, strategy.onInit)
strategy.inited = True
self.loadSyncData(strategy) # 初始化完成后加载同步数据
self.subscribeMarketData(strategy) # 加载同步数据后再订阅行情
else: