12
Follow
57
Followers
我尝试直接读交易所的信息,代码如下
from urllib import request
def fetch_url_data(url):
try:
req = request.urlopen(url).read().decode('utf-8') # 请求url(GET请求)
return json.loads(req)
except Exception as e:
print('交易所接口检测出错:', e)
url = "https://www.okex.me/api/spot/v3/instruments"
data = fetch_url_data(url)
在研究中心能够读取数据,但是接入回测时,报错如下:
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
研究了半天,有说是服务器设置了代理,有说python3 对 urllib 库的使用变动,请教大神这是肿么回事啊··· >.<
Related Recommendations
Advanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?5.5 Trading strategy optimization
Comment
All comments (5)
- 1
