Temporary fix for market rate not available

This commit is contained in:
mati108@gmail.com committed 2019-02-11 19:54:27 -03:00
1 parent 740e96ce0c
commit 08be48ba08
1 file changed
+3 -2
+3 -2
View File
@@ -182,7 +182,9 @@
end: candleArray[i][5]
};
if (bot.processDatetime.valueOf() >= candle.begin && bot.processDatetime.valueOf() < candle.end) {
// TODO condition added for when there is no market rate available.
if ((bot.processDatetime.valueOf() >= candle.begin && bot.processDatetime.valueOf() < candle.end)
|| (i + 1) === candleArray.length) {
marketRate = (candle.open + candle.close) / 2;
marketRate = thisObject.truncDecimals(marketRate);
@@ -198,7 +200,6 @@
return;
}
}
} catch (err) {
logger.write(MODULE_NAME, "[ERROR] initialize -> getMarketRateFromIndicator -> onFileReceived -> err = " + err.message);
logger.write(MODULE_NAME, "[ERROR] initialize -> getMarketRateFromIndicator -> onFileReceived -> Asuming this is a temporary situation. Requesting a Retry.");