[Mod]修改DataRecording功能对于Tick时间戳的处理,兼容某些行情源Tick时间戳没有毫秒的情况
This commit is contained in:
parent
384eb71b28
commit
81ad791747
@ -175,7 +175,10 @@ class DrEngine(object):
|
|||||||
|
|
||||||
# 生成datetime对象
|
# 生成datetime对象
|
||||||
if not tick.datetime:
|
if not tick.datetime:
|
||||||
|
if '.' in tick.time:
|
||||||
tick.datetime = datetime.strptime(' '.join([tick.date, tick.time]), '%Y%m%d %H:%M:%S.%f')
|
tick.datetime = datetime.strptime(' '.join([tick.date, tick.time]), '%Y%m%d %H:%M:%S.%f')
|
||||||
|
else:
|
||||||
|
tick.datetime = datetime.strptime(' '.join([tick.date, tick.time]), '%Y%m%d %H:%M:%S')
|
||||||
|
|
||||||
self.onTick(tick)
|
self.onTick(tick)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user