Deprecated
315 currency pairs in Binance: ['ADABNB', 'ADABTC', 'ADAETH', 'ADAUSDT', 'ADXBNB', 'ADXBTC', 'ADXETH', 'AEBNB', 'AEBTC', 'AEETH', 'AIONBNB', 'AIONBTC', 'AIONETH', 'AMBBNB', 'AMBBTC', 'AMBETH', 'APPCBNB', 'APPCBTC', 'APPCETH', 'ARKBTC', 'ARKETH', 'ARNBTC', 'ARNETH', 'ASTBTC', 'ASTETH', 'BATBNB', 'BATBTC', 'BATETH', 'BCCBNB', 'BCCBTC', 'BCCETH', 'BCCUSDT', 'BCDBTC', 'BCDETH', 'BCNBNB', 'BCNBTC', 'BCNETH', 'BCPTBNB', 'BCPTBTC', 'BCPTETH', 'BLZBNB', 'BLZBTC', 'BLZETH', 'BNBBTC', 'BNBETH', 'BNBUSDT', 'BNTBTC', 'BNTETH', 'BQXBTC', 'BQXETH', 'BRDBNB', 'BRDBTC', 'BRDETH', 'BTCUSDT', 'BTGBTC', 'BTGETH', 'BTSBNB', 'BTSBTC', 'BTSETH', 'CDTBTC', 'CDTETH', 'CHATBTC', 'CHATETH', 'CLOAKBTC', 'CLOAKETH', 'CMTBNB', 'CMTBTC', 'CMTETH', 'CNDBNB', 'CNDBTC', 'CNDETH', 'DASHBTC', 'DASHETH', 'DGDBTC', 'DGDETH', 'DLTBNB', 'DLTBTC', 'DLTETH', 'DNTBTC', 'DNTETH', 'EDOBTC', 'EDOETH', 'ELFBTC', 'ELFETH', 'ENGBTC', 'ENGETH', 'ENJBTC', 'ENJETH', 'EOSBTC', 'EOSETH', 'ETCBTC', 'ETCETH', 'ETHBTC', 'ETHUSDT', 'EVXBTC', 'EVXETH', 'FUELBTC', 'FUELETH', 'FUNBTC', 'FUNETH', 'GASBTC', 'GNTBNB', 'GNTBTC', 'GNTETH', 'GRSBTC', 'GRSETH', 'GTOBNB', 'GTOBTC', 'GTOETH', 'GVTBTC', 'GVTETH', 'GXSBTC', 'GXSETH', 'HSRBTC', 'HSRETH', 'ICNBTC', 'ICNETH', 'ICXBNB', 'ICXBTC', 'ICXETH', 'INSBTC', 'INSETH', 'IOSTBTC', 'IOSTETH', 'IOTABNB', 'IOTABTC', 'IOTAETH', 'KMDBTC', 'KMDETH', 'KNCBTC', 'KNCETH', 'LENDBTC', 'LENDETH', 'LINKBTC', 'LINKETH', 'LOOMBNB', 'LOOMBTC', 'LOOMETH', 'LRCBTC', 'LRCETH', 'LSKBNB', 'LSKBTC', 'LSKETH', 'LTCBNB', 'LTCBTC', 'LTCETH', 'LTCUSDT', 'LUNBTC', 'LUNETH', 'MANABTC', 'MANAETH', 'MCOBNB', 'MCOBTC', 'MCOETH', 'MDABTC', 'MDAETH', 'MODBTC', 'MODETH', 'MTHBTC', 'MTHETH', 'MTLBTC', 'MTLETH', 'NANOBNB', 'NANOBTC', 'NANOETH', 'NAVBNB', 'NAVBTC', 'NAVETH', 'NCASHBNB', 'NCASHBTC', 'NCASHETH', 'NEBLBNB', 'NEBLBTC', 'NEBLETH', 'NEOBNB', 'NEOBTC', 'NEOETH', 'NEOUSDT', 'NULSBNB', 'NULSBTC', 'NULSETH', 'OAXBTC', 'OAXETH', 'OMGBTC', 'OMGETH', 'ONTBNB', 'ONTBTC', 'ONTETH', 'OSTBNB', 'OSTBTC', 'OSTETH', 'PIVXBNB', 'PIVXBTC', 'PIVXETH', 'POABNB', 'POABTC', 'POAETH', 'POEBTC', 'POEETH', 'POWRBNB', 'POWRBTC', 'POWRETH', 'PPTBTC', 'PPTETH', 'QLCBNB', 'QLCBTC', 'QLCETH', 'QSPBNB', 'QSPBTC', 'QSPETH', 'QTUMBNB', 'QTUMBTC', 'QTUMETH', 'QTUMUSDT', 'RCNBNB', 'RCNBTC', 'RCNETH', 'RDNBNB', 'RDNBTC', 'RDNETH', 'REPBNB', 'REPBTC', 'REPETH', 'REQBTC', 'REQETH', 'RLCBNB', 'RLCBTC', 'RLCETH', 'RPXBNB', 'RPXBTC', 'RPXETH', 'SALTBTC', 'SALTETH', 'SNGLSBTC', 'SNGLSETH', 'SNMBTC', 'SNMETH', 'SNTBTC', 'SNTETH', 'STEEMBNB', 'STEEMBTC', 'STEEMETH', 'STORJBTC', 'STORJETH', 'STORMBNB', 'STORMBTC', 'STORMETH', 'STRATBTC', 'STRATETH', 'SUBBTC', 'SUBETH', 'SYSBNB', 'SYSBTC', 'SYSETH', 'TNBBTC', 'TNBETH', 'TNTBTC', 'TNTETH', 'TRIGBNB', 'TRIGBTC', 'TRIGETH', 'TRXBTC', 'TRXETH', 'VENBNB', 'VENBTC', 'VENETH', 'VIABNB', 'VIABTC', 'VIAETH', 'VIBBTC', 'VIBEBTC', 'VIBEETH', 'VIBETH', 'WABIBNB', 'WABIBTC', 'WABIETH', 'WANBNB', 'WANBTC', 'WANETH', 'WAVESBNB', 'WAVESBTC', 'WAVESETH', 'WINGSBTC', 'WINGSETH', 'WPRBTC', 'WPRETH', 'WTCBNB', 'WTCBTC', 'WTCETH', 'XEMBNB', 'XEMBTC', 'XEMETH', 'XLMBNB', 'XLMBTC', 'XLMETH', 'XMRBTC', 'XMRETH', 'XRPBTC', 'XRPETH', 'XRPUSDT', 'XVGBTC', 'XVGETH', 'XZCBNB', 'XZCBTC', 'XZCETH', 'YOYOBNB', 'YOYOBTC', 'YOYOETH', 'ZECBTC', 'ZECETH', 'ZILBNB', 'ZILBTC', 'ZILETH', 'ZRXBTC', 'ZRXETH']
6 currency pairs in Bitmex: ['XBTUSD', 'ADAM18', 'BCHM18', 'ETHM18', 'LTCM18', 'XRPM18']
12 currency pairs in GDAX: ['BCH-BTC', 'BCH-EUR', 'BCH-USD', 'BTC-EUR', 'BTC-GBP', 'BTC-USD', 'ETH-BTC', 'ETH-EUR', 'ETH-USD', 'LTC-BTC', 'LTC-EUR', 'LTC-USD']
57 currency pairs in Kraken: ['BCHEUR', 'BCHUSD', 'BCHXBT', 'DASHEUR', 'DASHUSD', 'DASHXBT', 'EOSETH', 'EOSEUR', 'EOSUSD', 'EOSXBT', 'GNOETH', 'GNOEUR', 'GNOUSD', 'GNOXBT', 'USDTZUSD', 'XETCXETH', 'XETCXXBT', 'XETCZEUR', 'XETCZUSD', 'XETHXXBT', 'XETHZCAD', 'XETHZEUR', 'XETHZGBP', 'XETHZJPY', 'XETHZUSD', 'XICNXETH', 'XICNXXBT', 'XLTCXXBT', 'XLTCZEUR', 'XLTCZUSD', 'XMLNXETH', 'XMLNXXBT', 'XREPXETH', 'XREPXXBT', 'XREPZEUR', 'XREPZUSD', 'XXBTZCAD', 'XXBTZEUR', 'XXBTZGBP', 'XXBTZJPY', 'XXBTZUSD', 'XXDGXXBT', 'XXLMXXBT', 'XXLMZEUR', 'XXLMZUSD', 'XXMRXXBT', 'XXMRZEUR', 'XXMRZUSD', 'XXRPXXBT', 'XXRPZCAD', 'XXRPZEUR', 'XXRPZJPY', 'XXRPZUSD', 'XZECXXBT', 'XZECZEUR', 'XZECZJPY', 'XZECZUSD']
99 currency pairs in Poloniex: ['BTC_AMP', 'BTC_ARDR', 'BTC_BCH', 'BTC_BCN', 'BTC_BCY', 'BTC_BELA', 'BTC_BLK', 'BTC_BTCD', 'BTC_BTM', 'BTC_BTS', 'BTC_BURST', 'BTC_CLAM', 'BTC_CVC', 'BTC_DASH', 'BTC_DCR', 'BTC_DGB', 'BTC_DOGE', 'BTC_EMC2', 'BTC_ETC', 'BTC_ETH', 'BTC_EXP', 'BTC_FCT', 'BTC_FLDC', 'BTC_FLO', 'BTC_GAME', 'BTC_GAS', 'BTC_GNO', 'BTC_GNT', 'BTC_GRC', 'BTC_HUC', 'BTC_LBC', 'BTC_LSK', 'BTC_LTC', 'BTC_MAID', 'BTC_NAV', 'BTC_NEOS', 'BTC_NMC', 'BTC_NXC', 'BTC_NXT', 'BTC_OMG', 'BTC_OMNI', 'BTC_PASC', 'BTC_PINK', 'BTC_POT', 'BTC_PPC', 'BTC_RADS', 'BTC_REP', 'BTC_RIC', 'BTC_SBD', 'BTC_SC', 'BTC_STEEM', 'BTC_STORJ', 'BTC_STR', 'BTC_STRAT', 'BTC_SYS', 'BTC_VIA', 'BTC_VRC', 'BTC_VTC', 'BTC_XBC', 'BTC_XCP', 'BTC_XEM', 'BTC_XMR', 'BTC_XPM', 'BTC_XRP', 'BTC_XVC', 'BTC_ZEC', 'BTC_ZRX', 'ETH_BCH', 'ETH_CVC', 'ETH_ETC', 'ETH_GAS', 'ETH_GNO', 'ETH_GNT', 'ETH_LSK', 'ETH_OMG', 'ETH_REP', 'ETH_STEEM', 'ETH_ZEC', 'ETH_ZRX', 'USDT_BCH', 'USDT_BTC', 'USDT_DASH', 'USDT_ETC', 'USDT_ETH', 'USDT_LTC', 'USDT_NXT', 'USDT_REP', 'USDT_STR', 'USDT_XMR', 'USDT_XRP', 'USDT_ZEC', 'XMR_BCN', 'XMR_BLK', 'XMR_BTCD', 'XMR_DASH', 'XMR_LTC', 'XMR_MAID', 'XMR_NXT', 'XMR_ZEC']
489 total currency pairs in 5 exchanges.
requests
numpy
matplotlib
mpl_finance
Data is stored in /exchange/{exchange_name}/{currency_pair_name}.csv
separately for each currency pair.
Currently supports five exchanges:
Binance exchange:
import binance_data
client = binance_data.Binance()
Bitmex exchange:
import bitmex_data
client = bitmex_data.Bitmex()
GDAX exchange:
import gdax_data
client = gdax_data.Gdax()
Kraken exchange:
import kraken_data
client = kraken_data.Kraken()
Poloniex exchange:
import poloniex_data
client = poloniex_data.Poloniex()
Code for each exchange share four universal public methods:
client.download_data(currency_pair_name, start_unix, end_unix)
Downloads trade data for currency_pair_name
for specified UNIX timestamp range.
As long as start_unix
is fixed, this method can resume download from the last saved trade.
To change start_unix
to a point further back in time, you must delete all /exchange/{exchange_name}/{currency_pair_name}.csv
files associated with your download scope.
client.get_trades(currency_pair_name, start_unix, end_unix)
Fetches downloaded trade data as a list of python dict, in the order of increasing UNIX.
client.get_charts(currency_pair_name, start_unix, end_unix, interval)
Fetches downloaded trade data and builds OHLC + additional information from trade data as a list of python dict, in the order of increasing UNIX.
client.get_pairs()
Fetches all currency pairs currently supported by the exchange.
These exchange clients and their methods are incorporated in the DataManager
class:
import data_manager
dm = data_manager.DataManager()
DataManager
offers the following methods:
dm.get_trades(exchange_name, currency_pair_name, start_unix, end_unix)
Downloads and returns trade data as a list of python dicts, in the order of increasing UNIX.
dm.get_charts(exchange_name, currency_pair_name, start_unix, end_unix)
Downloads trade data and returns OHLC data as a list of python dicts, in the order of increasing UNIX.
dm.download_all(start_unix, end_unix)
Concurrently downloads all pairs from each exchange.
dm.all_clients()
dm.all_pairs()
Fetches all suppoerted exchange client instances and list of currency pairs for each exchange, respectively.
The following test file downloads most recent trades of BTC and ETH currencies paired with USD/USDT and plots OHLC:
/tests/test_plot.py
The following test file downloads currency pairs from each exchange and plots OHLC:
/tests/test_exchange_data.py