From 01f18b07ba1af1a366efb657966c3ebfda54196d Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 3 Dec 2020 10:18:33 +0100 Subject: [PATCH] Trading Output --- Projects/ProjectsSchema.json | 7 +++++++ .../Low-Frequency-Trading}/TradingOutput.js | 2 +- .../Low-Frequency-Trading/TradingProcess.js | 20 +++++-------------- 3 files changed, 13 insertions(+), 16 deletions(-) rename {TaskServer/LowFrequencyTrading => Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading}/TradingOutput.js (99%) diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index 6dcebff4a..2aa0170c3 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -568,6 +568,13 @@ "functionName": "newSuperalgosBotModulesTradingEngine", "fileName": "TradingEngine.js", "folderName": "Trading-Bot/Low-Frequency-Trading" + }, + { + "name": "Trading Output", + "propertyName": "tradingOutput", + "functionName": "newSuperalgosBotModulesTradingOutput", + "fileName": "TradingOutput.js", + "folderName": "Trading-Bot/Low-Frequency-Trading" } ] }, diff --git a/TaskServer/LowFrequencyTrading/TradingOutput.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingOutput.js similarity index 99% rename from TaskServer/LowFrequencyTrading/TradingOutput.js rename to Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingOutput.js index 445b5f99a..90ee0e79d 100644 --- a/TaskServer/LowFrequencyTrading/TradingOutput.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingOutput.js @@ -1,4 +1,4 @@ -exports.newTradingOutput = function (processIndex, tradingEngineModule) { +exports.newSuperalgosBotModulesTradingOutput = function (processIndex, tradingEngineModule) { /* This module will load if necesary all the data outputs so that they can be appended with new records if needed. After running the simulation, it will save all the data outputs. diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingProcess.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingProcess.js index dace20942..bdbfdb8d7 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingProcess.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingProcess.js @@ -13,34 +13,24 @@ start: start }; - - let statusDependencies; let dataDependenciesModule; let dataFiles = new Map(); let multiPeriodDataFiles = new Map(); - let fileStorage = TS.projects.superalgos.taskModules.fileStorage.newFileStorage(processIndex); - let tradingEngineModuleObject = TS.projects.superalgos.botModules.tradingEngine.newSuperalgosBotModulesTradingEngine(processIndex) - - let TRADING_OUTPUT_MODULE = require("./TradingOutput") - let tradingOutputModule = TRADING_OUTPUT_MODULE.newTradingOutput(processIndex, tradingEngineModuleObject) - + let tradingOutputModuleObject = TS.projects.superalgos.botModules.tradingOutput.newSuperalgosBotModulesTradingOutput(processIndex, tradingEngineModuleObject) let processConfig; return thisObject; function initialize(pProcessConfig, pStatusDependencies, pDataDependencies, callBackFunction) { try { - - - statusDependencies = pStatusDependencies dataDependenciesModule = pDataDependencies processConfig = pProcessConfig - tradingOutputModule.initialize() + tradingOutputModuleObject.initialize() callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE) @@ -55,8 +45,8 @@ tradingEngineModuleObject.finalize() tradingEngineModuleObject = undefined - tradingOutputModule.finalize() - tradingOutputModule = undefined + tradingOutputModuleObject.finalize() + tradingOutputModuleObject = undefined dataFiles = undefined multiPeriodDataFiles = undefined @@ -603,7 +593,7 @@ } async function generateOutput(chart) { - await tradingOutputModule.start( + await tradingOutputModuleObject.start( chart, currentTimeFrame, currentTimeFrameLabel,