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

CTA回测模块,下载数据异常。系统默认参数配置,RQData配置信息已填写正确。
异常如下,请问可能是什么原因呢

15:50:39 初始化CTA回测引擎
15:50:39 策略文件加载完成
15:50:39 RQData数据接口初始化成功
15:50:43 ----------------------------------------
15:50:43 IF88.CFFEX-1m开始下载历史数据
15:50:43 数据下载失败,触发异常:
Traceback (most recent call last):
File "E:\vnpy-2.0.8\vnpy\app\cta_backtester\engine.py", line 381, in run_downloading
data = rqdata_client.query_history(req)
File "E:\vnpy-2.0.8\vnpy\trader\rqdata.py", line 136, in query_history
adjust_type="none"
File "E:\ProgramData\Anaconda3\lib\site-packages\rqdatac\decorators.py", line 131, in wrap
return func(args, **kwargs)
File "E:\ProgramData\Anaconda3\lib\site-packages\rqdatac\services\get_price.py", line 117, in get_price
pf = get_minbar(order_book_ids, start_date, end_date, fields, duration, market)
File "E:\ProgramData\Anaconda3\lib\site-packages\rqdatac\services\get_price.py", line 433, in get_minbar
"get_minbar_v", order_book_ids, start_date, end_date, fields, duration, market
File "E:\ProgramData\Anaconda3\lib\site-packages\rqdatac\decorators.py", line 59, in wrap
return func(
args, **kwargs)
File "E:\ProgramData\Anaconda3\lib\site-packages\rqdatac\connection_pool.py", line 25, in execute
with self._get_connection() as conn:
File "E:\ProgramData\Anaconda3\lib\contextlib.py", line 112, in enter
return next(self.gen)
File "E:\ProgramData\Anaconda3\lib\site-packages\rqdatac\connection_pool.py", line 36, in _get_connection
conn = self._ensure_connection()
File "E:\ProgramData\Anaconda3\lib\site-packages\rqdatac\connection_pool.py", line 52, in _ensure_connection
if conn.is_nomal():
AttributeError: 'Connection' object has no attribute 'is_nomal'

Member
avatar
加入于:
帖子: 9
声望: 0

抽出来 单独执行 是正常的。
import rqdatac as rq
from rqdatac import *
from rqdatac.services.basic import all_instruments as rqdata_all_instruments
from rqdatac.services.get_price import get_price
rq.init()

df = get_price(
"IF88",
frequency="1m",
fields=["open", "high", "low", "close", "volume"],
start_date="2017-01-04 00:00:00",
end_date="2020-01-05 23:59:59",
adjust_type="none"
)
print(df.head())
在 vnpy cta回测模块 点 下载数据 就异常了。哎。。难道和我测试账号有关。

Member
avatar
加入于:
帖子: 9
声望: 0

看了 另外一个 大哥的帖子 原来是 'is_nomal' 少了 给 r 。
但 为啥 直接调又正常呢。走的 流程不同?

Administrator
avatar
加入于:
帖子: 3809
声望: 197

本质应该是rqdata版本太老导致的,试试pip install rqdatac --upgrade升级下

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