From b574af80f1173e94f814781ca53c04965676723d Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 25 Jul 2017 10:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9strategyKingKeltner=E4=B8=AD5?= =?UTF-8?q?=E5=88=86=E9=92=9FK=E7=BA=BF=E7=9A=84=E5=90=88=E6=88=90?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/app/ctaStrategy/strategy/strategyKingKeltner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vnpy/trader/app/ctaStrategy/strategy/strategyKingKeltner.py b/vnpy/trader/app/ctaStrategy/strategy/strategyKingKeltner.py index 84163ea3..f8290229 100644 --- a/vnpy/trader/app/ctaStrategy/strategy/strategyKingKeltner.py +++ b/vnpy/trader/app/ctaStrategy/strategy/strategyKingKeltner.py @@ -137,8 +137,8 @@ class KkStrategy(CtaTemplate): #---------------------------------------------------------------------- def onBar(self, bar): """收到Bar推送(必须由用户继承实现)""" - # 如果当前是一个5分钟走完 - if bar.datetime.minute % 5 == 0: + # 如果当前是一个5分钟走完(分钟线的时间戳是当前分钟的开始时间戳,因此要+1) + if (bar.datetime.minute + 1) % 5 == 0: # 如果已经有聚合5分钟K线 if self.fiveBar: # 将最新分钟的数据更新到目前5分钟线中