Bug Fixed

This commit is contained in:
Luis Fernando Molina committed 2020-03-09 17:57:58 +01:00
1 parent 892fb452fe
commit 4c51a2cd71
1 file changed
+21 -9
+21 -9
View File
@@ -94,7 +94,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileSt
'secret': secret,
'timeout': 30000,
'enableRateLimit': true,
verbose: false,
verbose: true,
options: options
}
if (rateLimit !== undefined) {
@@ -365,16 +365,28 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileSt
return
}
let record = allOHLCVs[i]
let OHLCV = {
timestamp: record[0],
open: record[1],
hight: record[2],
low: record[3],
close: record[4],
volume: record[5]
let OHLCV = { // these values should be overrided unless there are no OHLVCs fetched from the exchange.
timestamp: (new Date()).valueOf() + ONE_MIN,
open: 0,
hight: 0,
low: 0,
close: 0,
volume: 0
}
let record = allOHLCVs[i]
if (record !== undefined) { // can be undefined if there is no candle fetched from the exchange
OHLCV = {
timestamp: record[0],
open: record[1],
hight: record[2],
low: record[3],
close: record[4],
volume: record[5]
}
}
let candleMinute = Math.trunc(candle.begin / ONE_MIN)
let OHLCVMinute