From 26c690263d64900b0aa1b6422ee7dc61a3569b69 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 5 Dec 2017 10:18:49 +0800 Subject: [PATCH] [Fix]Close #624 --- vnpy/trader/app/ctaStrategy/ctaTemplate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vnpy/trader/app/ctaStrategy/ctaTemplate.py b/vnpy/trader/app/ctaStrategy/ctaTemplate.py index 9dcf52f5..9b4c2042 100644 --- a/vnpy/trader/app/ctaStrategy/ctaTemplate.py +++ b/vnpy/trader/app/ctaStrategy/ctaTemplate.py @@ -404,14 +404,15 @@ class BarManager(object): self.xminBar.open = bar.open self.xminBar.high = bar.high self.xminBar.low = bar.low + + self.xminBar.datetime = bar.datetime # 以第一根分钟K线的开始时间戳作为X分钟线的时间戳 # 累加老K线 else: self.xminBar.high = max(self.xminBar.high, bar.high) self.xminBar.low = min(self.xminBar.low, bar.low) # 通用部分 - self.xminBar.close = bar.close - self.xminBar.datetime = bar.datetime + self.xminBar.close = bar.close self.xminBar.openInterest = bar.openInterest self.xminBar.volume += int(bar.volume)