Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] 查询螺纹钢主力合约的k线时报错,纯碱鸡蛋的没问题, #490

Open
ForgetThatNight opened this issue Aug 27, 2024 · 1 comment

Comments

@ForgetThatNight
Copy link

这里是报错信息
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')

@shinny-xuyida
Copy link
Collaborator

首先期货合约是没有支持前后复权参数的,可以去掉之后再获取试试,如果仍然有问题可以贴出最小复现代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants