BitMEX 100倍杠杆永续合约,注册BitMex请使用日本IP:比特币量化交易交流群:191896494
有热心问起用python调用bitmex时出现以下报错信息,虽然笔者并不懂python,但我看到response(timeout)的报错信息之后,猜测程序并不能和bitmex服务器建立http链接,极有可能是IP被墙了,更换服务器IP后问题得到解决。
C:\Users\g7837\PycharmProjects\untitled\venv\Scripts\python.exe D:/quant_git/CrossMarketArb/cross_market_arb.py
Traceback (most recent call last):
File "D:/quant_git/CrossMarketArb/cross_market_arb.py", line 468, in <module>
multicore()
File "D:/quant_git/CrossMarketArb/cross_market_arb.py", line 134, in multicore
market = Market()
File "D:/quant_git/CrossMarketArb/cross_market_arb.py", line 171, in __init__
symbol='XBTZ18')
File "D:\quant_git\CrossMarketArb\cross_market_api.py", line 116, in __init__
self.client = BitmexClient(test=False, api_key=self._api_key, api_secret=self._secret_key)
File "D:\quant_git\CrossMarketArb\bitmex_api.py", line 6, in __init__
self.client = bitmex.bitmex(test, api_key, api_secret)
File "C:\Users\g7837\PycharmProjects\untitled\venv\lib\site-packages\bitmex.py", line 38, in bitmex
return SwaggerClient.from_url(spec_uri, config=config)
File "C:\Users\g7837\PycharmProjects\untitled\venv\lib\site-packages\bravado\client.py", line 96, in from_url
spec_dict = loader.load_spec(spec_url)
File "C:\Users\g7837\PycharmProjects\untitled\venv\lib\site-packages\bravado\swagger_model.py", line 104, in load_spec
self.request_headers,
File "C:\Users\g7837\PycharmProjects\untitled\venv\lib\site-packages\bravado\http_future.py", line 213, in result
incoming_response = self._get_incoming_response(timeout)
File "C:\Users\g7837\PycharmProjects\untitled\venv\lib\site-packages\bravado\http_future.py", line 97, in wrapper
return func(self, *args, **kwargs)
File "C:\Users\g7837\PycharmProjects\untitled\venv\lib\site-packages\bravado\http_future.py", line 228, in _get_incoming_response
inner_response = self.future.result(timeout=timeout)
File "C:\Users\g7837\PycharmProjects\untitled\venv\lib\site-packages\bravado\requests_client.py", line 310, in result
self.misc_options['ssl_cert'],
File "C:\Users\g7837\PycharmProjects\untitled\venv\lib\site-packages\requests\sessions.py", line 678, in merge_environment_settings
proxies.setdefault(k, v)
AttributeError: 'NoneType' object has no attribute 'setdefault'