Bug Fixed : + 1

This commit is contained in:
Luis Fernando Molina committed 2019-07-08 19:31:38 +02:00
1 parent 1e15007d00
commit c5b3f09e8f
1 file changed
+1 -1
+1 -1
View File
@@ -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.