vn.py量化社区
By Traders, For Traders.
Member
加入于:
帖子: 78
声望: 0

我试着运行了下no_ui的脚本,在策略初始化之后触发异常:
Traceback (most recent call last):
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 584, in call_strategy_func
func()
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\strategies\commodity.py", line 55, in on_init
self.load_bar(90)
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\template.py", line 233, in load_bar
self.cta_engine.load_bar(self.vt_symbol, days, interval, callback)
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 539, in load_bar
bars = self.query_bar_from_rq(symbol, exchange, interval, start, end)
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 145, in query_bar_from_rq
data = rqdata_client.query_history(req)
File "C:\vnstudio\lib\site-packages\vnpy\trader\rqdata.py", line 136, in query_history
adjust_type="none"
File "C:\vnstudio\lib\site-packages\rqdatac\decorators.py", line 131, in wrap
return func(args, **kwargs)
File "C:\vnstudio\lib\site-packages\rqdatac\services\get_price.py", line 124, in get_price
pf = get_minbar(order_book_ids, start_date, end_date, fields, duration, market)
File "C:\vnstudio\lib\site-packages\rqdatac\services\get_price.py", line 441, in get_minbar
data = [(obid, {k: np.frombuffer(
v) for k, v in d.items()}) for obid, d in data]
TypeError: 'NoneType' object is not iterable

好像是rqdata这边出了问题,请问应该怎么解决?

Administrator
avatar
加入于:
帖子: 4028
声望: 221

这个报错是从米筐的服务器获取历史数据失败,请检查下你的合约代码配置是否正确吧,可以试试用图形界面的CtaBacktester来下载数据

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3