Merge pull request #36 from AAVikings/master

Temporary fix for market rate not available
This commit is contained in:
z@tOr authored and GitHub committed 2019-02-11 19:54:51 -03:00
commit 01fa27892d
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.");