From d22986a2a9e399956733b12329409c38d2706134 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Thu, 13 Sep 2018 14:19:01 +0800 Subject: [PATCH] bug fix --- vnpy/trader/app/ctaStrategy/ctaLineBar.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/vnpy/trader/app/ctaStrategy/ctaLineBar.py b/vnpy/trader/app/ctaStrategy/ctaLineBar.py index 763e31fe..4918c6a5 100644 --- a/vnpy/trader/app/ctaStrategy/ctaLineBar.py +++ b/vnpy/trader/app/ctaStrategy/ctaLineBar.py @@ -3131,7 +3131,7 @@ class CtaMinuteBar(CtaLineBar): # 一天内bar的数量累计 self.bars_count = 0 self.minutes_adjust = -15 - + self.m1_bars_count = 0 self.lastMinuteBar = CtaBarData() def init_properties(self): @@ -3214,9 +3214,9 @@ class CtaMinuteBar(CtaLineBar): if l1 == 0: self.lineBar.append(bar) self.curTradingDay = bar.tradingDay - self.m1_bars_count += bar_freq + #self.m1_bars_count += bar_freq if bar_is_completed: - self.m1_bars_count = 0 + #self.m1_bars_count = 0 self.onBar(bar) return @@ -3279,7 +3279,6 @@ class CtaMinuteBar(CtaLineBar): lastBar.mid4 = round((2*lastBar.close + lastBar.high + lastBar.low)/4, self.round_n) lastBar.mid5 = round((2*lastBar.close + lastBar.open + lastBar.high + lastBar.low)/5, self.round_n) - # ---------------------------------------------------------------------- def drawLineBar(self, tick): """ @@ -3516,7 +3515,7 @@ class CtaHourBar(CtaLineBar): self.curTradingDay = bar.tradingDay if self.is_7x24: - if (bar.datetime - lastBar.datetime).total_seconds() >=60 * self.barTimeInterval: + if (bar.datetime - lastBar.datetime).total_seconds() >=3600 * self.barTimeInterval: is_new_bar = True self.curTradingDay = bar.tradingDay