diff --git a/vnpy/trader/app/ctaStrategy/ctaTemplate.py b/vnpy/trader/app/ctaStrategy/ctaTemplate.py index 5cf9b0ff..e55eb3c4 100644 --- a/vnpy/trader/app/ctaStrategy/ctaTemplate.py +++ b/vnpy/trader/app/ctaStrategy/ctaTemplate.py @@ -408,7 +408,7 @@ class BarManager(object): self.xminBar.volume += int(bar.volume) # X分钟已经走完 - if not bar.datetime.minute % self.xmin: # 可以用X整除 + if not (bar.datetime.minute + 1) % self.xmin: # 可以用X整除 # 生成上一X分钟K线的时间戳 self.xminBar.datetime = self.xminBar.datetime.replace(second=0, microsecond=0) # 将秒和微秒设为0 self.xminBar.date = self.xminBar.datetime.strftime('%Y%m%d')