diff --git a/vnpy/trader/app/ctaStrategy/ctaTemplate.py b/vnpy/trader/app/ctaStrategy/ctaTemplate.py index 8a075d70..a460e8f1 100644 --- a/vnpy/trader/app/ctaStrategy/ctaTemplate.py +++ b/vnpy/trader/app/ctaStrategy/ctaTemplate.py @@ -192,7 +192,8 @@ class CtaTemplate(object): #---------------------------------------------------------------------- def saveSyncData(self): """保存同步数据到数据库""" - self.ctaEngine.saveSyncData(self) + if self.trading: + self.ctaEngine.saveSyncData(self) ########################################################################