This commit is contained in:
vn.py 2017-12-02 21:59:23 +08:00
parent cc5c85f1ba
commit d8817247d3

View File

@ -408,7 +408,7 @@ class BarManager(object):
self.xminBar.volume += int(bar.volume) self.xminBar.volume += int(bar.volume)
# X分钟已经走完 # X分钟已经走完
if not bar.datetime.minute % self.xmin: # 可以用X整除 if not (bar.datetime.minute + 1) % self.xmin: # 可以用X整除
# 生成上一X分钟K线的时间戳 # 生成上一X分钟K线的时间戳
self.xminBar.datetime = self.xminBar.datetime.replace(second=0, microsecond=0) # 将秒和微秒设为0 self.xminBar.datetime = self.xminBar.datetime.replace(second=0, microsecond=0) # 将秒和微秒设为0
self.xminBar.date = self.xminBar.datetime.strftime('%Y%m%d') self.xminBar.date = self.xminBar.datetime.strftime('%Y%m%d')