Binance API Data Gathering Script Download - Stadivm Guides and Walkthroughs

Entelechy

Stadivm Owner
Staff member
Joined
Jul 8, 2018
Messages
161
Reaction score
30
Location
Stadivm.com
For anyone interested in going for algo/bot trading on Binance, gathering historic data from their API for backtesting is a must.

We've published download links to scripts that can be used to interact with the Binance API, and then to automatically create indicators such as MACD, RSI, EMA, Moving Averages etc.

 

HawksCoin

Neophyte
Joined
Jul 12, 2019
Messages
2
Reaction score
0
Location
Dayton OH
After gettting user name/password syntax correct in "data_bot_v3.py" I can see data scrolling by in my PyCharm run window. It been running for 10 minutes but I don't see any data in Robo 3T. Do I have to wait for all pars to process before data will apear in database?

When I visit URL: https://api.binance.com/api/v1/exchangeInfo
I see ("quoteAsset":"BTC",) in the output.
Is there a way to only collect data for BTC & USDT pairs? I am not interested in ETH ot BNB pairs.
Ideally, I just want data on he top 100 BTC or USDT pairs by market cap or volume.


After 15 minutes I got the following memory error.

DOGEUSDC
1499040000000
{'open_time': 1562911200000, 'open': 0.0032926, 'high': 0.0033181, 'low': 0.0032926, 'close': 0.0033181, 'volume': 68585.0, 'close_time': 1562914799999}
Traceback (most recent call last):
File "C:/stradivm/data_bot_v3.py", line 473, in <module>
data_bot = Data_Bot(exchange, intervals)
File "C:/stradivm/data_bot_v3.py", line 33, in init
self.execute_cycle(interval)
File "C:/stradivm/data_bot_v3.py", line 73, in execute_cycle
self.process_data()
File "C:/stradivm/data_bot_v3.py", line 181, in process_data
self.build_macds()
File "C:/stradivm/data_bot_v3.py", line 245, in build_macds
data_with_macds['macd_line'], data_with_macds['macd_signal'] = macd_line, macd_signal
MemoryError

Process finished with exit code 1
 

Entelechy

Stadivm Owner
Staff member
Joined
Jul 8, 2018
Messages
161
Reaction score
30
Location
Stadivm.com
Hi @HawksCoin, my guess is that the memory error is caused by your system running out of memory, as this script is fairly memory intensive. I normally use a digitalocean droplet with ~ 8 - 10Gb of memory to run it at an optimal speed.

Is there a way to only collect data for BTC & USDT pairs? I am not interested in ETH ot BNB pairs.
Ideally, I just want data on he top 100 BTC or USDT pairs by market cap or volume.
If you'd like, create a Request in the new data market we have here at https://stadivm.com/forums/data-market.99/, explaining exactly which data you need, and i'll try to modify the script to grab just that for you.