yyy20119 / huobi_grid_trader

a simple strategy of grid trading
31 stars 18 forks source link

链接火币服务器api超时问题 #1

Open xiegaoxi001 opened 3 years ago

xiegaoxi001 commented 3 years ago

Traceback (most recent call last): File "run.py", line 206, in huobi_trader.trade_forerver(order_symbol='BSV/USDT', order_amount=0.06, base_usdt=300) File "run.py", line 29, in wrapper return func(self, *args, kwargs) File "run.py", line 67, in trade_forerver order_price = self.last_price(order_symbol) - 0.2 File "/Users/xiegaoxi/Documents/huobi/huobi_grid_trader/grid_trader.py", line 34, in last_price return self.ccxt_exchange.fetch_ticker(order_symbol)['last'] File "/Library/Python/3.8/site-packages/ccxt/huobipro.py", line 520, in fetch_ticker self.load_markets() File "/Library/Python/3.8/site-packages/ccxt/base/exchange.py", line 1349, in load_markets currencies = self.fetch_currencies() File "/Library/Python/3.8/site-packages/ccxt/huobipro.py", line 765, in fetch_currencies response = self.publicGetSettingsCurrencys(self.extend(request, params)) File "/Library/Python/3.8/site-packages/ccxt/base/exchange.py", line 465, in inner return entry(_self, inner_kwargs) File "/Library/Python/3.8/site-packages/ccxt/base/exchange.py", line 490, in request return self.fetch2(path, api, method, params, headers, body) File "/Library/Python/3.8/site-packages/ccxt/base/exchange.py", line 486, in fetch2 return self.fetch(request['url'], request['method'], request['headers'], request['body']) File "/Library/Python/3.8/site-packages/ccxt/base/exchange.py", line 622, in fetch raise ExchangeError(details) from e ccxt.base.errors.ExchangeError: huobipro GET https://api.huobi.pro/v1/settings/currencys?language=en-US

辛苦能提供个联系方式吗?方便沟通一下为什么会有这个情况。 我的微信pxlxmx

yyy20119 commented 3 years ago

超时的话应该是没有科学上网的原因,试试在国外服务器上运行或者先翻墙。

xiegaoxi001 commented 3 years ago

我是自己在我电脑上面跑的,使用chrome 能正常翻墙,但是使用iTerm2 本地跑就会timeout . 你那边是本地跑的么?如何添加代理。

yyy20119 commented 3 years ago
self.ccxt_exchange.proxies={
    'http': 'socks5://127.0.0.1:10808',
    'https': 'socks5://127.0.0.1:10808',
}

可以试试在init里加上面几行代码添加代理。 我这边是放在国外服务器上跑的,所以没加这几行代码。

xiegaoxi001 commented 3 years ago

image 添加完代理还是不行,郁闷了