Skip to content

This is a python script that can fetch OHLCV data from Binance spot markets by drawing tokens from a CSV which specifies the ticker, the date you want to pull data from and the number of days worth of data you want.

Notifications You must be signed in to change notification settings

cryphash/Binance-OHLCV-Candle-Data-Collector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Hello, 

If you're reading this you'd like to run this code, I'd first like to credit ChatGPT for authoring this code with the help of it's lowly human assistant CH.

In order to run this code you will need to set up a .csv file with the headers Coin, Date and Days. This .csv file should be named "Data".

The "Coin" colunn should specify the ticker for the token you with the pair seperated by a forward slash, for example "BLUR/USDT".

The "Date" column should be populated in DD MM YYYY seperated by a forward slash, for example "01/01/23".

The "Days" column should be the number of days between todays date and the day you would like to pull data for, for example "4" would pull 4 days data.

Open your command terminal and paste "pip install ccxt" and hit return. This will install the libraries needed to run this code.

Open the CS9 python file in a code editor like Notepad++ and enter in your API Keys in the "ENTER YOUR API SECRET KEY HERE" & "ENTER YOUR API KEY HERE" fields, within the quotation marks.

Edit your candle size as desired by editing the value inside the quotation marks, for example "timeframe = '15'" will produce 15 minute candles.

In order to run the code navigate to the directory that contains the file and paste "python CS9_Binance.py".

The code will the run through the list of the coins you have provided outputting .csv files with the name format "(TICKER)_(PAIR)_ohlcv_data".


Until next time, 
CH

About

This is a python script that can fetch OHLCV data from Binance spot markets by drawing tokens from a CSV which specifies the ticker, the date you want to pull data from and the number of days worth of data you want.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages