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

CTA策略初始化,载入历史数据触发异常 File "C:\veighna_studio\lib\site-packages\vnpy_okx\okx_gateway.py", line 432, in query_history ts, o, h, l, c, vol, _ = bar_list ValueError: too many values to unpack (expected 7) #38

Open
linhertz opened this issue Aug 31, 2024 · 3 comments

Comments

@linhertz
Copy link

[TEST] 触发异常已停止
Traceback (most recent call last):
File "C:\veighna_studio\lib\site-packages\vnpy_ctastrategy\engine.py", line 615, in call_strategy_func
func()
File "C:\Develop\strategies\BTC_240831_tick_OC.py", line 227, in on_init
self.load_bar(10)
File "C:\veighna_studio\lib\site-packages\vnpy_ctastrategy\template.py", line 306, in load_bar
bars: List[BarData] = self.cta_engine.load_bar(
File "C:\veighna_studio\lib\site-packages\vnpy_ctastrategy\engine.py", line 568, in load_bar
bars: List[BarData] = self.main_engine.query_history(req, contract.gateway_name)
File "C:\veighna_studio\lib\site-packages\vnpy\trader\engine.py", line 225, in query_history
return gateway.query_history(req)
File "C:\veighna_studio\lib\site-packages\vnpy_okx\okx_gateway.py", line 202, in query_history
return self.rest_api.query_history(req)
File "C:\veighna_studio\lib\site-packages\vnpy_okx\okx_gateway.py", line 432, in query_history
ts, o, h, l, c, vol, _ = bar_list
ValueError: too many values to unpack (expected 7)

@poloxue
Copy link

poloxue commented Sep 8, 2024

这个 gateway 问题挺多的,不止于这一个问题,各种乱七八遭的情况。作者就是打了个样板,估计都没实际交易过,估计他们也不用。

我修改了,但是没被合并,

http://github.com/poloxue/vnpy_okx

已经用了一年多了

@linhertz
Copy link
Author

linhertz commented Sep 9, 2024

这个 gateway 问题挺多的,不止于这一个问题,各种乱七八遭的情况。作者就是打了个样板,估计都没实际交易过,估计他们也不用。

我修改了,但是没被合并,

http://github.com/poloxue/vnpy_okx

已经用了一年多了

谢谢分享!

@veighna-global
Copy link
Owner

抱歉,我们团队不怎么用OKX交易所,现有代码应该是之前从官方那边转过来的版本,很久没有更新了,争取9月安排一下更新

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

3 participants