补齐OANDA接口中的行情时间数据的毫秒部分

This commit is contained in:
vn.py 2017-08-09 12:41:17 +08:00
parent fe198aa40f
commit ea3ca6427a

View File

@ -329,7 +329,7 @@ class Api(OandaApi):
tick.vtSymbol = '.'.join([tick.symbol, tick.exchange]) tick.vtSymbol = '.'.join([tick.symbol, tick.exchange])
tick.bidPrice1 = d['bid'] tick.bidPrice1 = d['bid']
tick.askPrice1 = d['ask'] tick.askPrice1 = d['ask']
tick.time = getTime(d['time']) tick.time = getTime(d['time']) + '.0' # 补齐毫秒部分
# 做市商的TICK数据只有买卖的报价因此最新价格选用中间价代替 # 做市商的TICK数据只有买卖的报价因此最新价格选用中间价代替
tick.lastPrice = (tick.bidPrice1 + tick.askPrice1)/2 tick.lastPrice = (tick.bidPrice1 + tick.askPrice1)/2