2017-10-14 12:40:26 +00:00
|
|
|
#!/usr/bin/env python3
|
2017-10-13 13:50:50 +00:00
|
|
|
|
2017-10-15 15:24:49 +00:00
|
|
|
"""This script generate json data from bittrex"""
|
2017-11-05 23:16:24 +00:00
|
|
|
import json
|
|
|
|
from os import path
|
2017-10-15 15:24:49 +00:00
|
|
|
|
2017-11-05 23:16:24 +00:00
|
|
|
from freqtrade import exchange
|
|
|
|
from freqtrade.exchange import Bittrex
|
2017-10-13 13:50:50 +00:00
|
|
|
|
2017-11-05 23:16:24 +00:00
|
|
|
PAIRS = ['BTC-OK', 'BTC-NEO', 'BTC-DASH', 'BTC-ETC', 'BTC-ETH', 'BTC-SNT']
|
|
|
|
OUTPUT_DIR = path.dirname(path.realpath(__file__))
|
2017-10-13 13:50:50 +00:00
|
|
|
|
2017-11-05 23:16:24 +00:00
|
|
|
# Init Bittrex exchange
|
|
|
|
exchange._API = Bittrex({'key': '', 'secret': ''})
|
|
|
|
|
|
|
|
for pair in PAIRS:
|
|
|
|
data = exchange.get_ticker_history(pair)
|
|
|
|
filename = path.join(OUTPUT_DIR, '{}.json'.format(pair.lower()))
|
|
|
|
with open(filename, 'w') as fp:
|
|
|
|
json.dump(data, fp)
|