[bug] 查询螺纹钢主力合约的k线时报错,纯碱鸡蛋的没问题,
Opened this issue · 1 comments
这里是报错信息
Traceback (most recent call last): File "/Users/anaconda3/lib/python3.10/site-packages/tqsdk/api.py", line 1894, in wait_update return self._wait_update(deadline=deadline, _task=_task) File "/Users/anaconda3/lib/python3.10/site-packages/tqsdk/api.py", line 1901, in _wait_update self._run_until_idle(async_run=False) File "/Users/anaconda3/lib/python3.10/site-packages/tqsdk/baseApi.py", line 94, in _run_until_idle self._run_once() File "/Users/anaconda3/lib/python3.10/site-packages/tqsdk/baseApi.py", line 84, in _run_once raise self._exceptions.pop(0) File "/Users/anaconda3/lib/python3.10/site-packages/tqsdk/lib/target_pos_task.py", line 359, in _target_pos_task self._quote = await self._api.get_quote(self._symbol) File "/Users/anaconda3/lib/python3.10/site-packages/tqsdk/api.py", line 441, in get_quote raise Exception(f"get_quote 中请求合约代码不能为空字符串") Exception: get_quote 中请求合约代码不能为空字符串 python-BaseException
这是请求代码
kline = api.get_kline_serial(“SHFE.rb2410”, int(tactic.base_freq.strip('分钟')) * 60, data_length=10000, adj_type='B')
首先期货合约是没有支持前后复权参数的,可以去掉之后再获取试试,如果仍然有问题可以贴出最小复现代码