Skip to content

Commit

Permalink
bitz throw a warning message on 24h ohlcv volumes fix ccxt#3271
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jun 28, 2018
1 parent 26d4956 commit 7ce0c2d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions js/bitz.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ module.exports = class bitz extends Exchange {
'price': 8,
},
'options': {
'fetchOHLCVVolume': true,
'fetchOHLCVWarning': true,
'lastNonceTimestamp': 0,
},
'commonCurrencies': {
Expand Down Expand Up @@ -286,7 +288,23 @@ module.exports = class bitz extends Exchange {
return this.parseTrades (trades, market, since, limit);
}

parseOHLCV (ohlcv, market = undefined, timeframe = '1m', since = undefined, limit = undefined) {
let volume = this.options['fetchOHLCVVolume'] ? ohlcv[5] : undefined;
return [
ohlcv[0],
ohlcv[1],
ohlcv[2],
ohlcv[3],
ohlcv[4],
volume,
];
}

async fetchOHLCV (symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
if (this.options['fetchOHLCVWarning']) {
// eslint-disable-next-line quotes
throw new ExchangeError (this.id + " will return 24h volumes instead of volumes for " + timeframe + " from their API. Set .options['fetchOHLCVWarning'] = false to suppress this warning message. You can set .options['fetchOHLCVVolume'] = false to fetch candles with volume set to undefined.");
}
await this.loadMarkets ();
let market = this.market (symbol);
let response = await this.publicGetKline (this.extend ({
Expand Down

0 comments on commit 7ce0c2d

Please sign in to comment.