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

在一台新电脑上布署vnpy,重新申请了一个rqdate账号,配置了rqdata。
用脚本执行getdata.py,成功的取到了分钟数据,
然后打开vnpy,使用ui界面获取数据,第一次出现这样的出错提示:Not permit to get minbar price
然后再试,出现下面这样的错误:
PermissionDenied: login session num reached MAX limit

Traceback (most recent call last):
  File "C:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 365, in run_downloading
    data = rqdata_client.query_history(req)
  File "C:\vnstudio\lib\site-packages\vnpy\trader\rqdata.py", line 132, 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 439, in get_minbar
    "get_minbar_v", order_book_ids, start_date, end_date, fields, duration, market=market
  File "C:\vnstudio\lib\site-packages\rqdatac\decorators.py", line 63, in wrap
    raise e
  File "C:\vnstudio\lib\site-packages\rqdatac\decorators.py", line 59, in wrap
    return func(*args, **kwargs)
  File "C:\vnstudio\lib\site-packages\rqdatac\thread_local.py", line 43, in execute
    return self._execute(self._get_connection(), method, args, kwargs)
  File "C:\vnstudio\lib\site-packages\rqdatac\thread_local.py", line 39, in _execute
    raise e
  File "C:\vnstudio\lib\site-packages\rqdatac\thread_local.py", line 34, in _execute
    return conn.execute(method, *args, **kwargs)
  File "C:\vnstudio\lib\site-packages\rqdatac\connection.py", line 132, in execute
    msg_type, body = self._read_one_packet()
  File "C:\vnstudio\lib\site-packages\rqdatac\connection.py", line 78, in _read_one_packet
    header = self._sf.read(HEADER_LENGTH)
  File "C:\vnstudio\lib\socket.py", line 589, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

继续执行getdata.py,发现的错误是:rqdatac.share.errors.PermissionDenied: login session num reached MAX limit

我以为是session的问题,于是重启了一下电脑,还是不行。

请问一下这个是什么原因啊?

谢谢。

Member
avatar
加入于:
帖子: 123
声望: 2

再次尝试:

17:43:34    IF88.CFFEX-1m开始下载历史数据
17:43:34    数据下载失败,触发异常:
Traceback (most recent call last):
  File "C:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 365, in run_downloading
    data = rqdata_client.query_history(req)
  File "C:\vnstudio\lib\site-packages\vnpy\trader\rqdata.py", line 132, 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 439, in get_minbar
    "get_minbar_v", order_book_ids, start_date, end_date, fields, duration, market=market
  File "C:\vnstudio\lib\site-packages\rqdatac\decorators.py", line 59, in wrap
    return func(*args, **kwargs)
  File "C:\vnstudio\lib\site-packages\rqdatac\thread_local.py", line 43, in execute
    return self._execute(self._get_connection(), method, args, kwargs)
  File "C:\vnstudio\lib\site-packages\rqdatac\thread_local.py", line 39, in _execute
    raise e
  File "C:\vnstudio\lib\site-packages\rqdatac\thread_local.py", line 34, in _execute
    return conn.execute(method, *args, **kwargs)
  File "C:\vnstudio\lib\site-packages\rqdatac\connection.py", line 132, in execute
    msg_type, body = self._read_one_packet()
  File "C:\vnstudio\lib\site-packages\rqdatac\connection.py", line 102, in _read_one_packet
    raise get_error(code)(msg)
rqdatac.share.errors.QuotaExceeded: login session num reached MAX limit
Member
加入于:
帖子: 6
声望: 0

09:14:13 IF88.CFFEX-1m开始下载历史数据
09:14:13 数据下载失败,触发异常:
Traceback (most recent call last):
File "D:\Program Files\vnpy\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 365, in run_downloading
data = rqdata_client.query_history(req)
File "D:\Program Files\vnpy\lib\site-packages\vnpy\trader\rqdata.py", line 132, in query_history
adjust_type="none"
File "D:\Program Files\vnpy\lib\site-packages\rqdatac\decorators.py", line 131, in wrap
return func(args, **kwargs)
File "D:\Program Files\vnpy\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 "D:\Program Files\vnpy\lib\site-packages\rqdatac\services\get_price.py", line 439, in get_minbar
"get_minbar_v", order_book_ids, start_date, end_date, fields, duration, market=market
File "D:\Program Files\vnpy\lib\site-packages\rqdatac\decorators.py", line 59, in wrap
return func(
args, kwargs)
File "D:\Program Files\vnpy\lib\site-packages\rqdatac\thread_local.py", line 43, in execute
return self._execute(self._get_connection(), method, args, kwargs)
File "D:\Program Files\vnpy\lib\site-packages\rqdatac\thread_local.py", line 39, in _execute
raise e
File "D:\Program Files\vnpy\lib\site-packages\rqdatac\thread_local.py", line 34, in _execute
return conn.execute(method, *args,
kwargs)
File "D:\Program Files\vnpy\lib\site-packages\rqdatac\connection.py", line 132, in execute
msg_type, body = self._read_one_packet()
File "D:\Program Files\vnpy\lib\site-packages\rqdatac\connection.py", line 102, in _read_one_packet
raise get_error(code)(msg)
rqdatac.share.errors.QuotaExceeded: login session num reached MAX limit

