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

连接正常,合约订阅正常
试图下载
22:34:41 ----------------------------------------
22:34:41 XBTUSD.BITMEX-1m开始下载历史数据
22:35:02 数据下载失败,触发异常:
Traceback (most recent call last):
File "C:\vnstudio\lib\site-packages\urllib3\connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "C:\vnstudio\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection
raise err
File "C:\vnstudio\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\vnstudio\lib\site-packages\urllib3\connectionpool.py", line 672, in urlopen
chunked=chunked,
File "C:\vnstudio\lib\site-packages\urllib3\connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "C:\vnstudio\lib\site-packages\urllib3\connectionpool.py", line 994, in _validate_conn
conn.connect()
File "C:\vnstudio\lib\site-packages\urllib3\connection.py", line 334, in connect
conn = self._new_conn()
File "C:\vnstudio\lib\site-packages\urllib3\connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x00000212956FE320>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\vnstudio\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\vnstudio\lib\site-packages\urllib3\connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "C:\vnstudio\lib\site-packages\urllib3\util\retry.py", line 436, 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=2019-06-06T00%3A00%3A00&endTime=2019-12-06T23%3A59%3A59 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000212956FE320>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 377, in run_downloading
req, contract.gateway_name
File "C:\vnstudio\lib\site-packages\vnpy\trader\engine.py", line 207, in query_history
return gateway.query_history(req)
File "C:\vnstudio\lib\site-packages\vnpy\gateway\bitmex\bitmex_gateway.py", line 146, in query_history
return self.rest_api.query_history(req)
File "C:\vnstudio\lib\site-packages\vnpy\gateway\bitmex\bitmex_gateway.py", line 345, in query_history
params=params
File "C:\vnstudio\lib\site-packages\vnpy\api\rest\rest_client.py", line 497, in request
proxies=self.proxies,
File "C:\vnstudio\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, kwargs)
File "C:\vnstudio\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep,
send_kwargs)
File "C:\vnstudio\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\vnstudio\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.bitmex.com', port=443): Max retries exceeded with url: /api/v1/trade/bucketed?binSize=1m&symbol=XBTUSD&count=750&startTime=2019-06-06T00%3A00%3A00&endTime=2019-12-06T23%3A59%3A59 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000212956FE320>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。'))

Administrator
avatar
加入于:
帖子: 3902
声望: 208

这种报错,通常是因为翻墙工具的流量控制导致的,建议换个稳定的试试

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

谢谢,好了

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