From 08be48ba08834aa22fa75006c7364d2ea699777e Mon Sep 17 00:00:00 2001 From: "mati108@gmail.com" <34651529+matbenitez@users.noreply.github.com> Date: Mon, 11 Feb 2019 19:54:27 -0300 Subject: [PATCH] Temporary fix for market rate not available --- Assistant.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Assistant.js b/Assistant.js index f5e86c857..d4fbb4346 100644 --- a/Assistant.js +++ b/Assistant.js @@ -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.");