A simple python script for aggregating bitcoin raw trade data from several exchanges, and combine them into a single CSV file containing minute OHCLV candlesticks
# Install dependencies from requirements.txt file
$ pip install -r requirements.txt
$ python bitcoin-OHLC-generator.py --compression 1 -o bitcoin.csv
Required args:
- -c (--compression) num : Aggregate data into num minute OHLCV candlesticks
- -o (--output) file : Save generated candlesticks into file CSV format file
Bitcoin cryptocurrency is trading into different spot-exchanges, each of those with its last price, usually defined by the mid-price between its best bid and its bets offer (ask) prices.
The closest thing to an "official" BTCUSD price is the Bitcoin Reference Rate published by the Chicago Mercantile Exchange.
This reference price (and CME CF Bitcoin Real-time index) is calculated aggregating the trade flow of 5 major bitcoin spot exchanges:
* bitstamp
* coinbase
* bitfinex
* kraken
* itbit
This is the approach I followed to build this script, creating a tool that generates "official" historical OHLC candlestick data.
I hope you find this useful. Enjoy the ride!