diff --git a/DataDependencies.js b/DataDependencies.js index 44287c682..88e57be8e 100644 --- a/DataDependencies.js +++ b/DataDependencies.js @@ -19,13 +19,11 @@ return thisObject; function initialize(callBackFunction) { - try { /* Basic Valdidations */ if (bot.processNode.referenceParent.processDependencies !== undefined) { - if (bot.processNode.referenceParent.processDependencies.dataDependencies !== undefined) { - thisObject.nodeArray = bot.processNode.referenceParent.processDependencies.dataDependencies - } else { + thisObject.nodeArray = global.NODE_BRANCH_TO_ARRAY(bot.processNode.referenceParent.processDependencies, 'Data Dependency') + if (thisObject.nodeArray.length === 0) { logger.write(MODULE_NAME, "[ERROR] initialize -> onInitilized -> It is not possible to not have data dependencies at all."); callBackFunction(global.DEFAULT_OK_RESPONSE) return diff --git a/IndicatorOutput.js b/IndicatorOutput.js index 1f8d20691..d7f258b6b 100644 --- a/IndicatorOutput.js +++ b/IndicatorOutput.js @@ -53,7 +53,8 @@ } /* The first phase here is about checking that we have everything we need at the definition level. */ - let dataDependencies = bot.processNode.referenceParent.processDependencies.dataDependencies + let dataDependencies = global.NODE_BRANCH_TO_ARRAY(bot.processNode.referenceParent.processDependencies, 'Data Dependency') + if (commons.validateDataDependencies(dataDependencies, callBackFunction) !== true) { return } let outputDatasets = global.NODE_BRANCH_TO_ARRAY (bot.processNode.referenceParent.processOutput, 'Output Dataset') diff --git a/LowFrequencyTrading/TradingProcess.js b/LowFrequencyTrading/TradingProcess.js index 40f6dce13..0a4c584ec 100644 --- a/LowFrequencyTrading/TradingProcess.js +++ b/LowFrequencyTrading/TradingProcess.js @@ -504,7 +504,8 @@ let mainDependency = {} /* The first phase here is about checking that we have everything we need at the definition level. */ - let dataDependencies = bot.processNode.referenceParent.processDependencies.dataDependencies + let dataDependencies = global.NODE_BRANCH_TO_ARRAY(bot.processNode.referenceParent.processDependencies, 'Data Dependency') + if (commons.validateDataDependencies(dataDependencies, callBackFunction) !== true) { return } let outputDatasets = global.NODE_BRANCH_TO_ARRAY(bot.processNode.referenceParent.processOutput, 'Output Dataset') diff --git a/LowFrequencyTrading/TradingSimulation.js b/LowFrequencyTrading/TradingSimulation.js index 0ee2844a7..7b74f53a8 100644 --- a/LowFrequencyTrading/TradingSimulation.js +++ b/LowFrequencyTrading/TradingSimulation.js @@ -316,7 +316,7 @@ exports.newTradingSimulation = function newTradingSimulation(bot, logger, tradin easy access to the current candle for instance, or the current bollinger band, meaning the one the Simulation is currently standing at. For that reason we do the following processing, to have at the chart data structure the current objects of each indicator / time frame. */ - let dataDependencies = bot.processNode.referenceParent.processDependencies.dataDependencies + let dataDependencies = global.NODE_BRANCH_TO_ARRAY(bot.processNode.referenceParent.processDependencies, 'Data Dependency') /* Finding the Current Element on Market Files */ if (bot.processingDailyFiles) {