diff --git a/TaskServer/MultiPeriodDaily.js b/TaskServer/MultiPeriodDaily.js index bd4e91486..86f72a8b2 100644 --- a/TaskServer/MultiPeriodDaily.js +++ b/TaskServer/MultiPeriodDaily.js @@ -279,11 +279,13 @@ const timeFrameLabel = TS.projects.superalgos.globals.timeFrames.dailyFilePeriods()[n][1] /* Check Time Frames Filter */ - if (bot.dailyTimeFrames !== undefined) { - if (bot.dailyTimeFrames.includes(timeFrameLabel) === false) { - /* We are not going to process this Time Frame */ - timeFramesControlLoop() - return + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.dailyTimeFrames !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.dailyTimeFrames.includes(timeFrameLabel) === false) { + /* We are not going to process this Time Frame */ + timeFramesControlLoop() + return + } } } @@ -520,8 +522,12 @@ let timeFrameLabel = TS.projects.superalgos.globals.timeFrames.dailyFilePeriods()[n][1] /* Check Time Frames Filter */ - if (bot.dailyTimeFrames !== undefined) { - if (bot.dailyTimeFrames.includes(timeFrameLabel) === true) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.dailyTimeFrames !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.dailyTimeFrames.includes(timeFrameLabel) === true) { + timeFramesArray.push(timeFrameLabel) + } + } else { timeFramesArray.push(timeFrameLabel) } } else { @@ -553,8 +559,10 @@ thisReport.file.lastFile = lastFileDate; thisReport.file.interExecutionMemoryArray = interExecutionMemoryArray; thisReport.file.beginingOfMarket = beginingOfMarket.toUTCString() - if (bot.dailyTimeFrames !== undefined) { - thisReport.file.timeFrames = bot.dailyTimeFrames + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.dailyTimeFrames !== undefined) { + thisReport.file.timeFrames = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.dailyTimeFrames + } } thisReport.save(callBack) diff --git a/TaskServer/MultiPeriodMarket.js b/TaskServer/MultiPeriodMarket.js index a122a3c46..cb26dc706 100644 --- a/TaskServer/MultiPeriodMarket.js +++ b/TaskServer/MultiPeriodMarket.js @@ -60,11 +60,13 @@ const timeFrameLabel = TS.projects.superalgos.globals.timeFrames.marketFilesPeriods()[n][1] /* Check Time Frames Filter */ - if (bot.marketTimeFrames !== undefined) { - if (bot.marketTimeFrames.includes(timeFrameLabel) === false) { - /* We are not going to process this Time Frame */ - timeFramesControlLoop() - return + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.marketTimeFrames !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.marketTimeFrames.includes(timeFrameLabel) === false) { + /* We are not going to process this Time Frame */ + timeFramesControlLoop() + return + } } } @@ -141,7 +143,7 @@ } function writeTimeFramesFiles(callBack) { - let outputDatasets = TS.projects.superalgos.utilities.nodeFunctions.nodeBranchToArray (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput, 'Output Dataset') + let outputDatasets = TS.projects.superalgos.utilities.nodeFunctions.nodeBranchToArray(TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput, 'Output Dataset') let outputDatasetIndex = -1; controlLoop() @@ -167,8 +169,12 @@ let timeFrameLabel = TS.projects.superalgos.globals.timeFrames.marketFilesPeriods()[n][1] /* Check Time Frames Filter */ - if (bot.marketTimeFrames !== undefined) { - if (bot.marketTimeFrames.includes(timeFrameLabel) === true) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.marketTimeFrames !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.marketTimeFrames.includes(timeFrameLabel) === true) { + timeFramesArray.push(timeFrameLabel) + } + } else { timeFramesArray.push(timeFrameLabel) } } else { @@ -197,8 +203,10 @@ let thisReport = statusDependencies.statusReports.get(reportKey) thisReport.file.lastExecution = bot.processDatetime; - if (bot.marketTimeFrames !== undefined) { - thisReport.file.timeFrames = bot.marketTimeFrames + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.marketTimeFrames !== undefined) { + thisReport.file.timeFrames = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.marketTimeFrames + } } thisReport.save(callBack) diff --git a/TaskServer/ProcessInstance.js b/TaskServer/ProcessInstance.js index 73595936c..1bb246182 100644 --- a/TaskServer/ProcessInstance.js +++ b/TaskServer/ProcessInstance.js @@ -63,13 +63,6 @@ "-" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName - - /* Time Frame Filter */ - if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter !== undefined) { - botConfig.dailyTimeFrames = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.dailyTimeFrames - botConfig.marketTimeFrames = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.timeFramesFilter.config.marketTimeFrames - } - if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference !== undefined) { if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent !== undefined) { let key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent