diff --git a/.vs/AABruce/v15/.suo b/.vs/AABruce/v15/.suo index fd10d74af..2c99f0fa5 100644 Binary files a/.vs/AABruce/v15/.suo and b/.vs/AABruce/v15/.suo differ diff --git a/One-Min-Daily-Candles/Interval.js b/One-Min-Daily-Candles/Interval.js index a66eb8c10..745dd12f1 100644 --- a/One-Min-Daily-Candles/Interval.js +++ b/One-Min-Daily-Candles/Interval.js @@ -105,7 +105,7 @@ Read the trades from Charly's Output and pack them into daily files with candles let thisDatetime = new Date(); - if ((year === thisDatetime.getUTCFullYear() && month > thisDatetime.getUTCMonth() + 1) || year > thisDatetime.getUTCFullYear()) { + if ((year === thisDatetime.getUTCFullYear() && parseInt(month) > thisDatetime.getUTCMonth() + 1) || year > thisDatetime.getUTCFullYear()) { logger.write("[INFO] We are too far in the future. Interval will not execute. Sorry."); return; @@ -114,7 +114,7 @@ Read the trades from Charly's Output and pack them into daily files with candles let atHeadOfMarket; // This tell us if we are at the month which includes the head of the market according to current datetime. - if ((year === thisDatetime.getUTCFullYear() && month === thisDatetime.getUTCMonth() + 1)) { + if ((year === thisDatetime.getUTCFullYear() && parseInt(month) === thisDatetime.getUTCMonth() + 1)) { atHeadOfMarket = true; @@ -302,7 +302,18 @@ Read the trades from Charly's Output and pack them into daily files with candles firstTradeFile = new Date(statusReport.lastFile.year + "-" + statusReport.lastFile.month + "-" + statusReport.lastFile.days + " " + statusReport.lastFile.hours + ":" + statusReport.lastFile.minutes + GMT_SECONDS); - getHoleFixing(); + if ((year === firstTradeFile.getUTCFullYear() && parseInt(month) < firstTradeFile.getUTCMonth() + 1) || year < firstTradeFile.getUTCFullYear()) { + + const logText = "[INFO] 'getStatusReport' - the requested month / year are before the begining of this market " + market.assetA + '_' + market.assetB + " . Skipping it. "; + logger.write(logText); + + closeAndOpenMarket(); + + } else { + + getHoleFixing(); + + } } catch (err) { @@ -589,6 +600,8 @@ Read the trades from Charly's Output and pack them into daily files with candles if (date.getUTCMonth() + 1 !== parseInt(month)) { + lastCandleFile = new Date(lastCandleFile.valueOf() - ONE_DAY_IN_MILISECONDS); + writeStatusReport(lastCandleFile, lastCandleClose, true, onStatusReportWritten); return;