From c5b3f09e8f3430411adfcf6b250c07be2621a40b Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 8 Jul 2019 19:31:38 +0200 Subject: [PATCH] Bug Fixed : + 1 --- Commons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Commons.js b/Commons.js index 192a9d495..abdaf0911 100644 --- a/Commons.js +++ b/Commons.js @@ -372,7 +372,7 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { /* We skip the candle at the head of the market because i has not closed yet. */ let candlesPerDay = ONE_DAY_IN_MILISECONDS / timePeriod if (i === candles.length - 1) { - if ((i > candlesPerDay && i < candlesPerDay * 2) || (i < candlesPerDay)) { + if ((candles.length < candlesPerDay) || (candles.length > candlesPerDay && i < candlesPerDay * 2) ) { /*We are at the head of the market, thus we skip the last candle because it has not close yet. */ continue; /* Note here that in the last candle of the first day or the second day it will use an incomplete candle and partially calculated indicators.