diff --git a/.vs/AABruce/v15/.suo b/.vs/AABruce/v15/.suo index d5b26ab71..fd10d74af 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 904e73648..a66eb8c10 100644 --- a/One-Min-Daily-Candles/Interval.js +++ b/One-Min-Daily-Candles/Interval.js @@ -395,10 +395,21 @@ Read the trades from Charly's Output and pack them into daily files with candles statusReport = JSON.parse(text); - lastCandleFile = new Date(statusReport.lastFile.year + "-" + statusReport.lastFile.month + "-" + statusReport.lastFile.days + " " + "00:00" + GMT_SECONDS); - lastCandleClose = statusReport.candleClose; + if (statusReport.monthCompleted === true) { - buildCandles(); + const logText = "[INFO] 'getStatusReport' - The current year / month is already complete for market " + market.assetA + '_' + market.assetB + " . Skipping it. "; + logger.write(logText); + + closeAndOpenMarket(); + + } else { + + lastCandleFile = new Date(statusReport.lastFile.year + "-" + statusReport.lastFile.month + "-" + statusReport.lastFile.days + " " + "00:00" + GMT_SECONDS); + lastCandleClose = statusReport.candleClose; + + buildCandles(); + + } } catch (err) { @@ -435,7 +446,7 @@ Read the trades from Charly's Output and pack them into daily files with candles */ - if ((year === firstTradeFile.getUTCFullYear() && month === firstTradeFile.getUTCMonth() + 1)) { + if ((year === firstTradeFile.getUTCFullYear() && parseInt(month) === firstTradeFile.getUTCMonth() + 1)) { /* @@ -447,7 +458,7 @@ Read the trades from Charly's Output and pack them into daily files with candles logger.write(logText); console.log(logText); - lastCandleFile = new Date(firstTradeFile.getUTCFullYear() + "-" + (firstTradeFile.getUTCMonth() + 1) + "-" + firstTradeFile.getUTCDay() + " " + "00:00" + GMT_SECONDS); + lastCandleFile = new Date(firstTradeFile.getUTCFullYear() + "-" + (firstTradeFile.getUTCMonth() + 1) + "-" + firstTradeFile.getUTCDate() + " " + "00:00" + GMT_SECONDS); lastCandleFile = new Date(lastCandleFile.valueOf() - ONE_DAY_IN_MILISECONDS); lastCandleClose = 0; @@ -543,6 +554,12 @@ Read the trades from Charly's Output and pack them into daily files with candles let date = new Date(lastCandleFile.valueOf() - 60 * 1000); + if (date.valueOf() < firstTradeFile.valueOf()) { // At the special case where we are at the begining of the market, this might be true. + + date = new Date(firstTradeFile.valueOf() - 60 * 1000); + + } + let candles = []; let volumes = []; diff --git a/One-Min-Daily-Candles/run.js b/One-Min-Daily-Candles/run.js index 01dfd2c6d..bb3dccd5b 100644 --- a/One-Min-Daily-Candles/run.js +++ b/One-Min-Daily-Candles/run.js @@ -11,8 +11,8 @@ const ROOT_DIR = '../'; const MODULE_NAME = "run"; -const START_ONE_MIN_DAILY_CANDLES_VOLUMES = false; -const START_ONE_MIN_DAILY_CANDLES_VOLUMES_AT_ONE_MONTH = true; +const START_ONE_MIN_DAILY_CANDLES_VOLUMES = true; +const START_ONE_MIN_DAILY_CANDLES_VOLUMES_AT_ONE_MONTH = false; const ONE_MIN_DAILY_CANDLES_MODULE = require('./One Min Daily Candles Volumes'); @@ -76,7 +76,7 @@ try { const newPloniexHoleFixing = ONE_MIN_DAILY_CANDLES_MODULE.newPloniexHoleFixing(bot); - let month = 6; + let month = 2; let year = 2015; newPloniexHoleFixing.initialize(year, month, onInitializeReady);