Trading Output

This commit is contained in:
Luis Fernando Molina committed 2020-12-03 10:18:33 +01:00
1 parent 8f4b9848c7
commit 01f18b07ba
3 files changed
+13 -16

No files matched your search

+7
View File
@@ -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"
}
]
},
@@ -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.
@@ -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,