diff --git a/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/FromOneMinToMultiPeriodMarket.js b/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/FromOneMinToMultiPeriodMarket.js index 6f2bcf12a..dc8b2976d 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/FromOneMinToMultiPeriodMarket.js +++ b/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/FromOneMinToMultiPeriodMarket.js @@ -29,25 +29,31 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodMarket = function (process let thisObject = { initialize: initialize, + finalize: finalize, start: start } - let fileStorage = TS.projects.superalgos.taskModules.fileStorage.newFileStorage(processIndex); - let statusDependencies; + let fileStorage = TS.projects.superalgos.taskModules.fileStorage.newFileStorage(processIndex) + + let statusDependencies + let dataDependenciesModule let beginingOfMarket return thisObject; - function initialize(pStatusDependencies, callBackFunction) { - try { - statusDependencies = pStatusDependencies; - callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE); - } catch (err) { - TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err - TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, - "[ERROR] initialize -> err = " + err.stack); - callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE); - } + function initialize(pStatusDependencies, pDataDependencies, callBackFunction) { + + statusDependencies = pStatusDependencies + dataDependenciesModule = pDataDependencies + + callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE) + } + + function finalize() { + fileStorage = undefined + statusDependencies = undefined + dataDependenciesModule = undefined + thisObject = undefined } function start(callBackFunction) { @@ -69,7 +75,6 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodMarket = function (process let statusReport; /* We look first for Exchange Raw Data in order to get when the market starts. */ - reportKey = "Masters" + "-" + "Exchange-Raw-Data" + "-" + "Historic-OHLCVs" TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[INFO] start -> getContextVariables -> reportKey = " + reportKey) diff --git a/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/MultiPeriodMarket.js b/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/MultiPeriodMarket.js index 7c1e0ba5b..1583b4eb9 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/MultiPeriodMarket.js +++ b/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/MultiPeriodMarket.js @@ -21,8 +21,8 @@ function initialize(pStatusDependencies, pDataDependencies, callBackFunction) { - statusDependencies = pStatusDependencies; - dataDependenciesModule = pDataDependencies; + statusDependencies = pStatusDependencies + dataDependenciesModule = pDataDependencies indicatorOutputModule = TS.projects.superalgos.botModules.indicatorOutput.newSuperalgosBotModulesIndicatorOutput(processIndex) indicatorOutputModule.initialize(callBackFunction) diff --git a/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js b/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js index 9387e65c7..b0a052b75 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js +++ b/Projects/Superalgos/TS/Bot-Modules/Indicator-Bot/SingleMarketIndicatorBot.js @@ -285,6 +285,16 @@ intitializeProcessFramework(); break; } + case 'From-One-Min-To-Multi-Period-Market': { + processFramework = TS.projects.superalgos.botModules.multiPeriodMarket.newSuperalgosBotModulesFromOneMinToMultiPeriodMarket(processIndex); + intitializeProcessFramework(); + break; + } + case 'From-One-Min-To-Multi-Period-Daily': { + processFramework = TS.projects.superalgos.botModules.multiPeriodMarket.newSuperalgosBotModulesFromOneMinToMultiPeriodDaily(processIndex); + intitializeProcessFramework(); + break; + } default: { TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> Process Framework not Supported.");