diff --git a/IndicatorBotProcessMainLoop.js b/IndicatorBotProcessMainLoop.js index ef88f2f6e..13ae6c05a 100644 --- a/IndicatorBotProcessMainLoop.js +++ b/IndicatorBotProcessMainLoop.js @@ -308,7 +308,7 @@ statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(bot, logger, STATUS_REPORT, UTILITIES); - statusDependencies.initialize(processConfig.statusDependencies, pMonth, pYear, onInizialized); + statusDependencies.initialize(pMonth, pYear, onInizialized); function onInizialized(err) { diff --git a/MultiPeriod.js b/MultiPeriod.js index df6dc1195..4c932ba8c 100644 --- a/MultiPeriod.js +++ b/MultiPeriod.js @@ -125,7 +125,7 @@ Here we get the status report from the bot who knows which is the end of the market. */ - let botWhoKnowsTheEndOfTheMarket = statusDependencies.config[processConfig.framework.endDate.takeItFromStatusDependency]; + let botWhoKnowsTheEndOfTheMarket = statusDependencies.nodeArray[processConfig.framework.endDate.takeItFromStatusDependency]; reportKey = botWhoKnowsTheEndOfTheMarket.devTeam + "-" + botWhoKnowsTheEndOfTheMarket.bot + "-" + botWhoKnowsTheEndOfTheMarket.process + "-" + "dataSet.V1"; if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> reportKey = " + reportKey); } diff --git a/MultiPeriodDaily.js b/MultiPeriodDaily.js index 3c2bf0b47..b05a787ee 100644 --- a/MultiPeriodDaily.js +++ b/MultiPeriodDaily.js @@ -128,7 +128,7 @@ We look first for the bot who knows the begining of the marke in order to get when the market starts. */ - let botWhoKnowsTheBeginingOfTheMarket = statusDependencies.config[processConfig.framework.startDate.takeItFromStatusDependency]; + let botWhoKnowsTheBeginingOfTheMarket = statusDependencies.nodeArray[processConfig.framework.startDate.takeItFromStatusDependency]; reportKey = botWhoKnowsTheBeginingOfTheMarket.devTeam + "-" + botWhoKnowsTheBeginingOfTheMarket.bot + "-" + botWhoKnowsTheBeginingOfTheMarket.process + "-" + "dataSet.V1"; if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> reportKey = " + reportKey); } @@ -178,7 +178,7 @@ Here we get the status report from the bot who knows which is the end of the market. */ - let botWhoKnowsTheEndOfTheMarket = statusDependencies.config[processConfig.framework.endDate.takeItFromStatusDependency]; + let botWhoKnowsTheEndOfTheMarket = statusDependencies.nodeArray[processConfig.framework.endDate.takeItFromStatusDependency]; reportKey = botWhoKnowsTheEndOfTheMarket.devTeam + "-" + botWhoKnowsTheEndOfTheMarket.bot + "-" + botWhoKnowsTheEndOfTheMarket.process + "-" + "dataSet.V1"; if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> reportKey = " + reportKey); } diff --git a/SensorBotProcessMainLoop.js b/SensorBotProcessMainLoop.js index cd73954fd..58573ed3a 100644 --- a/SensorBotProcessMainLoop.js +++ b/SensorBotProcessMainLoop.js @@ -308,7 +308,7 @@ statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(bot, logger, STATUS_REPORT, UTILITIES); - statusDependencies.initialize(processConfig.statusDependencies, pMonth, pYear, onInizialized); + statusDependencies.initialize(pMonth, pYear, onInizialized); function onInizialized(err) { diff --git a/StatusDependencies.js b/StatusDependencies.js index a0eaa4374..1be68c6c0 100644 --- a/StatusDependencies.js +++ b/StatusDependencies.js @@ -2,11 +2,12 @@ const FULL_LOG = true; const LOG_FILE_CONTENT = false; - const MODULE_NAME = "Status Dependencies"; + let bot = BOT + let thisObject = { - config: undefined, + nodeArray: undefined, statusReports: new Map(), initialize: initialize, keys: [] @@ -14,28 +15,38 @@ return thisObject; - function initialize(pStatusDependenciesConfig, pMonth, pYear, callBackFunction) { + function initialize(pMonth, pYear, callBackFunction) { try { if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); } - thisObject.config = pStatusDependenciesConfig; + /* Basic Valdidations */ + if (bot.processNode.referenceParent.processDependencies !== undefined) { + if (bot.processNode.referenceParent.processDependencies.statusDependencies !== undefined) { + thisObject.nodeArray = bot.processNode.referenceParent.processDependencies.statusDependencies + } else { + logger.write(MODULE_NAME, "[ERROR] initialize -> onInitilized -> It is not possible to not have status dependencies at all."); + callBackFunction(global.DEFAULT_OK_RESPONSE) + return + } + } else { + logger.write(MODULE_NAME, "[ERROR] initialize -> onInitilized -> It is not possible to not have process dependencies, which means not status dependencies."); + callBackFunction(global.DEFAULT_OK_RESPONSE) + return + } - /* + /*For each dependency we will initialize the status report, and load it as part of this initialization process.*/ - For each dependency declared at the bot config, we will initialize the status report, and load it as part of this initialization process. - - */ let alreadyCalledBack = false; let loadCount = 0; - for (let i = 0; i < pStatusDependenciesConfig.length; i++) { + for (let i = 0; i < thisObject.nodeArray.length; i++) { let statusReportModule = STATUS_REPORT.newStatusReport(BOT, logger, UTILITIES); logger.write(MODULE_NAME, "[INFO] initialize -> onInitilized -> Initializing Status Report # " + (i + 1)); - statusReportModule.initialize(pStatusDependenciesConfig[i], pMonth, pYear, onInitilized); + statusReportModule.initialize(thisObject.nodeArray[i], pMonth, pYear, onInitilized); function onInitilized(err) { @@ -66,8 +77,7 @@ switch (err.message) { case global.DEFAULT_OK_RESPONSE.message: { - if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> onLoad -> Execution finished well. -> bot = " + pStatusDependenciesConfig[i].bot); } - if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> onLoad -> Execution finished well. -> process = " + pStatusDependenciesConfig[i].process); } + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> onLoad -> Execution finished well. -> Status Dependency = " + JSON.stringify(thisObject.nodeArray[i])) } addReport(); return; @@ -75,8 +85,8 @@ case "Status Report was never created.": { logger.write(MODULE_NAME, "[WARN] initialize -> onLoad -> err = " + err.stack); - logger.write(MODULE_NAME, "[WARN] initialize -> onLoad -> Report Not Found. -> bot = " + pStatusDependenciesConfig[i].bot); - logger.write(MODULE_NAME, "[WARN] initialize -> onLoad -> Report Not Found. -> process = " + pStatusDependenciesConfig[i].process); + logger.write(MODULE_NAME, "[WARN] initialize -> onLoad -> Report Not Found. -> Status Dependency = " + JSON.stringify(thisObject.nodeArray[i])) + addReport(); return; } @@ -84,8 +94,8 @@ case "Status Report is corrupt.": { logger.write(MODULE_NAME, "[WARN] initialize -> onLoad -> err = " + err.stack); - logger.write(MODULE_NAME, "[WARN] initialize -> onLoad -> Report Not Found. -> bot = " + pStatusDependenciesConfig[i].bot); - logger.write(MODULE_NAME, "[WARN] initialize -> onLoad -> Report Not Found. -> process = " + pStatusDependenciesConfig[i].process); + logger.write(MODULE_NAME, "[WARN] initialize -> onLoad -> Report Not Found. -> Status Dependency = " + JSON.stringify(thisObject.nodeArray[i])) + addReport(); return; } @@ -117,10 +127,10 @@ let key; - if (pStatusDependenciesConfig[i].dataSetSection === "Month") { - key = pStatusDependenciesConfig[i].devTeam + "-" + pStatusDependenciesConfig[i].bot + "-" + pStatusDependenciesConfig[i].process + "-" + pStatusDependenciesConfig[i].dataSetVersion + "-" + pYear + "-" + pMonth; + if (thisObject.nodeArray[i].processRunMonthly === true) { + key = thisObject.nodeArray[i].devTeam + "-" + thisObject.nodeArray[i].bot + "-" + thisObject.nodeArray[i].process + "-" + thisObject.nodeArray[i].dataSetVersion + "-" + pYear + "-" + pMonth; } else { - key = pStatusDependenciesConfig[i].devTeam + "-" + pStatusDependenciesConfig[i].bot + "-" + pStatusDependenciesConfig[i].process + "-" + pStatusDependenciesConfig[i].dataSetVersion; + key = thisObject.nodeArray[i].devTeam + "-" + thisObject.nodeArray[i].bot + "-" + thisObject.nodeArray[i].process + "-" + thisObject.nodeArray[i].dataSetVersion; } thisObject.keys.push(key); @@ -128,7 +138,7 @@ if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> addReport -> Report added to Map. -> key = " + key); } - if (loadCount === pStatusDependenciesConfig.length) { + if (loadCount === thisObject.nodeArray.length) { if (alreadyCalledBack === false) { alreadyCalledBack = true callBackFunction(global.DEFAULT_OK_RESPONSE); diff --git a/StatusReport.js b/StatusReport.js index 089c778cc..79c78a1cb 100644 --- a/StatusReport.js +++ b/StatusReport.js @@ -44,18 +44,85 @@ try { if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); } - logger.fileName = MODULE_NAME + "." + pOwner.bot + "." + pOwner.process; - owner = pOwner; month = pMonth; year = pYear; - if (bot.SESSION !== undefined && pOwner.type === "Trading Bot Instance") { + /* Some very basic validations that we have all the information needed. */ + if (owner.referenceParent === undefined) { + logger.write(MODULE_NAME, "[ERROR] initialize -> Status Dependency without Reference Parent. Status Dependency = " + JSON.stringify(owner)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + + if (owner.referenceParent.parentNode === undefined) { + logger.write(MODULE_NAME, "[ERROR] initialize -> Status Report not attached to a Process Definition. Status Report = " + JSON.stringify(owner.referenceParent)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + + if (owner.referenceParent.parentNode.code.codeName === undefined) { + logger.write(MODULE_NAME, "[ERROR] initialize -> Process Definition witn no codeName defined. Process Definition = " + JSON.stringify(owner.referenceParent.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + + if (owner.referenceParent.parentNode.parentNode === undefined) { + logger.write(MODULE_NAME, "[ERROR] initialize -> Process Definition not attached to a Bot. Process Definition = " + JSON.stringify(owner.referenceParent.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + + if (owner.referenceParent.parentNode.parentNode.code.codeName === undefined) { + logger.write(MODULE_NAME, "[ERROR] initialize -> Bot witn no codeName defined. Bot = " + JSON.stringify(owner.referenceParent.parentNode.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + + if (owner.referenceParent.parentNode.parentNode.parentNode === undefined) { + logger.write(MODULE_NAME, "[ERROR] initialize -> Bot not attached to a Team. Bot = " + JSON.stringify(owner.referenceParent.parentNode.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + + if (owner.referenceParent.parentNode.parentNode.parentNode.code.codeName === undefined) { + logger.write(MODULE_NAME, "[ERROR] initialize -> Team witn no codeName defined. Team = " + JSON.stringify(owner.referenceParent.parentNode.parentNode.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + + /* Simplifying the access to basic info */ + owner.bot = owner.referenceParent.parentNode.parentNode.code.codeName + owner.process = owner.referenceParent.parentNode.code.codeName + owner.type = owner.referenceParent.parentNode.parentNode.type + owner.devTeam = owner.referenceParent.parentNode.parentNode.parentNode.code.codeName + + /* Let's see if the process is run monthly or not. */ + if (owner.referenceParent.parentNode.code.startMode !== undefined) { + if (owner.referenceParent.parentNode.code.startMode.allMonths !== undefined) { + if (owner.referenceParent.parentNode.code.startMode.oneMonth !== undefined) { + if (owner.referenceParent.parentNode.code.startMode.allMonths.run === "true" || owner.referenceParent.parentNode.code.startMode.oneMonth.run === "true") { + owner.processRunMonthly = true + } + } + } + } + + /* This stuff is still hardcoded and unresolved. */ + owner.botVersion = { + "major": 1, + "minor": 0 + } + owner.dataSetVersion = "dataSet.V1" + + logger.fileName = MODULE_NAME + "." + owner.bot + "." + owner.process; + + if (bot.SESSION !== undefined && owner.type === "Trading Bot Instance") { sessionPath = bot.SESSION.folderName + "/" } - if (owner.dataSetSection === "Month") { - logger.fileName = MODULE_NAME + "." + pOwner.bot + "." + pOwner.process + "." + year + "." + month; + if (owner.processRunMonthly === true) { + logger.fileName = MODULE_NAME + "." + owner.bot + "." + owner.process + "." + year + "." + month; timePath = "/" + year + "/" + month; } diff --git a/TradingBotProcessMainLoop.js b/TradingBotProcessMainLoop.js index 147e67c86..fd008890e 100644 --- a/TradingBotProcessMainLoop.js +++ b/TradingBotProcessMainLoop.js @@ -192,7 +192,7 @@ statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(bot, logger, STATUS_REPORT, UTILITIES); - statusDependencies.initialize(processConfig.statusDependencies, undefined, undefined, onInizialized); + statusDependencies.initialize(undefined, undefined, onInizialized); function onInizialized(err) { diff --git a/server.js b/server.js index 707ffd2ed..c63d95e5d 100644 --- a/server.js +++ b/server.js @@ -73,7 +73,8 @@ if (global.TASK_NODE !== undefined) { } else { // I use this section to debug in standalone mode. let argument - argument = '{"type":"Task","name":"Generates Bollinger Channels & Sub-Channels","bot":{"type":"Indicator Bot Instance","name":"Paula","code":{"team":"AAMasters","bot":"AAPaula","repo":"AAChris-Indicator-Bot"},"processes":[{"type":"Process Instance","subType":"Indicator Process Instance","name":"Daily","code":{"process":"Multi-Period-Daily"},"id":"81f0108b-8af9-4b22-94dd-81ef4a5c8065","referenceParent":{"type":"Process Definition","name":"Multi-Period-Daily","code":{"name":"Multi-Period-Daily","description":"Produces for each market two files with bollinger channels respectively at each day of the market history.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000,"framework":{"name":"Multi-Period-Daily","startDate":{"takeItFromStatusDependency":0},"endDate":{"takeItFromStatusDependency":1}}},"processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"New Output Dataset","id":"64430a93-38c2-4c71-8085-71661bbf804e","referenceParent":{"type":"Dataset Definition","name":"Daily","code":{"codeName":"Multi-Period-Daily","type":"Daily Files","validPeriods":["45-min","40-min","30-min","20-min","15-min","10-min","05-min","04-min","03-min","02-min","01-min"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Channels/Multi-Period-Daily/@Period/@Year/@Month/@Day","fileName":"@AssetA_@AssetB.json","dataRange":{"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Channels/Multi-Period-Daily","fileName":"Data.Range.@AssetA_@AssetB.json"}},"id":"64910fea-c92a-4a55-850a-aa62d98b478e"}},{"type":"Output Dataset","name":"New Output Dataset","id":"b536a078-e32a-4489-93f6-75107a90b527","referenceParent":{"type":"Dataset Definition","name":"Daily","code":{"codeName":"Multi-Period-Daily","type":"Daily Files","validPeriods":["45-min","40-min","30-min","20-min","15-min","10-min","05-min","04-min","03-min","02-min","01-min"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Standard-Sub-Channels/Multi-Period-Daily/@Period/@Year/@Month/@Day","fileName":"@AssetA_@AssetB.json","dataRange":{"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Standard-Sub-Channels/Multi-Period-Daily","fileName":"Data.Range.@AssetA_@AssetB.json"}},"id":"ca71e765-0f66-4b18-b500-847b9d16169b"}},{"type":"Output Dataset","name":"New Output Dataset","id":"d5bcc7c4-2798-4c34-9504-cc4617b64a04","referenceParent":{"type":"Dataset Definition","name":"Daily","code":{"codeName":"Multi-Period-Daily","type":"Daily Files","validPeriods":["45-min","40-min","30-min","20-min","15-min","10-min","05-min","04-min","03-min","02-min","01-min"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Sub-Channels/Multi-Period-Daily/@Period/@Year/@Month/@Day","fileName":"@AssetA_@AssetB.json","dataRange":{"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Sub-Channels/Multi-Period-Daily","fileName":"Data.Range.@AssetA_@AssetB.json"}},"id":"029479ae-275d-4854-ad3e-66948656a053"}},{"type":"Output Dataset","name":"New Output Dataset","id":"57898dc1-83a2-4ee9-8a0b-6674f988f0fa","referenceParent":{"type":"Dataset Definition","name":"Daily","code":{"codeName":"Multi-Period-Daily","type":"Daily Files","validPeriods":["45-min","40-min","30-min","20-min","15-min","10-min","05-min","04-min","03-min","02-min","01-min"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Standard-Channels/Multi-Period-Daily/@Period/@Year/@Month/@Day","fileName":"@AssetA_@AssetB.json","dataRange":{"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Standard-Channels/Multi-Period-Daily","fileName":"Data.Range.@AssetA_@AssetB.json"}},"id":"96b4e65b-e6db-44a0-80a5-ceb9d68a09ec"}}],"id":"b8fc5ac0-021d-4230-aa59-9876c5f0f3e1"},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"New Status Dependency","id":"3cb29ee1-02de-452a-a79f-2451700fe335","referenceParent":{"type":"Status Report","name":"New Status Report","id":"7323fef7-870a-48b6-b96f-586111253b40"}},{"type":"Status Dependency","name":"New Status Dependency","id":"d5f34469-0ae1-45e6-acd9-4155d5940c77","referenceParent":{"type":"Status Report","name":"New Status Report","id":"c542a73e-a350-431f-ad3e-10f3ebef8ec7"}},{"type":"Status Dependency","name":"New Status Dependency","id":"7f6266a5-bddb-4d49-962d-100b1993043d","referenceParent":{"type":"Status Report","name":"New Status Report","id":"b1dd07bf-a698-4bbb-995a-356c929a1e94"}}],"dataDependencies":[{"type":"Data Dependency","name":"New Data Dependency","id":"073e24ab-6b47-482a-b117-0d3554f63c1f","referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","code":{},"id":"506104fa-e99a-4a46-930e-176bce311aff"}}],"id":"c0cb34fe-9268-4ebb-a8ce-7d53a13a6d4d"},"statusReport":{"type":"Status Report","name":"New Status Report","id":"b1dd07bf-a698-4bbb-995a-356c929a1e94"},"executionStartedEvent":{"type":"Execution Started Event","name":"New Execution Started Event","id":"4548cff9-f388-4f4f-b148-665d22ffaf9e","referenceParent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"acebc3ed-4f3f-4a4b-b403-f16cbe987dde","parentNode":{"type":"Process Definition","name":"Multi-Period-Daily","id":"e598ee86-1e18-4aa1-95c2-64aaf66776ca","code":{}}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"34e17fad-2c62-4c45-875c-774ac6b6cc99","parentNode":{"type":"Process Definition","name":"Multi-Period-Daily","id":"bc15b49d-4547-4bac-a28b-193eb0158fe3","code":{"name":"Multi-Period-Daily","description":"Produces for each market two files with bollinger channels respectively at each day of the market history.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000,"framework":{"name":"Multi-Period-Daily","startDate":{"takeItFromStatusDependency":0},"endDate":{"takeItFromStatusDependency":1}}}}},"calculations":{"type":"Calculations Procedure","name":"New Calculations Procedure","id":"0aaecc18-50b6-4634-9d3e-aafea3fa087f"},"dataBuilding":{"type":"Data Building Procedure","name":"New Data Building Procedure","id":"a85d779e-1302-4c04-9c35-10049ffdcb28"},"id":"bc15b49d-4547-4bac-a28b-193eb0158fe3"}},{"type":"Process Instance","subType":"Indicator Process Instance","name":"Market","code":{"process":"Multi-Period-Market"},"id":"6ddd81e2-d6db-4814-9c6c-96538a74824c","referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","code":{"description":"Creates Market Files of Bollinger Channels and SubChannels","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000,"framework":{"name":"Multi-Period-Market","startDate":{},"endDate":{}}},"processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"Bollinger Channels","id":"d804e799-7c12-42f5-8de2-52a3a7d5daa4","referenceParent":{"type":"Dataset Definition","name":"Market","code":{"codeName":"Multi-Period-Market","type":"Market Files","validPeriods":["24-hs","12-hs","08-hs","06-hs","04-hs","03-hs","02-hs","01-hs"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Channels/Multi-Period-Market/@Period","fileName":"@AssetA_@AssetB.json"},"id":"610cd062-ab88-4892-b711-0fb430305c61"}},{"type":"Output Dataset","name":"Bollinger Standard Channels","id":"e524685d-8da0-41f6-839d-9a4100e6e3fe","referenceParent":{"type":"Dataset Definition","name":"Market","code":{"codeName":"Multi-Period-Market","type":"Market Files","validPeriods":["24-hs","12-hs","08-hs","06-hs","04-hs","03-hs","02-hs","01-hs"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Standard-Channels/Multi-Period-Market/@Period","fileName":"@AssetA_@AssetB.json"},"id":"22c1f2c6-3838-4657-add8-2e01d7056917"}},{"type":"Output Dataset","name":"Bollinger Sub-Channels","id":"eb0e7947-95e4-4f4a-87ea-1fb430b8b503","referenceParent":{"type":"Dataset Definition","name":"Market","code":{"codeName":"Multi-Period-Market","type":"Market Files","validPeriods":["24-hs","12-hs","08-hs","06-hs","04-hs","03-hs","02-hs","01-hs"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Sub-Channels/Multi-Period-Market/@Period","fileName":"@AssetA_@AssetB.json"},"id":"869f615e-0cc0-44fd-8648-4a951c23a410"}},{"type":"Output Dataset","name":"Bollinger Standard Sub-Channels","id":"dc96b9ac-f8d5-4bf8-a135-45cd5d6369f1","referenceParent":{"type":"Dataset Definition","name":"Market","code":{"codeName":"Multi-Period-Market","type":"Market Files","validPeriods":["24-hs","12-hs","08-hs","06-hs","04-hs","03-hs","02-hs","01-hs"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Standard-Sub-Channels/Multi-Period-Market/@Period","fileName":"@AssetA_@AssetB.json"},"id":"f8d44a4d-3771-4a71-97ca-dc604ff565d3"}}],"id":"dd39a54a-3714-446a-9a41-dfd83557664c"},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Self","id":"ae627a69-4089-432d-b379-1b12ce4bd75e","referenceParent":{"type":"Status Report","name":"New Status Report","id":"af8aded9-002a-475a-88f5-d29573740969"}},{"type":"Status Dependency","name":"Chris","id":"4a603114-d464-46db-90a1-62304274117a","referenceParent":{"type":"Status Report","name":"New Status Report","id":"4f8197fa-2627-46df-bd36-7d30fdb12d8c"}}],"dataDependencies":[{"type":"Data Dependency","name":"Chris Bollinger Bands","id":"ea27be54-93a3-48e3-8c52-72bc397b6c66","referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","code":{},"id":"f5b2a7d8-fc32-44a3-a002-9b0fc30a9719"}}],"id":"8b509294-6028-40e2-88a8-655a34245ed8"},"statusReport":{"type":"Status Report","name":"New Status Report","id":"af8aded9-002a-475a-88f5-d29573740969"},"executionStartedEvent":{"type":"Execution Started Event","name":"New Execution Started Event","id":"f4720e04-5def-4c0b-be42-33e50ac6a6b7","referenceParent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"4a9c8cc7-0ebf-43eb-b7f9-0b280630ff67","parentNode":{"type":"Process Definition","name":"Multi-Period-Market","id":"941a0543-0cc0-4a5d-a782-728d2835c100","code":{}}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"671530dc-5ba5-4c8d-bc23-f228e22c56b3","parentNode":{"type":"Process Definition","name":"Multi-Period-Market","id":"28be432d-80ca-46b3-859a-55541e24b2b4","code":{"description":"Creates Market Files of Bollinger Channels and SubChannels","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000,"framework":{"name":"Multi-Period-Market","startDate":{},"endDate":{}}}}},"calculations":{"type":"Calculations Procedure","name":"New Calculations Procedure","id":"ba2de283-a059-44d0-b229-1c7988f48f51"},"dataBuilding":{"type":"Data Building Procedure","name":"New Data Building Procedure","initialization":{"type":"Procedure Initialization","name":"New Procedure Initialization","code":{"type":"Code","code":"// Write your code here","id":"26413b25-24b7-47d1-b73d-12cef3198657"},"id":"13b23649-2695-48cb-aa9a-efe8acb7ab2c"},"loop":{"type":"Procedure Loop","name":"New Procedure Loop","code":{"type":"Code","code":"// Write your code here","id":"f0a3227a-094b-4aae-babb-d78f9e9b38ed"},"id":"b7a118de-5ebe-4efb-9b10-3b69680063a3"},"id":"859a0c08-b0fd-4d42-851a-21e898d42ec8"},"id":"28be432d-80ca-46b3-859a-55541e24b2b4"}}],"id":"27564838-24b1-4814-af8c-ec65accb05d1"},"id":"aa0f2533-460c-464f-ad77-6ae4cadd1178"}' + argument = ' {"type":"Task","name":"Brings Trades Records from the Exchange","bot":{"type":"Sensor Bot Instance","name":"Charly","code":{"team":"AAMasters","bot":"AACharly","repo":"AACharly-Sensor-Bot"},"processes":[{"type":"Process Instance","subType":"Sensor Process Instance","name":"Live Trades","code":{"process":"Live-Trades"},"id":"338266fa-14c2-42eb-b0e5-d0a8ed9309fc","referenceParent":{"type":"Process Definition","name":"Live-Trades","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"371a2507-655b-46c5-b959-52f527cc4d7e","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"id":"9ffdaadd-5204-4436-b89e-cabd8f0e5829"},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"New Status Dependency","id":"cfd2acec-5b56-40fb-b97b-10cdb91faa92","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Live-Trades","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"371a2507-655b-46c5-b959-52f527cc4d7e","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"9f3ea81f-2aa1-41ec-907f-c003dec0c827"}}],"dataDependencies":[],"id":"a98b94ad-0cd4-4e54-ade4-68b0ab577414"},"statusReport":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Live-Trades","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"371a2507-655b-46c5-b959-52f527cc4d7e","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"9f3ea81f-2aa1-41ec-907f-c003dec0c827"},"executionStartedEvent":{"type":"Execution Started Event","name":"New Execution Started Event","id":"942c8337-5d22-413d-9e44-e2da9a5479f1"},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"d5f1f2b3-ffa5-442b-b875-e91a786337ae","parentNode":{"type":"Process Definition","name":"Live-Trades","id":"371a2507-655b-46c5-b959-52f527cc4d7e","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000}}},"calculations":{"type":"Calculations Procedure","name":"New Calculations Procedure","id":"e3774584-43e5-4dc5-b097-7b16476d586a"},"dataBuilding":{"type":"Data Building Procedure","name":"New Data Building Procedure","id":"0f8cc852-ad72-40fe-bf4a-866e68439492"}}},{"type":"Process Instance","subType":"Sensor Process Instance","name":"Hole Fixing","code":{"process":"Hole-Fixing"},"id":"3d7e0bdd-64e3-4442-8742-cc9282a82631","referenceParent":{"type":"Process Definition","name":"Hole-Fixing","code":{"codeName":"Hole-Fixing","description":"Scans the trades saved by the Live Trades and Historic Trades processes searching for missing records. Once a hole is found on the data set, it patches it by retrieving the missing records from the exchange.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2019","month":"10"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"60c8e8b0-0c0d-49bd-980e-6c7814a4cb18","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"id":"d8e3878e-6f12-4ef9-873b-e3f8a8f5a63e"},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"New Status Dependency","id":"2746eb59-ea5f-4f2d-b838-b13adeb4c2e6","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Historic-Trades","code":{"codeName":"Historic-Trades","description":"Retrieves and saves the historical trades in batches going backwards from the current time until reaching the begining of the market.","startMode":{"allMonths":{"run":"false","minYear":"2014","maxYear":"2020"},"oneMonth":{"run":"false","year":"2018","month":"01"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"e2c3f7c3-b74c-4145-8a60-f73cc3364629","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"c542a73e-a350-431f-ad3e-10f3ebef8ec7"}},{"type":"Status Dependency","name":"New Status Dependency","id":"3d84de0f-5939-4992-9395-dc1a1ee93232","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Live-Trades","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"371a2507-655b-46c5-b959-52f527cc4d7e","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"9f3ea81f-2aa1-41ec-907f-c003dec0c827"}},{"type":"Status Dependency","name":"New Status Dependency","id":"612519b7-cc59-4363-9452-903ab2f4a958","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Hole-Fixing","code":{"codeName":"Hole-Fixing","description":"Scans the trades saved by the Live Trades and Historic Trades processes searching for missing records. Once a hole is found on the data set, it patches it by retrieving the missing records from the exchange.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2019","month":"10"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"60c8e8b0-0c0d-49bd-980e-6c7814a4cb18","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"93f391ac-4651-47c6-b2ff-e9387fe0a444"}}],"dataDependencies":[],"id":"aa390ea7-0f89-47cc-a75f-fa4fb738219a"},"statusReport":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Hole-Fixing","code":{"codeName":"Hole-Fixing","description":"Scans the trades saved by the Live Trades and Historic Trades processes searching for missing records. Once a hole is found on the data set, it patches it by retrieving the missing records from the exchange.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2019","month":"10"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"60c8e8b0-0c0d-49bd-980e-6c7814a4cb18","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"93f391ac-4651-47c6-b2ff-e9387fe0a444"},"executionStartedEvent":{"type":"Execution Started Event","name":"New Execution Started Event","id":"542f80b6-e848-4ab5-aa46-06674837ca3a","referenceParent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"d5f1f2b3-ffa5-442b-b875-e91a786337ae","parentNode":{"type":"Process Definition","name":"Live-Trades","id":"371a2507-655b-46c5-b959-52f527cc4d7e","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000}}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"ab5e01b1-8036-4761-8a93-d61a663b0088","parentNode":{"type":"Process Definition","name":"Hole-Fixing","id":"60c8e8b0-0c0d-49bd-980e-6c7814a4cb18","code":{"codeName":"Hole-Fixing","description":"Scans the trades saved by the Live Trades and Historic Trades processes searching for missing records. Once a hole is found on the data set, it patches it by retrieving the missing records from the exchange.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2019","month":"10"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000}}},"calculations":{"type":"Calculations Procedure","name":"New Calculations Procedure","id":"ca19a529-5b73-4ef0-83e2-91aaa73ca4dd"},"dataBuilding":{"type":"Data Building Procedure","name":"New Data Building Procedure","id":"5c586e2e-3f91-49d9-b0d3-fa1a84eedec2"}}}],"id":"85c4f582-56ee-4b8e-95b2-aa61baedfa39"},"id":"2fcbea08-a941-4891-80fd-236eacd83c11"}' + try { global.TASK_NODE = JSON.parse(argument) } catch (err) {