stocks=['600000.SH','000001.SZ']
quote = ContextInfo.get_full_tick(stocks)
#quote=ContextInfo.get_full_tick(['600000.SH','000001.SZ'])
for stk in stocks:
print('股票代码:', stk)
ContextInfo.B[stk]={}
timestamp=quote1[stk]['timetag']
ContextInfo.B[stk][timestamp]=quote1[stk]['lastPrice']
# 使用字典合并方法
if len(ContextInfo.B)==0:
return
if len(ContextInfo.B)>0:
ContextInfo.quote3 = {**ContextInfo.quote3, **ContextInfo.B}
print(ContextInfo.quote3)
if len(ContextInfo.quote3) >= 10:
ContextInfo.quote3.pop(0)
老师,我用上面的代码取多股多tick数据,存到ContextInfo.quote3上去,但是就只能取到最后一个数据,
请老师帮我写取多股多时段tick的数据的代码?
|