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

按照陈老师30课的方法,下载BITMEX中xbtusd的1m数据,2017/7/1开始的数据,
总是下载几天的数据就卡主了,
比如设置7/1到7/3下载成功。在设置下载7/3到7/31号的就卡在7/12号不动了。
反复试过很多次,都不行,
想跑下30课的回测,一直卡在这里,了解的大佬帮忙看看吧,谢谢

卡主了会有如下错误信息输出:好像是网络的问题,但是我vpn一直正常的,vntrader上的数据信息也一直在更新
Exception in thread Thread-14:
Traceback (most recent call last):
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\urllib3\connectionpool.py", line 597, in urlopen
self._prepare_proxy(conn)
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\urllib3\connectionpool.py", line 807, in _prepare_proxy
conn.connect()
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\urllib3\connection.py", line 350, in connect
sslcontext=context)
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\urllib3\util\ssl
.py", line 355, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\ssl.py", line 412, in wrap_socket
session=session
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\ssl.py", line 853, in _create
self.do_handshake()
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\urllib3\connectionpool.py", line 641, in urlopen
_stacktrace=sys.exc_info()[2])
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\urllib3\util\retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.bitmex.com', port=443): Max retries exceeded with url: /api/v1/trade/bucketed?binSize=1m&symbol=XBTUSD&count=750&startTime=2017-07-14+13%3A00%3A00&endTime=2017-07-21 (Caused by ProxyError('Cannot connect to proxy.', OSError(0, 'Error')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\threading.py", line 865, in run
self._target(*self._args, self._kwargs)
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 356, in run_downloading
data = self.main_engine.query_history(req, contract.gateway_name)
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\vnpy\trader\engine.py", line 206, in query_history
return gateway.query_history(req)
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\vnpy\gateway\bitmex\bitmex_gateway.py", line 144, in query_history
return self.rest_api.query_history(req)
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\vnpy\gateway\bitmex\bitmex_gateway.py", line 325, in query_history
params=params
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\vnpy\api\rest\rest_client.py", line 322, in request
proxies=self.proxies,
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url,
kwargs)
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, send_kwargs)
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request,
kwargs)
File "E:\mkygogo\vnpy\vnstation2.0.3\lib\site-packages\requests\adapters.py", line 510, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.bitmex.com', port=443): Max retries exceeded with url: /api/v1/trade/bucketed?binSize=1m&symbol=XBTUSD&count=750&startTime=2017-07-14+13%3A00%3A00&endTime=2017-07-21 (Caused by ProxyError('Cannot connect to proxy.', OSError(0, 'Error')))

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

应该是代理处理问题:能上网,不代表能够稳定连接bitmex交易所

Member
avatar
加入于:
帖子: 21
声望: 5

KeKe wrote:

应该是代理处理问题:能上网,不代表能够稳定连接bitmex交易所
后来尝试下载rqdata模块的数据,按天下载的正常,分钟级别的数据还是会卡主
用1.9.2里那个单独下载数据的DataService能正常下载分钟级别数据

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