Member
加入于:
帖子: 6
声望: 0

每次启动CTA回测就报连接超限,是不是程序进行了多余的初始化连接?

Member
加入于:
帖子: 6
声望: 0

估计是程序光连接不释放,导致连接数超限。我死等半小时,等另一个不知道哪里的连接超时了断了,这个就可以下载数据了,不报错了。

Member
avatar
加入于:
帖子: 24
声望: 1

我从昨天开始也出现了这个报错

Administrator
avatar
加入于:
帖子: 2125
声望: 96

请去Github下载master分支的代码后解压,运行python setup.py install更新到VNStudio中即可,RQData服务器升级了

Member
avatar
加入于:
帖子: 24
声望: 1

用Python的交易员 wrote:

请去Github下载master分支的代码后解压,运行python setup.py install更新到VNStudio中即可,RQData服务器升级了

就是用的这个版本覆盖的 之前还能下 昨天开始突然就报错了

Member
avatar
加入于:
帖子: 123
声望: 2

用Python的交易员 wrote:

请去Github下载master分支的代码后解压,运行python setup.py install更新到VNStudio中即可,RQData服务器升级了

照做了,还是报错误:

ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

而且我看master的最后修改是17天前,我是前两天安装的2.0.7版本
应该是最新的吧?

Administrator
avatar
加入于:
帖子: 2125
声望: 96

ConnectionResetError,这个报错是网络问题或者正好服务端在升级。

2.0.7不是最新的,master分支在发布后做了升级修改。

Member
avatar
加入于:
帖子: 123
声望: 2

用Python的交易员 wrote:

ConnectionResetError,这个报错是网络问题或者正好服务端在升级。

2.0.7不是最新的,master分支在发布后做了升级修改。

请问一下你测试有没有问题?
我已经升级了,昨天升级后是这个问题。
今天运行还是这个问题,如果是网络问题或者正好服务端在升级不会这么巧吧?

Administrator
avatar
加入于:
帖子: 2125
声望: 96

我这里昨天和今天都做了测试,全部都工作正常,如果始终不行请联系RQData看看是否IP被禁止了

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

用Python的交易员 wrote:

请去Github下载master分支的代码后解压,运行python setup.py install更新到VNStudio中即可,RQData服务器升级了
具体怎么做的,setup.py 运行了在code里面,然后运行后PS C:\Users\User> & C:/vnstudio/python.exe c:/Users/User/Desktop/vnpy-master/vnpy/setup.py
Traceback (most recent call last):
File "c:/Users/User/Desktop/vnpy-master/vnpy/setup.py", line 192, in <module>
version=get_version_string(),
File "c:/Users/User/Desktop/vnpy-master/vnpy/setup.py", line 88, in get_version_string
with open("vnpy/init.py", "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'vnpy/init.py' 纯新手 咋弄累

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

17:20:02 初始化CTA回测引擎
17:20:02 策略文件加载完成
17:20:02 RQData数据接口初始化成功
17:20:08 ----------------------------------------
17:20:08 IF88.CFFEX-1m开始下载历史数据
17:20:09 数据下载失败,触发异常:
Traceback (most recent call last):
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 365, in run_downloading
data = rqdata_client.query_history(req)
File "C:\vnstudio\lib\site-packages\vnpy\trader\rqdata.py", line 132, 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 回测下载不了数据,可是跑策略时候能连上行情

Administrator
avatar
加入于:
帖子: 2125
声望: 96

卓允 wrote:

用Python的交易员 wrote:

请去Github下载master分支的代码后解压,运行python setup.py install更新到VNStudio中即可,RQData服务器升级了
具体怎么做的,setup.py 运行了在code里面,然后运行后PS C:\Users\User> & C:/vnstudio/python.exe c:/Users/User/Desktop/vnpy-master/vnpy/setup.py
Traceback (most recent call last):
File "c:/Users/User/Desktop/vnpy-master/vnpy/setup.py", line 192, in <module>
version=get_version_string(),
File "c:/Users/User/Desktop/vnpy-master/vnpy/setup.py", line 88, in get_version_string
with open("vnpy/init.py", "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'vnpy/init.py' 纯新手 咋弄累

请在cmd中运行代码,python setup.py install,而不是在vscode中运行setup.py

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