diff --git a/vn.trader/ctpGateway/ctpGateway.py b/vn.trader/ctpGateway/ctpGateway.py index a765c0ca..19b0dcc0 100644 --- a/vn.trader/ctpGateway/ctpGateway.py +++ b/vn.trader/ctpGateway/ctpGateway.py @@ -11,6 +11,7 @@ vtSymbol直接使用symbol import os import json from copy import copy +from datetime import datetime from vnctpmd import MdApi from vnctptd import TdApi @@ -330,7 +331,10 @@ class CtpMdApi(MdApi): tick.volume = data['Volume'] tick.openInterest = data['OpenInterest'] tick.time = '.'.join([data['UpdateTime'], str(data['UpdateMillisec']/100)]) - tick.date = data['TradingDay'] + + # 这里由于交易所夜盘时段的交易日数据有误,所以选择本地获取 + #tick.date = data['TradingDay'] + tick.date = datetime.now().strftime('%Y%m%d') tick.openPrice = data['OpenPrice'] tick.highPrice = data['HighestPrice']