From 3bdd8577436357b66f8df5c37115f88d677b6177 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 28 Jul 2020 17:27:42 +0200 Subject: [PATCH] Bug Dataset Updated Fixed --- LowFrequencyTrading/TradingProcess.js | 10 ++++++---- MultiPeriodDaily.js | 5 ++++- ProcessOutput.js | 1 - 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/LowFrequencyTrading/TradingProcess.js b/LowFrequencyTrading/TradingProcess.js index 4ce95db5c..aee4a0f74 100644 --- a/LowFrequencyTrading/TradingProcess.js +++ b/LowFrequencyTrading/TradingProcess.js @@ -617,9 +617,9 @@ } if (currentTimeFrame > global.dailyFilePeriods[0][0]) { - writeMarketStatusReport(onMarketStatusReport) + writeMarketStatusReport(currentTimeFrameLabel, onMarketStatusReport) } else { - writeDailyStatusReport(bot.tradingProcessDate, onDailyStatusReport); + writeDailyStatusReport(bot.tradingProcessDate, currentTimeFrameLabel, onDailyStatusReport); } } catch (err) { @@ -709,22 +709,24 @@ } } - function writeDailyStatusReport(lastFileDate, callBack) { + function writeDailyStatusReport(lastFileDate, currentTimeFrameLabel, callBack) { let reportKey = bot.dataMine + "-" + bot.codeName + "-" + bot.processNode.referenceParent.config.codeName let thisReport = statusDependencies.statusReports.get(reportKey); thisReport.file.lastExecution = bot.currentDaytime; thisReport.file.lastFile = lastFileDate; thisReport.file.simulationState = bot.simulationState; + thisReport.file.timeFrames = currentTimeFrameLabel thisReport.save(callBack); } - function writeMarketStatusReport(callBack) { + function writeMarketStatusReport(currentTimeFrameLabel, callBack) { let reportKey = bot.dataMine + "-" + bot.codeName + "-" + bot.processNode.referenceParent.config.codeName let thisReport = statusDependencies.statusReports.get(reportKey); thisReport.file.lastExecution = bot.processDatetime; thisReport.file.simulationState = bot.simulationState; + thisReport.file.timeFrames = currentTimeFrameLabel logger.newInternalLoop(bot.codeName, bot.process, bot.tradingProcessDate); thisReport.save(callBack); diff --git a/MultiPeriodDaily.js b/MultiPeriodDaily.js index 24d605d62..b3d0899ce 100644 --- a/MultiPeriodDaily.js +++ b/MultiPeriodDaily.js @@ -521,7 +521,7 @@ let timeFrameLabel = global.dailyFilePeriods[n][1] /* Check Time Frames Filter */ - if (bot.marketTimeFrames !== undefined) { + if (bot.dailyTimeFrames !== undefined) { if (bot.dailyTimeFrames.includes(timeFrameLabel) === true) { timeFramesArray.push(timeFrameLabel) } @@ -554,6 +554,9 @@ thisReport.file.lastFile = lastFileDate; thisReport.file.interExecutionMemoryArray = interExecutionMemoryArray; thisReport.file.beginingOfMarket = beginingOfMarket.toUTCString() + if (bot.dailyTimeFrames !== undefined) { + thisReport.file.timeFrames = bot.dailyTimeFrames + } thisReport.save(callBack) bot.hasTheBotJustStarted = false; diff --git a/ProcessOutput.js b/ProcessOutput.js index f9cb330d1..d9ee5a6ba 100644 --- a/ProcessOutput.js +++ b/ProcessOutput.js @@ -88,7 +88,6 @@ } global.EVENT_SERVER_CLIENT.createEventHandler(key, 'Dataset Updated') global.EVENT_SERVER_CLIENT.raiseEvent(key, 'Dataset Updated', event) - } } }