diff --git a/IndicatorBotCommons.js b/IndicatorBotCommons.js index ab9e5af03..d1ae58093 100644 --- a/IndicatorBotCommons.js +++ b/IndicatorBotCommons.js @@ -32,7 +32,9 @@ let record = {} for (let j = 0; j < recordDefinition.properties.length; j++) { let property = recordDefinition.properties[j] - record[property.code.codeName] = dataFile[i][j] + if (property.code.isCalculated !== true) { + record[property.code.codeName] = dataFile[i][j] + } } jsonifiedArray.push(record); @@ -41,52 +43,60 @@ return jsonifiedArray } - function calculationsProcedure(dependencyArray, variableName, timePeriod) { + function calculationsProcedure(jsonArray, recordDefinition, calculationsProcedure, variableName, timePeriod) { /* This function has as an input an array of JSON objects, and it adds calculated properties to complete the set of properties that will be available for Formulas. */ - let dependecyArray = [] + let system = { // These are the available system variables to be used in User Code and Formulas + timePeriod: timePeriod, + ONE_DAY_IN_MILISECONDS: ONE_DAY_IN_MILISECONDS + } + let variable = {} // This is the structure where the user will define its own variables that will be shared amond different code blocks and formulas. + let resultingArray = [] /* This is Initialization Code */ - let lastMovingAverage = 0; - const SIDE_TOLERANCE = 0.5 * timePeriod / ONE_DAY_IN_MILISECONDS; - const SMALL_SLOPE = 1.0 * timePeriod / ONE_DAY_IN_MILISECONDS; - const MEDIUM_SLOPE = 2.0 * timePeriod / ONE_DAY_IN_MILISECONDS; - const HIGH_SLOPE = 4.0 * timePeriod / ONE_DAY_IN_MILISECONDS; - /* This is Initialization Code */ - - for (let i = 0; i < dataFile.length; i++) { - - let indicator = {} - indicator[variableName] = dataFile[i] - - /* This is Add Properties Code */ - if (lastMovingAverage > indicator.bollingerBand.movingAverage) { indicator.bollingerBand.direction = 'Down'; } - if (lastMovingAverage < indicator.bollingerBand.movingAverage) { indicator.bollingerBand.direction = 'Up'; } - if (lastMovingAverage === indicator.bollingerBand.movingAverage) { indicator.bollingerBand.direction = 'Side'; } - - let delta = Math.abs(indicator.bollingerBand.movingAverage - lastMovingAverage); - - indicator.bollingerBand.slope = 'Extreme'; - if (delta < indicator.bollingerBand.movingAverage * HIGH_SLOPE / 100) { indicator.bollingerBand.slope = 'Steep'; } - if (delta < indicator.bollingerBand.movingAverage * MEDIUM_SLOPE / 100) { indicator.bollingerBand.slope = 'Medium'; } - if (delta < indicator.bollingerBand.movingAverage * SMALL_SLOPE / 100) { indicator.bollingerBand.slope = 'Gentle'; } - if (delta < indicator.bollingerBand.movingAverage * SIDE_TOLERANCE / 100) { indicator.bollingerBand.slope = 'Side'; } - - lastMovingAverage = indicator.bollingerBand.movingAverage; - /* This is Add Properties Code */ - - dependecyArray.push(indicator.bollingerBand); + if (calculationsProcedure.initialization !== undefined) { + if (calculationsProcedure.initialization.code !== undefined) { + eval(calculationsProcedure.initialization.code.code) + } } - return dependecyArray + /* This is Initialization Code */ + if (calculationsProcedure.loop !== undefined) { + if (calculationsProcedure.loop.code !== undefined) { + for (let i = 0; i < jsonArray.length; i++) { + + let indicator = {} + indicator[variableName] = jsonArray[i] + + /* This is Loop Code */ + eval(calculationsProcedure.loop.code.code) + + /* For each calculated property we apply its formula*/ + for (let j = 0; j < recordDefinition.properties.length; j++) { + let property = recordDefinition.properties[j] + if (property.code.isCalculated === true) { + if (property.formula !== undefined) { + if (property.formula.code !== undefined) { + let newValue = eval(property.formula.code) + let currentRecord = indicator[variableName] + currentRecord[property.code.codeName] = newValue + } + } + } + } + + /* Adding the new element to the resulting array */ + resultingArray.push(indicator.bollingerBand); + } + } + } + return resultingArray } - - function addCalculatedProperties(dependencyArray, variableName, timePeriod) { let dependecyArray = [] diff --git a/IndicatorBotMarket.js b/IndicatorBotMarket.js index 97e70f03e..57fe4073e 100644 --- a/IndicatorBotMarket.js +++ b/IndicatorBotMarket.js @@ -51,19 +51,54 @@ let dataDependencies = bot.processNode.referenceParent.processDependencies.dataDependencies for (let i = 0; i < dataDependencies.length; i++) { + let dataset = dataDependencies[i].referenceParent + let dataFile = dataFiles[i] + let jsonData // Datafile converted into Json objects + let inputData // Includes calculated properties + let variableName // name of the variable for this product + let recordDefinition + /* For each dataset in our data dependencies, we should have da dataFile containing the records needed as an imput for this process. What we need to do first is transform those records into JSON objects that can be used by user-defined formulas. + The first step does that but with the not calculated properties, the second step adds the calculated properties. */ + + /* Basic validations to see if we have everything we need. */ + if (dataset.parentNode.code.variableName === undefined) { + logger.write(MODULE_NAME, "[ERROR] start -> Product Definition without a Variable Name defined. Product Definition = " + JSON.stringify(dataset.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } if (dataset.parentNode.record === undefined) { logger.write(MODULE_NAME, "[ERROR] start -> Product Definition without a Record Definition. Product Definition = " + JSON.stringify(dataset.parentNode)); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return } - dataset.inputData = commons.jsonifyDataFile(dataFiles[i], dataset.parentNode.record) + if (dataset.parentNode.calculations === undefined) { + logger.write(MODULE_NAME, "[ERROR] start -> Product Definition without a Calculations Procedure. Product Definition = " + JSON.stringify(dataset.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + if (dataset.parentNode.dataBuilding === undefined) { + logger.write(MODULE_NAME, "[ERROR] start -> Product Definition without a Data Building Procedure. Product Definition = " + JSON.stringify(dataset.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + + recordDefinition = dataset.parentNode.record + variableName = dataset.parentNode.code.variableName + /* Transform the raw data into JSON objects */ + jsonData = commons.jsonifyDataFile(dataFile, recordDefinition) + /* Add the calculated properties */ + if (dataset.parentNode.calculations !== undefined) { + inputData = commons.calculationsProcedure(jsonData, recordDefinition, dataset.parentNode.calculations, variableName, timePeriod) + } } + /* During the next phase, we need to generate the data of the different products this process produces an output */ + diff --git a/server.js b/server.js index a7ca3d339..7713e3b90 100644 --- a/server.js +++ b/server.js @@ -72,15 +72,7 @@ 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":"AAPaula-Indicator-Bot"},"processes":[{"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":{"codeName":"Multi-Period-Market","description":"Produces for each market two files with bollinger channels respectively.","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-Market","startDate":{},"endDate":{}}},"id":"28be432d-80ca-46b3-859a-55541e24b2b4","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"},"parentNode":{"type":"Product Definition","name":"Bollinger Channels","code":{"codeName":"Bollinger-Channels","displayName":"Bollinger-Channels","description":"Two sets of files per period that contains Bollinger-Bands-Channels-Patterns.","shareWith":"Public"},"datasets":[],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","code":{"codeName":"begin","isNumeric":true},"formula":{"type":"Formula","code":"// Write your formula here","id":"caf8122c-3a07-4263-a56f-ffb05df281d6"},"id":"06edb099-ff64-4528-b8c6-599154bc2ddf"},{"type":"Record Property","name":"End","code":{"codeName":"end","isNumeric":true},"formula":{"type":"Formula","code":"// Write your formula here","id":"c8ec0868-8413-468c-88d5-3e43169395e0"},"id":"94656d1f-508a-4e94-a8d2-013690aac596"},{"type":"Record Property","name":"Direction","code":{"codeName":"direction","isNumeric":false},"formula":{"type":"Formula","code":"// Write your formula here","id":"e913afe9-b610-4777-bc9e-6349d436a90a"},"id":"edc0f697-f5e2-446f-bae8-8db7adf91d23"},{"type":"Record Property","name":"Period","code":{"codeName":"period","isNumeric":true},"formula":{"type":"Formula","code":"// Write your formula here","id":"83fce657-a0bb-41ee-80d1-9e2ab980c472"},"id":"eb733f85-6cf5-485e-9bd3-2bf78733c492"},{"type":"Record Property","name":"First Moving Average","code":{"codeName":"firstMovingAverage","isNumeric":true},"formula":{"type":"Formula","code":"// Write your formula here","id":"52490460-35e3-469a-824f-5b139571d4a0"},"id":"a67a15ee-6f7f-48bd-9d55-82c57efc993b"},{"type":"Record Property","name":"Last Moving Average","code":{"codeName":"lastMovingAverage","isNumeric":true},"formula":{"type":"Formula","code":"// Write your formula here","id":"41edc1ef-293a-4ceb-bf67-8042e8fdc4eb"},"id":"0f05bffe-d668-4d25-ab67-d55a4a7c8f5d"},{"type":"Record Property","name":"First Deviation","code":{"codeName":"firstDeviation","isNumeric":true},"formula":{"type":"Formula","code":"// Write your formula here","id":"5af02103-9bc9-4e6c-9684-5a612adfa495"},"id":"eae84509-b689-4a76-9277-eed72af491dd"},{"type":"Record Property","name":"Last Deviation","code":{"codeName":"lastDeviation","isNumeric":true},"formula":{"type":"Formula","code":"// Write your formula here","id":"bc82d292-e71a-4367-9b07-a0e3982ad60d"},"id":"d5c32d1f-9e3c-48e8-8025-a17d57c0812e"}],"id":"6c3e68b0-b781-4c53-9ff7-67c3f747ac8a"},"parentNode":{"type":"Indicator Bot","name":"Paula","code":{"codeName":"AAPaula"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"bd0f325d-6f98-468b-8b7b-99a42a175d80"},"id":"1f111f72-624f-4166-9f99-ab8d785d5267"},"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"},"parentNode":{"type":"Product Definition","name":"Bollinger Standard Channels","code":{"codeName":"Bollinger-Standard-Channels","displayName":"Bollinger-Standard-Channels","description":"","shareWith":"Public"},"datasets":[],"record":{"type":"Record Definition","name":"New Record Definition","properties":[],"id":"9106250d-b042-4e96-9121-c760b4c1eab2"},"parentNode":{"type":"Indicator Bot","name":"Paula","code":{"codeName":"AAPaula"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"bd0f325d-6f98-468b-8b7b-99a42a175d80"},"id":"94bc3958-cc85-43a1-a178-103e84f42910"},"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"},"parentNode":{"type":"Product Definition","name":"Bollinger Sub-Channels","code":{"codeName":"Bollinger-Sub-Channels","displayName":"Bollinger-Sub-Channels","description":"Bollinger Sub Channels with slope.","shareWith":"Public"},"datasets":[],"record":{"type":"Record Definition","name":"New Record Definition","properties":[],"id":"5a780d7f-70df-4e86-8192-eacccafb5ca8"},"parentNode":{"type":"Indicator Bot","name":"Paula","code":{"codeName":"AAPaula"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"bd0f325d-6f98-468b-8b7b-99a42a175d80"},"id":"080c87fc-4546-4482-ab11-180a33f6d9ab"},"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"},"parentNode":{"type":"Product Definition","name":"Bollinger Standard Sub-Channels","code":{"codeName":"Bollinger-Standard-Sub-Channels","displayName":"Bollinger-Standard-Sub-Channels","description":"Bollinger Standard Sub Channels with slope.","shareWith":"Public"},"datasets":[],"record":{"type":"Record Definition","name":"New Record Definition","properties":[],"id":"cdbe5e0f-9292-4d3d-b98a-d441e6565b76"},"parentNode":{"type":"Indicator Bot","name":"Paula","code":{"codeName":"AAPaula"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"bd0f325d-6f98-468b-8b7b-99a42a175d80"},"id":"79ce9c05-8a4c-4b58-850f-288037acc702"},"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 Reference","code":{"mainUtility":"Self Reference"},"id":"ae627a69-4089-432d-b379-1b12ce4bd75e","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Multi-Period-Market","code":{"codeName":"Multi-Period-Market","description":"Produces for each market two files with bollinger channels respectively.","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-Market","startDate":{},"endDate":{}}},"id":"28be432d-80ca-46b3-859a-55541e24b2b4","parentNode":{"type":"Indicator Bot","name":"Paula","code":{"codeName":"AAPaula"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"bd0f325d-6f98-468b-8b7b-99a42a175d80"}},"id":"af8aded9-002a-475a-88f5-d29573740969"}},{"type":"Status Dependency","name":"Market Ending Point","code":{"mainUtility":"Market Ending Point"},"id":"4a603114-d464-46db-90a1-62304274117a","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Multi-Period-Market","code":{"codeName":"Multi-Period-Market","description":"Produces a single file for each time period covering all the market.","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},"id":"941a0543-0cc0-4a5d-a782-728d2835c100","parentNode":{"type":"Indicator Bot","name":"Chris","code":{"codeName":"AAChris"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"1b7ecdbd-82e9-4a27-8fdd-467c0ca6bf23"}},"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":{"codeName":"Multi-Period-Market"},"parentNode":{"type":"Product Definition","name":"Bollinger Bands","code":{"codeName":"Bollinger-Bands"},"datasets":[],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","code":{"codeName":"begin","isNumeric":true},"id":"1e7186ee-c481-401d-827f-a30ee7434d92"},{"type":"Record Property","name":"End","code":{"codeName":"end","isNumeric":true},"id":"15f90f2e-80f0-4575-94d8-6d8957eceee1"},{"type":"Record Property","name":"Moving Average","code":{"codeName":"movingAverage","isNumeric":true},"id":"9786a9cd-1eff-4b5c-ae7c-1dde51659f82"},{"type":"Record Property","name":"Standard Deviation","code":{"codeName":"standardDeviation","isNumeric":true},"id":"e92d7855-bb18-494e-ab37-a895bbcb8287"},{"type":"Record Property","name":"Deviation","code":{"codeName":"deviation","isNumeric":true},"id":"03043530-caa1-416e-8303-840b732e516e"}],"id":"b5a5ec97-7246-42bd-97e4-28fb4a148b2c"},"parentNode":{"type":"Indicator Bot","name":"Chris","code":{"codeName":"AAChris"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"1b7ecdbd-82e9-4a27-8fdd-467c0ca6bf23"},"id":"29088877-8d63-4217-8d34-8742afc262f4"},"id":"f5b2a7d8-fc32-44a3-a002-9b0fc30a9719"}}],"id":"8b509294-6028-40e2-88a8-655a34245ed8"},"statusReport":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Multi-Period-Market","code":{"codeName":"Multi-Period-Market","description":"Produces for each market two files with bollinger channels respectively.","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-Market","startDate":{},"endDate":{}}},"id":"28be432d-80ca-46b3-859a-55541e24b2b4","parentNode":{"type":"Indicator Bot","name":"Paula","code":{"codeName":"AAPaula"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"bd0f325d-6f98-468b-8b7b-99a42a175d80"}},"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":{"codeName":"Multi-Period-Market","description":"Produces a single file for each time period covering all the market.","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}}}},"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":{"codeName":"Multi-Period-Market","description":"Produces for each market two files with bollinger channels respectively.","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-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":"27564838-24b1-4814-af8c-ec65accb05d1"},"id":"aa0f2533-460c-464f-ad77-6ae4cadd1178"}' - - - try { - global.TASK_NODE = JSON.parse(argument) - } catch (err) { - console.log(err.stack) - } + global.TASK_NODE = { "type": "Task", "name": "Generates Bollinger Channels & Sub-Channels", "bot": { "type": "Indicator Bot Instance", "name": "Paula", "code": { "team": "AAMasters", "bot": "AAPaula", "repo": "AAPaula-Indicator-Bot" }, "processes": [{ "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": { "codeName": "Multi-Period-Market", "description": "Produces for each market two files with bollinger channels respectively.", "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-Market", "startDate": {}, "endDate": {} } }, "id": "28be432d-80ca-46b3-859a-55541e24b2b4", "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" }, "parentNode": { "type": "Product Definition", "name": "Bollinger Channels", "code": { "codeName": "Bollinger-Channels", "displayName": "Bollinger-Channels", "description": "Two sets of files per period that contains Bollinger-Bands-Channels-Patterns.", "shareWith": "Public" }, "datasets": [], "record": { "type": "Record Definition", "name": "New Record Definition", "properties": [{ "type": "Record Property", "name": "Begin", "code": { "codeName": "begin", "isNumeric": true }, "formula": { "type": "Formula", "code": "// Write your formula here", "id": "caf8122c-3a07-4263-a56f-ffb05df281d6" }, "id": "06edb099-ff64-4528-b8c6-599154bc2ddf" }, { "type": "Record Property", "name": "End", "code": { "codeName": "end", "isNumeric": true }, "formula": { "type": "Formula", "code": "// Write your formula here", "id": "c8ec0868-8413-468c-88d5-3e43169395e0" }, "id": "94656d1f-508a-4e94-a8d2-013690aac596" }, { "type": "Record Property", "name": "Direction", "code": { "codeName": "direction", "isNumeric": false }, "formula": { "type": "Formula", "code": "// Write your formula here", "id": "e913afe9-b610-4777-bc9e-6349d436a90a" }, "id": "edc0f697-f5e2-446f-bae8-8db7adf91d23" }, { "type": "Record Property", "name": "Period", "code": { "codeName": "period", "isNumeric": true }, "formula": { "type": "Formula", "code": "// Write your formula here", "id": "83fce657-a0bb-41ee-80d1-9e2ab980c472" }, "id": "eb733f85-6cf5-485e-9bd3-2bf78733c492" }, { "type": "Record Property", "name": "First Moving Average", "code": { "codeName": "firstMovingAverage", "isNumeric": true }, "formula": { "type": "Formula", "code": "// Write your formula here", "id": "52490460-35e3-469a-824f-5b139571d4a0" }, "id": "a67a15ee-6f7f-48bd-9d55-82c57efc993b" }, { "type": "Record Property", "name": "Last Moving Average", "code": { "codeName": "lastMovingAverage", "isNumeric": true }, "formula": { "type": "Formula", "code": "// Write your formula here", "id": "41edc1ef-293a-4ceb-bf67-8042e8fdc4eb" }, "id": "0f05bffe-d668-4d25-ab67-d55a4a7c8f5d" }, { "type": "Record Property", "name": "First Deviation", "code": { "codeName": "firstDeviation", "isNumeric": true }, "formula": { "type": "Formula", "code": "// Write your formula here", "id": "5af02103-9bc9-4e6c-9684-5a612adfa495" }, "id": "eae84509-b689-4a76-9277-eed72af491dd" }, { "type": "Record Property", "name": "Last Deviation", "code": { "codeName": "lastDeviation", "isNumeric": true }, "formula": { "type": "Formula", "code": "// Write your formula here", "id": "bc82d292-e71a-4367-9b07-a0e3982ad60d" }, "id": "d5c32d1f-9e3c-48e8-8025-a17d57c0812e" }], "id": "6c3e68b0-b781-4c53-9ff7-67c3f747ac8a" }, "parentNode": { "type": "Indicator Bot", "name": "Paula", "code": { "codeName": "AAPaula" }, "processes": [], "products": [], "parentNode": { "type": "Team", "name": "Masters", "code": { "codeName": "AAMasters" }, "sensorBots": [], "indicatorBots": [], "tradingBots": [], "plotters": [], "id": "35be7b1c-a0f7-4b5f-9ee1-8fb51595e959" }, "id": "bd0f325d-6f98-468b-8b7b-99a42a175d80" }, "id": "1f111f72-624f-4166-9f99-ab8d785d5267" }, "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" }, "parentNode": { "type": "Product Definition", "name": "Bollinger Standard Channels", "code": { "codeName": "Bollinger-Standard-Channels", "displayName": "Bollinger-Standard-Channels", "description": "", "shareWith": "Public" }, "datasets": [], "record": { "type": "Record Definition", "name": "New Record Definition", "properties": [], "id": "9106250d-b042-4e96-9121-c760b4c1eab2" }, "parentNode": { "type": "Indicator Bot", "name": "Paula", "code": { "codeName": "AAPaula" }, "processes": [], "products": [], "parentNode": { "type": "Team", "name": "Masters", "code": { "codeName": "AAMasters" }, "sensorBots": [], "indicatorBots": [], "tradingBots": [], "plotters": [], "id": "35be7b1c-a0f7-4b5f-9ee1-8fb51595e959" }, "id": "bd0f325d-6f98-468b-8b7b-99a42a175d80" }, "id": "94bc3958-cc85-43a1-a178-103e84f42910" }, "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" }, "parentNode": { "type": "Product Definition", "name": "Bollinger Sub-Channels", "code": { "codeName": "Bollinger-Sub-Channels", "displayName": "Bollinger-Sub-Channels", "description": "Bollinger Sub Channels with slope.", "shareWith": "Public" }, "datasets": [], "record": { "type": "Record Definition", "name": "New Record Definition", "properties": [], "id": "5a780d7f-70df-4e86-8192-eacccafb5ca8" }, "parentNode": { "type": "Indicator Bot", "name": "Paula", "code": { "codeName": "AAPaula" }, "processes": [], "products": [], "parentNode": { "type": "Team", "name": "Masters", "code": { "codeName": "AAMasters" }, "sensorBots": [], "indicatorBots": [], "tradingBots": [], "plotters": [], "id": "35be7b1c-a0f7-4b5f-9ee1-8fb51595e959" }, "id": "bd0f325d-6f98-468b-8b7b-99a42a175d80" }, "id": "080c87fc-4546-4482-ab11-180a33f6d9ab" }, "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" }, "parentNode": { "type": "Product Definition", "name": "Bollinger Standard Sub-Channels", "code": { "codeName": "Bollinger-Standard-Sub-Channels", "displayName": "Bollinger-Standard-Sub-Channels", "description": "Bollinger Standard Sub Channels with slope.", "shareWith": "Public" }, "datasets": [], "record": { "type": "Record Definition", "name": "New Record Definition", "properties": [], "id": "cdbe5e0f-9292-4d3d-b98a-d441e6565b76" }, "parentNode": { "type": "Indicator Bot", "name": "Paula", "code": { "codeName": "AAPaula" }, "processes": [], "products": [], "parentNode": { "type": "Team", "name": "Masters", "code": { "codeName": "AAMasters" }, "sensorBots": [], "indicatorBots": [], "tradingBots": [], "plotters": [], "id": "35be7b1c-a0f7-4b5f-9ee1-8fb51595e959" }, "id": "bd0f325d-6f98-468b-8b7b-99a42a175d80" }, "id": "79ce9c05-8a4c-4b58-850f-288037acc702" }, "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 Reference", "code": { "mainUtility": "Self Reference" }, "id": "ae627a69-4089-432d-b379-1b12ce4bd75e", "referenceParent": { "type": "Status Report", "name": "New Status Report", "parentNode": { "type": "Process Definition", "name": "Multi-Period-Market", "code": { "codeName": "Multi-Period-Market", "description": "Produces for each market two files with bollinger channels respectively.", "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-Market", "startDate": {}, "endDate": {} } }, "id": "28be432d-80ca-46b3-859a-55541e24b2b4", "parentNode": { "type": "Indicator Bot", "name": "Paula", "code": { "codeName": "AAPaula" }, "processes": [], "products": [], "parentNode": { "type": "Team", "name": "Masters", "code": { "codeName": "AAMasters" }, "sensorBots": [], "indicatorBots": [], "tradingBots": [], "plotters": [], "id": "35be7b1c-a0f7-4b5f-9ee1-8fb51595e959" }, "id": "bd0f325d-6f98-468b-8b7b-99a42a175d80" } }, "id": "af8aded9-002a-475a-88f5-d29573740969" } }, { "type": "Status Dependency", "name": "Market Ending Point", "code": { "mainUtility": "Market Ending Point" }, "id": "4a603114-d464-46db-90a1-62304274117a", "referenceParent": { "type": "Status Report", "name": "New Status Report", "parentNode": { "type": "Process Definition", "name": "Multi-Period-Market", "code": { "codeName": "Multi-Period-Market", "description": "Produces a single file for each time period covering all the market.", "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 }, "id": "941a0543-0cc0-4a5d-a782-728d2835c100", "parentNode": { "type": "Indicator Bot", "name": "Chris", "code": { "codeName": "AAChris" }, "processes": [], "products": [], "parentNode": { "type": "Team", "name": "Masters", "code": { "codeName": "AAMasters" }, "sensorBots": [], "indicatorBots": [], "tradingBots": [], "plotters": [], "id": "35be7b1c-a0f7-4b5f-9ee1-8fb51595e959" }, "id": "1b7ecdbd-82e9-4a27-8fdd-467c0ca6bf23" } }, "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": { "codeName": "Multi-Period-Market" }, "parentNode": { "type": "Product Definition", "name": "Bollinger Bands", "code": { "codeName": "Bollinger-Bands", "variableName": "bollingerBand" }, "datasets": [], "record": { "type": "Record Definition", "name": "New Record Definition", "properties": [{ "type": "Record Property", "name": "Begin", "code": { "codeName": "begin", "isNumeric": true }, "id": "1e7186ee-c481-401d-827f-a30ee7434d92" }, { "type": "Record Property", "name": "End", "code": { "codeName": "end", "isNumeric": true }, "id": "15f90f2e-80f0-4575-94d8-6d8957eceee1" }, { "type": "Record Property", "name": "Moving Average", "code": { "codeName": "movingAverage", "isNumeric": true }, "id": "9786a9cd-1eff-4b5c-ae7c-1dde51659f82" }, { "type": "Record Property", "name": "Standard Deviation", "code": { "codeName": "standardDeviation", "isNumeric": true }, "id": "e92d7855-bb18-494e-ab37-a895bbcb8287" }, { "type": "Record Property", "name": "Deviation", "code": { "codeName": "deviation", "isNumeric": true }, "id": "03043530-caa1-416e-8303-840b732e516e" }, { "type": "Record Property", "name": "Direction", "code": { "codeName": "direction", "isNumeric": false, "isCalculated": true }, "formula": { "type": "Formula", "code": "variable.direction", "id": "f72926d9-c869-4b7c-ba1e-b36d134e2bc6" }, "id": "856f24c9-f5f1-491b-98e7-6e1d3c5c5874" }, { "type": "Record Property", "name": "Slope", "code": { "codeName": "slope", "isNumeric": false, "isCalculated": true }, "formula": { "type": "Formula", "code": "variable.slope", "id": "fac935fe-b448-4b34-aed7-b35f70808911" }, "id": "4c027b0c-da8a-4146-a51a-d0a7a126150b" }], "id": "b5a5ec97-7246-42bd-97e4-28fb4a148b2c" }, "calculations": { "type": "Calculations Procedure", "name": "New Calculations Procedure", "initialization": { "type": "Procedure Initialization", "name": "New Procedure Initialization", "code": { "type": "Code", "code": "variable.lastMovingAverage = 0\nvariable.SIDE_TOLERANCE = 0.5 * system.timePeriod / system.ONE_DAY_IN_MILISECONDS\nvariable.SMALL_SLOPE = 1.0 * system.timePeriod / system.ONE_DAY_IN_MILISECONDS\nvariable.MEDIUM_SLOPE = 2.0 * system.timePeriod / system.ONE_DAY_IN_MILISECONDS\nvariable.HIGH_SLOPE = 4.0 * system.timePeriod / system.ONE_DAY_IN_MILISECONDS\n", "id": "f00ac417-cd99-493c-b959-35eddd6fe4f3" }, "id": "d144ab2f-5b4e-4153-806a-d471e9f281dd" }, "loop": { "type": "Procedure Loop", "name": "New Procedure Loop", "code": { "type": "Code", "code": "\nif (variable.lastMovingAverage > indicator.bollingerBand.movingAverage) { variable.direction = \"Down\" }\nif (variable.lastMovingAverage < indicator.bollingerBand.movingAverage) { variable.direction = \"Up\" }\nif (variable.lastMovingAverage === indicator.bollingerBand.movingAverage) { variable.direction = \"Side\" }\n\nvariable.delta = Math.abs(indicator.bollingerBand.movingAverage - variable.lastMovingAverage)\n\nvariable.slope = \"Extreme\"\nif (variable.delta < indicator.bollingerBand.movingAverage * variable.HIGH_SLOPE / 100) { variable.slope = \"Steep\" }\nif (variable.delta < indicator.bollingerBand.movingAverage * variable.MEDIUM_SLOPE / 100) { variable.slope = \"Medium\" }\nif (variable.delta < indicator.bollingerBand.movingAverage * variable.SMALL_SLOPE / 100) { variable.slope = \"Gentle\" }\nif (variable.delta < indicator.bollingerBand.movingAverage * variable.SIDE_TOLERANCE / 100) { variable.slope = \"Side\" }\n\nvariable.lastMovingAverage = indicator.bollingerBand.movingAverage", "id": "14fc0c9c-cd10-4931-95b5-4bc7d549942a" }, "id": "8a669548-845b-4d80-ae96-29f68e9c9ac7" }, "id": "d72c7cb2-8886-4101-a83a-f9788b8400a0" }, "dataBuilding": { "type": "Data Building Procedure", "name": "New Data Building Procedure", "id": "139484b3-3a3f-4268-801e-a8c441746c7a" }, "parentNode": { "type": "Indicator Bot", "name": "Chris", "code": { "codeName": "AAChris" }, "processes": [], "products": [], "parentNode": { "type": "Team", "name": "Masters", "code": { "codeName": "AAMasters" }, "sensorBots": [], "indicatorBots": [], "tradingBots": [], "plotters": [], "id": "35be7b1c-a0f7-4b5f-9ee1-8fb51595e959" }, "id": "1b7ecdbd-82e9-4a27-8fdd-467c0ca6bf23" }, "id": "29088877-8d63-4217-8d34-8742afc262f4" }, "id": "f5b2a7d8-fc32-44a3-a002-9b0fc30a9719" } }], "id": "8b509294-6028-40e2-88a8-655a34245ed8" }, "statusReport": { "type": "Status Report", "name": "New Status Report", "parentNode": { "type": "Process Definition", "name": "Multi-Period-Market", "code": { "codeName": "Multi-Period-Market", "description": "Produces for each market two files with bollinger channels respectively.", "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-Market", "startDate": {}, "endDate": {} } }, "id": "28be432d-80ca-46b3-859a-55541e24b2b4", "parentNode": { "type": "Indicator Bot", "name": "Paula", "code": { "codeName": "AAPaula" }, "processes": [], "products": [], "parentNode": { "type": "Team", "name": "Masters", "code": { "codeName": "AAMasters" }, "sensorBots": [], "indicatorBots": [], "tradingBots": [], "plotters": [], "id": "35be7b1c-a0f7-4b5f-9ee1-8fb51595e959" }, "id": "bd0f325d-6f98-468b-8b7b-99a42a175d80" } }, "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": { "codeName": "Multi-Period-Market", "description": "Produces a single file for each time period covering all the market.", "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 } } } }, "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": { "codeName": "Multi-Period-Market", "description": "Produces for each market two files with bollinger channels respectively.", "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-Market", "startDate": {}, "endDate": {} } } } } } }], "id": "27564838-24b1-4814-af8c-ec65accb05d1" }, "id": "aa0f2533-460c-464f-ad77-6ae4cadd1178" } } require('dotenv').config();