143 views
0

gklines = gapi.get_kline_serial(SYMBOL,KTIME,data_length=800)
File “C:\Program1\python\lib\site-packages\tqsdk\api.py”, line 500, in get_kl
ne_serial
raise Exception(“获取 %s (%d) 的K线超时,请检查客户端及网络是否正常” % (sym
ol, duration_seconds))
Exception: 获取 [‘SHFE.rb2001’] (1800) 的K线超时,请检查客户端及网络是否正常

Answered question
0

最简代码测试没问题,可以再试试看

from tqsdk import TqApi, TqKq, TqAuth
api = TqApi(TqKq(),auth=TqAuth(""))
klines = api.get_kline_serial("SHFE.rb2001",1800,800)
print(klines)
api.close()
Posted new comment

行情延迟的问题,是否也是因为获取k线数据超时导致的?有这个可能