Candlize
Parse different types of trading data into candle format with optional Exponential Moving Average added. This script handles inputs in the format from bitcoincharts and in the format from poloniex. More formats might be added in the future.
To use with BitcoinCharts, collect hourly candles and add exponential moving averages on 8, 32 and 41 hour periods:
wget http://api.bitcoincharts.com/v1/csv/okcoinCNY.csv.gzcat ./okcoinCNY.csv.gz | gzip -d | candlizer --period 3600 --ema 8,32,41 > ./okcoinCNY-hourly-ema8-32-41.candles
For handling poloniex format, you must pass --intype poloniex
and the content must be from the
returnChartData API request.
curl 'https://poloniex.com/public?command=returnChartData¤cyPair=BTC_ETC&start=0&end=9999999999&period=14400' > poloniex_etc.jsoncat poloniex_etc.json | candlizer --period 3600 --ema 8,32,41 > ./poloniex_etc-hourly-ema8-32-41.candles
The format of the candles is as follows:
API Usage
const Candlize = ;const conf = period: 3600 intype: CandlizeBITCOINCHARTS ema: 8 32 41;const candalizer = Candlize;processstdin;processstdin;processstdin;processstdin;