From 7858fa3fca6ef12169bc5a3d38673430b7f39627 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Thu, 20 Oct 2016 20:03:51 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug:=20bar=E7=9A=84=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E6=97=B6=E9=97=B4=EF=BC=8C=E4=B8=BA=E7=AC=AC=E4=B8=80=E4=B8=AA?= =?UTF-8?q?tick=E7=9A=84=E6=97=B6=E9=97=B4=EF=BC=88=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E7=A7=92=E6=95=B0=E5=92=8C=E6=AF=AB=E7=A7=92=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.trader/ctaAlgo/ctaLineBar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vn.trader/ctaAlgo/ctaLineBar.py b/vn.trader/ctaAlgo/ctaLineBar.py index 2b7b8c0d..e6f341c6 100644 --- a/vn.trader/ctaAlgo/ctaLineBar.py +++ b/vn.trader/ctaAlgo/ctaLineBar.py @@ -374,8 +374,10 @@ class CtaLineBar(object): # K线的日期时间 self.bar.date = tick.date # K线的日期时间(去除秒)设为第一个Tick的时间 - self.bar.time = tick.time # K线的日期时间(去除秒)设为第一个Tick的时间 + self.bar.datetime = tick.datetime + self.bar.datetime.replace(second=0, microsecond=0) # K线的日期时间(去除秒)设为第一个Tick的时间 + self.bar.time = self.bar.datetime.strftime('%H:%M:%S') # K线的日期时间(去除秒)设为第一个Tick的时间 self.bar.volume = tick.volume self.bar.openInterest = tick.openInterest