scrtlabs / catalyst

An Algorithmic Trading Library for Crypto-Assets in Python
http://enigma.co
Apache License 2.0
2.47k stars 721 forks source link

unable to ingest market data #539

Open 5267 opened 5 years ago

5267 commented 5 years ago

Dear Catalyst Maintainers,

Before I tell you about my issue, let me describe my environment:

Environment

Now that you know a little about me, let me tell you about the issue I am having:

Description of Issue

when i run this command (catalyst ingest-exchange -x binance -f daily -i btc_usdt ) to ingest data, i got errors :

catalyst.exchange.exchange_errors.ExchangeRequestError: Request failed: binance GET https://api.binance.com/api/v1/exchangeInfo HTTPSConnectionPool(host='api.binance.com', port=443): Max retries exceeded with url: /api/v1/exchangeInfo (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x000000001444ABE0>, 'Connection to api.binance.com timed out. (connect timeout=10)'))

Here is how you can reproduce this issue on your machine:

Reproduction Steps

1.catalyst ingest-exchange -x binance -f daily -i btc_usdt

What steps have you taken to resolve this already?

i tried several trading pairs, it also bugs like that above mentioned, i don't what happened? but i run: catalyst ingest-exchange -x bitfinex -f daily -i xrp_usd , i can ingest data without any problem.

Sincerely, cryto quant

f0cii commented 5 years ago

I have the same problem and solved it. By modifying the following files, by using a proxy, it may be due to network issues (such as in China)

D:\ProgramData\Miniconda3\envs\catalyst\Lib\site-packages\catalyst\exchange\ccxt\ccxt_exchange.py

self.api = exchange_attr({ 'apiKey': key, 'secret': secret, 'password': password, })

Using a proxy

        self.api.proxies = {
            'http': 'http://127.0.0.1:1080',
            'https': 'http://127.0.0.1:1080',
        }
        self.api.enableRateLimit = True