[Mod]修改QuantosDataService的兼容性

This commit is contained in:
vn.py 2018-02-14 13:02:16 +08:00
parent c99a085daa
commit 44b7ecf108

View File

@ -86,7 +86,13 @@ def downMinuteBarBySymbol(api, vtSymbol, startDate, endDate=''):
start = time()
code, exchange = vtSymbol.split('.')
# 对于期货合约的vtSymbol没有交易所后缀
if exchange in ['SSE', 'SZSE']:
cl = db[vtSymbol]
else:
cl = db[code]
cl.ensure_index([('datetime', ASCENDING)], unique=True) # 添加索引
dt = datetime.strptime(startDate, '%Y%m%d')