Cloud Utilities retired

This commit is contained in:
Luis Fernando Molina committed 2020-12-01 16:31:39 +01:00
1 parent c74ea51db5
commit 31923483a0
24 files changed
+91 -104

No files matched your search

-16
View File
@@ -1,16 +0,0 @@
exports.newCloudUtilities = function newCloudUtilities() {
const MODULE_NAME = "Cloud Utilities";
let utilities = {
pad: pad
};
return utilities;
function pad(str, max) {
str = str.toString();
return str.length < max ? pad("0" + str, max) : str;
}
}
+3 -3
View File
@@ -1,4 +1,4 @@
exports.newCommons = function (processIndex, UTILITIES, FILE_STORAGE) {
exports.newCommons = function (processIndex, FILE_STORAGE) {
const MODULE_NAME = "Commons";
@@ -12,7 +12,7 @@
writeFile: writeFile
};
let utilities = UTILITIES.newCloudUtilities();
let fileStorage = FILE_STORAGE.newFileStorage(processIndex, );
return thisObject;
@@ -517,7 +517,7 @@
let dateForPath = ''
if (processingDailyFiles === true) {
dateForPath = "/" + currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2);
dateForPath = "/" + currentDay.getUTCFullYear() + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(currentDay.getUTCMonth() + 1, 2) + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(currentDay.getUTCDate(), 2);
}
let filePathRoot = 'Project/' + contextSummary.project + "/" + contextSummary.mineType + "/" + contextSummary.dataMine + "/" + contextSummary.bot + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName + "-" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
+4 -5
View File
@@ -105,7 +105,6 @@
TS.projects.superalgos.functionLibraries.processFunctions.processHeartBeat(processIndex)
/* We define here all the modules that the rest of the infraestructure, including the bots themselves can consume. */
const UTILITIES = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'CloudUtilities');
const STATUS_REPORT = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'StatusReport');
const STATUS_DEPENDENCIES = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'StatusDependencies');
const DATA_DEPENDENCIES = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'DataDependencies');
@@ -233,7 +232,7 @@
function initializeStatusDependencies() {
try {
statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(processIndex, STATUS_REPORT, UTILITIES, PROCESS_OUTPUT);
statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(processIndex, STATUS_REPORT, PROCESS_OUTPUT);
statusDependencies.initialize(onInizialized);
function onInizialized(err) {
@@ -296,12 +295,12 @@
switch (processConfig.framework.name) {
case 'Multi-Period-Market': {
processFramework = MULTI_PERIOD_MARKET.newMultiPeriodMarket(processIndex, UTILITIES, FILE_STORAGE);
processFramework = MULTI_PERIOD_MARKET.newMultiPeriodMarket(processIndex, FILE_STORAGE);
intitializeProcessFramework();
break;
}
case 'Multi-Period-Daily': {
processFramework = MULTI_PERIOD_DAILY.newMultiPeriodDaily(processIndex, UTILITIES, FILE_STORAGE);
processFramework = MULTI_PERIOD_DAILY.newMultiPeriodDaily(processIndex, FILE_STORAGE);
intitializeProcessFramework();
break;
}
@@ -353,7 +352,7 @@
function initializeUserBot() {
try {
usertBot = USER_BOT_MODULE.newUserBot(processIndex, COMMONS_MODULE, UTILITIES, FILE_STORAGE);
usertBot = USER_BOT_MODULE.newUserBot(processIndex, COMMONS_MODULE, FILE_STORAGE);
usertBot.initialize(statusDependencies, onInizialized);
function onInizialized(err) {
+3 -3
View File
@@ -1,4 +1,4 @@
exports.newIndicatorOutput = function (processIndex, UTILITIES, FILE_STORAGE) {
exports.newIndicatorOutput = function (processIndex, FILE_STORAGE) {
const MODULE_NAME = "Indicator Bot";
let thisObject = {
@@ -7,11 +7,11 @@
start: start
};
let utilities = UTILITIES.newCloudUtilities();
let fileStorage = FILE_STORAGE.newFileStorage(processIndex, );
const COMMONS = require('./Commons.js');
let commons = COMMONS.newCommons(processIndex, UTILITIES, FILE_STORAGE);
let commons = COMMONS.newCommons(processIndex, FILE_STORAGE);
return thisObject;
@@ -1,4 +1,4 @@
exports.newTradingOutput = function (processIndex, tradingEngineModule, UTILITIES, FILE_STORAGE) {
exports.newTradingOutput = function (processIndex, tradingEngineModule, FILE_STORAGE) {
/*
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.
@@ -11,7 +11,7 @@ exports.newTradingOutput = function (processIndex, tradingEngineModule, UTILITIE
start: start
}
let utilities = UTILITIES.newCloudUtilities()
let fileStorage = FILE_STORAGE.newFileStorage(processIndex, )
return thisObject
@@ -38,7 +38,7 @@ exports.newTradingOutput = function (processIndex, tradingEngineModule, UTILITIE
/* Preparing everything for the Simulation */
const TRADING_SIMULATION = require('./TradingSimulation.js')
let tradingSimulation = TRADING_SIMULATION.newTradingSimulation(processIndex, tradingEngineModule, UTILITIES)
let tradingSimulation = TRADING_SIMULATION.newTradingSimulation(processIndex, tradingEngineModule)
let outputDatasets = TS.projects.superalgos.utilities.nodeFunctions.nodeBranchToArray(TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput, 'Output Dataset')
let outputDatasetsMap = new Map()
@@ -147,7 +147,7 @@ exports.newTradingOutput = function (processIndex, tradingEngineModule, UTILITIE
if (dataset.config.type === 'Daily Files') {
let dateForPath = tradingProcessDate.getUTCFullYear() + '/' + utilities.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '/' + utilities.pad(tradingProcessDate.getUTCDate(), 2);
let dateForPath = tradingProcessDate.getUTCFullYear() + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCDate(), 2);
let fileName = 'Data.json'
let filePath = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT + '/Output/' + TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_FOLDER_NAME + '/' + dataset.parentNode.config.codeName + '/' + dataset.config.codeName + '/' + timeFrameLabel + "/" + dateForPath
@@ -204,7 +204,7 @@ exports.newTradingOutput = function (processIndex, tradingEngineModule, UTILITIE
if (dataset.config.type === 'Daily Files') {
let dateForPath = tradingProcessDate.getUTCFullYear() + '/' + utilities.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '/' + utilities.pad(tradingProcessDate.getUTCDate(), 2);
let dateForPath = tradingProcessDate.getUTCFullYear() + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCDate(), 2);
let fileName = 'Data.json'
let filePath = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT + '/Output/' + TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_FOLDER_NAME + '/' + dataset.parentNode.config.codeName + '/' + dataset.config.codeName + '/' + timeFrameLabel + "/" + dateForPath
@@ -1,4 +1,4 @@
exports.newTradingProcess = function (processIndex, UTILITIES) {
exports.newTradingProcess = function (processIndex) {
/*
This Module will load all the process data dependencies from files and send them downstream.
After execution, will save the time range and status report of the process.
@@ -13,7 +13,7 @@
start: start
};
let utilities = UTILITIES.newCloudUtilities();
let statusDependencies;
let dataDependenciesModule;
@@ -27,7 +27,7 @@
let tradingEngineModule = TRADING_ENGINE_MODULE.newTradingEngine(processIndex)
let TRADING_OUTPUT_MODULE = require("./TradingOutput")
let tradingOutputModule = TRADING_OUTPUT_MODULE.newTradingOutput(processIndex, tradingEngineModule, UTILITIES, FILE_STORAGE)
let tradingOutputModule = TRADING_OUTPUT_MODULE.newTradingOutput(processIndex, tradingEngineModule, FILE_STORAGE)
let processConfig;
@@ -447,7 +447,7 @@
async function processDailyFiles() {
/* Telling the world we are alive and doing well and which date we are processing right now. */
let processingDateString = tradingProcessDate.getUTCFullYear() + '-' + utilities.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '-' + utilities.pad(tradingProcessDate.getUTCDate(), 2);
let processingDateString = tradingProcessDate.getUTCFullYear() + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCDate(), 2);
TS.projects.superalgos.functionLibraries.processFunctions.processHeartBeat(processIndex, processingDateString, undefined, "Running...")
/*
@@ -493,7 +493,7 @@
}
}
let dateForPath = tradingProcessDate.getUTCFullYear() + '/' + utilities.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '/' + utilities.pad(tradingProcessDate.getUTCDate(), 2);
let dateForPath = tradingProcessDate.getUTCFullYear() + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCDate(), 2);
let filePath
if (dependency.referenceParent.config.codeName === "Multi-Period-Daily") {
filePath = dependency.referenceParent.parentNode.config.codeName + '/' + dependency.referenceParent.config.codeName + "/" + timeFrameLabel + "/" + dateForPath;
@@ -550,7 +550,7 @@
function buildCharts(chart) {
const COMMONS = require('../Commons.js')
let commons = COMMONS.newCommons(processIndex, UTILITIES, FILE_STORAGE)
let commons = COMMONS.newCommons(processIndex, FILE_STORAGE)
let mainDependency = {}
@@ -1,4 +1,4 @@
exports.newTradingSimulation = function (processIndex, tradingEngineModule, UTILITIES) {
exports.newTradingSimulation = function (processIndex, tradingEngineModule) {
/*
This Module represents the trading simulacion. Escentially a loop through a set of candles and
the execution at each loop cycle of the Trading System Protocol.
@@ -11,7 +11,7 @@ exports.newTradingSimulation = function (processIndex, tradingEngineModule, UTIL
runSimulation: runSimulation
}
let utilities = UTILITIES.newCloudUtilities()
return thisObject
@@ -263,7 +263,7 @@ exports.newTradingSimulation = function (processIndex, tradingEngineModule, UTIL
let fromDate = new Date(sessionParameters.timeRange.config.initialDatetime)
let lastDate = new Date(sessionParameters.timeRange.config.finalDatetime)
let currentDateString = heartBeatDate.getUTCFullYear() + '-' + utilities.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + utilities.pad(heartBeatDate.getUTCDate(), 2)
let currentDateString = heartBeatDate.getUTCFullYear() + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCDate(), 2)
let currentDate = new Date(heartBeatDate)
let percentage = TS.projects.superalgos.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
@@ -274,7 +274,7 @@ exports.newTradingSimulation = function (processIndex, tradingEngineModule, UTIL
if (heartBeatDate.valueOf() !== previousHeartBeatDate) {
previousHeartBeatDate = heartBeatDate.valueOf()
let processingDate = heartBeatDate.getUTCFullYear() + '-' + utilities.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + utilities.pad(heartBeatDate.getUTCDate(), 2)
let processingDate = heartBeatDate.getUTCFullYear() + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCDate(), 2)
if (FULL_LOG === true) { TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE.write(MODULE_NAME, '[INFO] runSimulation -> loop -> Simulation ' + TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_KEY + ' Loop # ' + tradingEngine.current.episode.candle.index.value + ' @ ' + processingDate) }
+6 -6
View File
@@ -1,4 +1,4 @@
exports.newMultiPeriodDaily = function (processIndex, UTILITIES, FILE_STORAGE) {
exports.newMultiPeriodDaily = function (processIndex, FILE_STORAGE) {
const MODULE_NAME = "Multi Period Daily";
const GMT_SECONDS = ':00.000 GMT+0000';
@@ -8,7 +8,7 @@
start: start
};
let utilities = UTILITIES.newCloudUtilities()
let fileStorage = FILE_STORAGE.newFileStorage(processIndex, )
let statusDependencies;
@@ -33,7 +33,7 @@
let INDICATOR_OUTPUT_MODULE = require("./IndicatorOutput")
indicatorOutputModule = INDICATOR_OUTPUT_MODULE.newIndicatorOutput(processIndex, UTILITIES, FILE_STORAGE)
indicatorOutputModule = INDICATOR_OUTPUT_MODULE.newIndicatorOutput(processIndex, FILE_STORAGE)
indicatorOutputModule.initialize(callBackFunction)
}
@@ -238,7 +238,7 @@
}
/* Telling the world we are alive and doing well */
let currentDateString = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCFullYear() + '-' + utilities.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCMonth() + 1, 2) + '-' + utilities.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCDate(), 2)
let currentDateString = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCFullYear() + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCMonth() + 1, 2) + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCDate(), 2)
let currentDate = new Date(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME)
let percentage = TS.projects.superalgos.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
TS.projects.superalgos.functionLibraries.processFunctions.processHeartBeat(processIndex, currentDateString, percentage)
@@ -319,7 +319,7 @@
}
function getPreviousFile() {
let dateForPath = previousDay.getUTCFullYear() + '/' + utilities.pad(previousDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(previousDay.getUTCDate(), 2)
let dateForPath = previousDay.getUTCFullYear() + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(previousDay.getUTCMonth() + 1, 2) + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(previousDay.getUTCDate(), 2)
let filePath
if (dependency.referenceParent.config.codeName === "Multi-Period-Daily") {
filePath = dependency.referenceParent.parentNode.config.codeName + '/' + dependency.referenceParent.config.codeName + "/" + timeFrameLabel + "/" + dateForPath;
@@ -366,7 +366,7 @@
}
function getCurrentFile() {
let dateForPath = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCFullYear() + '/' + utilities.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCMonth() + 1, 2) + '/' + utilities.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCDate(), 2)
let dateForPath = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCFullYear() + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCMonth() + 1, 2) + '/' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCDate(), 2)
let filePath
if (dependency.referenceParent.config.codeName === "Multi-Period-Daily") {
filePath = dependency.referenceParent.parentNode.config.codeName + '/' + dependency.referenceParent.config.codeName + "/" + timeFrameLabel + "/" + dateForPath;
+4 -4
View File
@@ -1,4 +1,4 @@
exports.newMultiPeriodMarket = function (processIndex, UTILITIES, FILE_STORAGE) {
exports.newMultiPeriodMarket = function (processIndex, FILE_STORAGE) {
const MODULE_NAME = "Multi Period Market";
thisObject = {
initialize: initialize,
@@ -6,7 +6,7 @@
start: start
};
let utilities = UTILITIES.newCloudUtilities()
let fileStorage = FILE_STORAGE.newFileStorage(processIndex, )
let statusDependencies;
@@ -27,7 +27,7 @@
let INDICATOR_OUTPUT_MODULE = require("./IndicatorOutput")
indicatorOutputModule = INDICATOR_OUTPUT_MODULE.newIndicatorOutput(processIndex, UTILITIES, FILE_STORAGE)
indicatorOutputModule = INDICATOR_OUTPUT_MODULE.newIndicatorOutput(processIndex, FILE_STORAGE)
indicatorOutputModule.initialize(callBackFunction)
}
@@ -215,7 +215,7 @@
}
/* Telling the world we are alive and doing well */
let currentDateString = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCFullYear() + '-' + utilities.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCMonth() + 1, 2) + '-' + utilities.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCDate(), 2)
let currentDateString = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCFullYear() + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCMonth() + 1, 2) + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCDate(), 2)
let currentDate = new Date(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME)
let lastDate = new Date()
TS.projects.superalgos.functionLibraries.processFunctions.processHeartBeat(processIndex, currentDateString, TS.projects.superalgos.utilities.dateTimeFunctions.getPercentage(currentDate, currentDate, lastDate))
@@ -1,4 +1,4 @@
exports.newLearningProcess = function (processIndex, UTILITIES) {
exports.newLearningProcess = function (processIndex) {
thisObject = {
+2 -3
View File
@@ -110,7 +110,6 @@
TS.projects.superalgos.functionLibraries.processFunctions.processHeartBeat(processIndex)
/* We define here all the modules that the rest of the infraestructure, including the bots themselves can consume. */
const UTILITIES = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'CloudUtilities');
const STATUS_REPORT = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'StatusReport');
const STATUS_DEPENDENCIES = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'StatusDependencies');
const PROCESS_EXECUTION_EVENTS = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'ProcessExecutionEvents');
@@ -236,7 +235,7 @@
function initializeStatusDependencies() {
try {
statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(processIndex, STATUS_REPORT, UTILITIES, PROCESS_OUTPUT);
statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(processIndex, STATUS_REPORT, PROCESS_OUTPUT);
statusDependencies.initialize(onInizialized);
function onInizialized(err) {
@@ -284,7 +283,7 @@
function initializeUserBot() {
try {
usertBot = USER_BOT_MODULE.newUserBot(processIndex, COMMONS_MODULE, UTILITIES, FILE_STORAGE, STATUS_REPORT, exchangeAPI);
usertBot = USER_BOT_MODULE.newUserBot(processIndex, COMMONS_MODULE, FILE_STORAGE, STATUS_REPORT, exchangeAPI);
usertBot.initialize(statusDependencies, onInizialized);
function onInizialized(err) {
+2 -2
View File
@@ -1,4 +1,4 @@
exports.newStatusDependencies = function (processIndex, STATUS_REPORT, UTILITIES, PROCESS_OUTPUT) {
exports.newStatusDependencies = function (processIndex, STATUS_REPORT, PROCESS_OUTPUT) {
const MODULE_NAME = "Status Dependencies";
@@ -46,7 +46,7 @@
for (let i = 0; i < dependenciesToProcess.length; i++) {
let statusReportModule = STATUS_REPORT.newStatusReport(processIndex, UTILITIES, PROCESS_OUTPUT);
let statusReportModule = STATUS_REPORT.newStatusReport(processIndex, PROCESS_OUTPUT);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE.write(MODULE_NAME, "[INFO] initialize -> onInitilized -> Initializing Status Report # " + (i + 1));
let statusDependency = dependenciesToProcess[i]
+2 -2
View File
@@ -1,4 +1,4 @@
exports.newStatusReport = function (processIndex, UTILITIES, PROCESS_OUTPUT) {
exports.newStatusReport = function (processIndex, PROCESS_OUTPUT) {
/*
@@ -26,7 +26,7 @@
/* Utilities needed. */
let utilities = UTILITIES.newCloudUtilities();
/* Storage account to be used here. */
+2 -3
View File
@@ -69,7 +69,6 @@
TS.projects.superalgos.functionLibraries.processFunctions.processHeartBeat(processIndex, undefined, undefined, "Running...")
/* We define here all the modules that the rest of the infraestructure, including the bots themselves can consume. */
const UTILITIES = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'CloudUtilities');
const STATUS_REPORT = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'StatusReport');
const STATUS_DEPENDENCIES = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'StatusDependencies');
const DATA_DEPENDENCIES = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'DataDependencies');
@@ -220,7 +219,7 @@
function initializeStatusDependencies() {
try {
statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(processIndex, STATUS_REPORT, UTILITIES, PROCESS_OUTPUT);
statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(processIndex, STATUS_REPORT, PROCESS_OUTPUT);
statusDependencies.initialize(onInizialized);
function onInizialized(err) {
@@ -278,7 +277,7 @@
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE.write(MODULE_NAME, "[INFO] run -> loop -> initializeDataDependencies -> onInizialized -> Execution finished well.")
switch (processConfig.framework.name) {
case 'Low-Frequency-Trading-Process': {
processFramework = TRADING_PROCESS_MODULE.newTradingProcess(processIndex, UTILITIES);
processFramework = TRADING_PROCESS_MODULE.newTradingProcess(processIndex);
intitializeProcessFramework();
break;
}