From d8817247d32f3564f2218936e1fde5aa60251553 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Sat, 2 Dec 2017 21:59:23 +0800 Subject: [PATCH] [Fix]Close #599 --- vnpy/trader/app/ctaStrategy/ctaTemplate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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')