Skip to content

Commit

Permalink
more fixes to okcoinusd/okex fetchOHLCV #2964
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed May 27, 2018
1 parent 767fcff commit 0f21328
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/okcoinusd.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,17 @@ module.exports = class okcoinusd extends Exchange {
}

parseOHLCV (ohlcv, market = undefined, timeframe = '1m', since = undefined, limit = undefined) {
let numElements = ohlcv.length;
let volumeIndex = (numElements > 6) ? 6 : 5;
return [
ohlcv[0], // timestamp
ohlcv[1], // Open
ohlcv[2], // High
ohlcv[3], // Low
ohlcv[4], // Close
// ohlcv[5], // quote volume
ohlcv[6], // base volume
// ohlcv[6], // base volume
ohlcv[volumeIndex], // okex will return base volume in the 7th element for future markets
];
}

Expand Down

0 comments on commit 0f21328

Please sign in to comment.