diff --git a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Daily/User.Bot.js b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Daily/User.Bot.js index a22cc86dd..65faf3d75 100644 --- a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Daily/User.Bot.js +++ b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Daily/User.Bot.js @@ -283,7 +283,7 @@ bot.processHeartBeat(currentDateString, percentage) if (TS.projects.superalgos.utilities.dateTimeFunctions.areTheseDatesEqual(currentDate, new Date()) === false) { - logger.newInternalLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, currentDate, percentage); + logger.newInternalLoop(currentDate, percentage); } periodsLoop(); diff --git a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Market/User.Bot.js b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Market/User.Bot.js index a00cbf319..ef779b557 100644 --- a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Market/User.Bot.js +++ b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Market/User.Bot.js @@ -470,7 +470,7 @@ thisReport.save(callBack); if (TS.projects.superalgos.utilities.dateTimeFunctions.areTheseDatesEqual(bot.processDatetime, new Date()) === false) { - logger.newInternalLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, bot.processDatetime); + logger.newInternalLoop(bot.processDatetime); } /* Telling the world we are alive and doing well */ diff --git a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Daily/User.Bot.js b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Daily/User.Bot.js index fd2904971..06b842d1f 100644 --- a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Daily/User.Bot.js +++ b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Daily/User.Bot.js @@ -261,7 +261,7 @@ Read the candles and volumes from Exchange Raw Data and produce a file for each bot.processHeartBeat(currentDateString, percentage) if (TS.projects.superalgos.utilities.dateTimeFunctions.areTheseDatesEqual(currentDate, new Date()) === false) { - logger.newInternalLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, currentDate, percentage); + logger.newInternalLoop(currentDate, percentage); } /* diff --git a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Market/User.Bot.js b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Market/User.Bot.js index 7348d2051..5481e4742 100644 --- a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Market/User.Bot.js +++ b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Market/User.Bot.js @@ -427,7 +427,7 @@ bot.processHeartBeat(currentDateString, percentage) if (TS.projects.superalgos.utilities.dateTimeFunctions.areTheseDatesEqual(currentDate, new Date()) === false) { - logger.newInternalLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, currentDate, percentage); + logger.newInternalLoop(currentDate, percentage); } periodsLoop(); diff --git a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Exchange-Raw-Data-Sensor-Bot/Historic-OHLCVs/User.Bot.js b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Exchange-Raw-Data-Sensor-Bot/Historic-OHLCVs/User.Bot.js index 507dc5431..f130e76de 100644 --- a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Exchange-Raw-Data-Sensor-Bot/Historic-OHLCVs/User.Bot.js +++ b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Exchange-Raw-Data-Sensor-Bot/Historic-OHLCVs/User.Bot.js @@ -266,7 +266,7 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI bot.processHeartBeat(heartBeatText, percentage) // tell the world we are alive and doing well if (TS.projects.superalgos.utilities.dateTimeFunctions.areTheseDatesEqual(currentDate, new Date()) === false) { if (noNewInternalLoop !== true) { - logger.newInternalLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, currentDate, percentage); + logger.newInternalLoop(currentDate, percentage); } } } diff --git a/TaskServer/DebugLog.js b/TaskServer/DebugLog.js index 02870a618..11efd7744 100644 --- a/TaskServer/DebugLog.js +++ b/TaskServer/DebugLog.js @@ -14,7 +14,7 @@ exports.newDebugLog = function (processIndex) { let thisObject = { bot: undefined, write: write, - newMainLoop: newMainLoop, + newMainLoop: newMainLoop, newInternalLoop: newInternalLoop, persist: persist, // This method is executed at the end of each Main Loop. initialize: initialize, @@ -48,7 +48,7 @@ exports.newDebugLog = function (processIndex) { return str.length < max ? strPad(fill + str, max) : str; } - function logLoop(pBot, pProcess, date, percentage, loopType) { + function logLoop(date, percentage, loopType) { console.log( new Date().toISOString() + " " + @@ -62,11 +62,11 @@ exports.newDebugLog = function (processIndex) { TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName , 10) + " " + - strPad(TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName, 30) + + strPad(TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName, 20) + " " + - strPad(pBot, 30) + + strPad(TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.config.codeName, 30) + " " + - strPad(pProcess, 30) + + strPad(TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, 30) + loopType + strPad(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).MAIN_LOOP_COUNTER, 8) + " " + @@ -76,11 +76,11 @@ exports.newDebugLog = function (processIndex) { ) } - function newMainLoop(pBot, pProcess, date, percentage) { - logLoop(pBot, pProcess, date, percentage, " Main Loop # ") - } + function newMainLoop() { + logLoop('', '', " Main Loop # ") + } - function newInternalLoop(pBot, pProcess, date, percentage) { + function newInternalLoop(date, percentage) { if (percentage === undefined) { percentage = "" } else { @@ -90,7 +90,7 @@ exports.newDebugLog = function (processIndex) { if (date === undefined) { date = thisObject.bot.processDatetime } date = date.getUTCFullYear() + '-' + strPad(date.getUTCMonth() + 1, 2, "0") + '-' + strPad(date.getUTCDate(), 2, "0"); - logLoop(pBot, pProcess, date, percentage, " Internal Loop # ") + logLoop(date, percentage, " Internal Loop # ") persist(); } diff --git a/TaskServer/IndicatorBot.js b/TaskServer/IndicatorBot.js index 9a65f21e1..22f216d8f 100644 --- a/TaskServer/IndicatorBot.js +++ b/TaskServer/IndicatorBot.js @@ -130,7 +130,7 @@ bot.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution. /* Main Loop Console Logging */ - logger.newMainLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, '', ''); + logger.newMainLoop() /* We will prepare first the infraestructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */ let processExecutionEvents diff --git a/TaskServer/LowFrequencyTrading/TradingProcess.js b/TaskServer/LowFrequencyTrading/TradingProcess.js index a4b8b8143..3a09768b3 100644 --- a/TaskServer/LowFrequencyTrading/TradingProcess.js +++ b/TaskServer/LowFrequencyTrading/TradingProcess.js @@ -721,7 +721,7 @@ thisReport.file.simulationState = bot.simulationState thisReport.file.timeFrames = currentTimeFrameLabel - logger.newInternalLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, tradingProcessDate) + logger.newInternalLoop(tradingProcessDate) await thisReport.asyncSave() } } diff --git a/TaskServer/LowFrequencyTrading/TradingSimulation.js b/TaskServer/LowFrequencyTrading/TradingSimulation.js index ed8fe75cd..a576507dc 100644 --- a/TaskServer/LowFrequencyTrading/TradingSimulation.js +++ b/TaskServer/LowFrequencyTrading/TradingSimulation.js @@ -280,7 +280,7 @@ exports.newTradingSimulation = function (processIndex, bot, logger, tradingEngin /* Logging to console and disk */ if (TS.projects.superalgos.utilities.dateTimeFunctions.areTheseDatesEqual(currentDate, new Date()) === false) { - logger.newInternalLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, currentDate, percentage) + logger.newInternalLoop(currentDate, percentage) } /* Date only hearbeat */ diff --git a/TaskServer/MultiPeriodDaily.js b/TaskServer/MultiPeriodDaily.js index 00874c9a4..bd4e91486 100644 --- a/TaskServer/MultiPeriodDaily.js +++ b/TaskServer/MultiPeriodDaily.js @@ -252,7 +252,7 @@ bot.processHeartBeat(currentDateString, percentage) if (TS.projects.superalgos.utilities.dateTimeFunctions.areTheseDatesEqual(currentDate, new Date()) === false) { - logger.newInternalLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, currentDate, percentage) + logger.newInternalLoop(currentDate, percentage) } checkStopTaskGracefully() } diff --git a/TaskServer/MultiPeriodMarket.js b/TaskServer/MultiPeriodMarket.js index 440947a22..a122a3c46 100644 --- a/TaskServer/MultiPeriodMarket.js +++ b/TaskServer/MultiPeriodMarket.js @@ -203,7 +203,7 @@ thisReport.save(callBack) if (TS.projects.superalgos.utilities.dateTimeFunctions.areTheseDatesEqual(bot.processDatetime, new Date()) === false) { - logger.newInternalLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, bot.processDatetime) + logger.newInternalLoop(bot.processDatetime) } /* Telling the world we are alive and doing well */ diff --git a/TaskServer/ReinforcementLearning/LearningBot.js b/TaskServer/ReinforcementLearning/LearningBot.js index 9b8b906f0..5cd718bde 100644 --- a/TaskServer/ReinforcementLearning/LearningBot.js +++ b/TaskServer/ReinforcementLearning/LearningBot.js @@ -89,7 +89,7 @@ exports.newLearningBot = function (processIndex, bot, parentLogger) { bot.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution. /* Main Loop Console Logging */ - logger.newMainLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, '', ''); + logger.newMainLoop() /* Checking if we need to need to emit any event */ if (bot.SESSION_STATUS === 'Idle' && bot.STOP_SESSION === false) { diff --git a/TaskServer/ReinforcementLearning/LearningProcess.js b/TaskServer/ReinforcementLearning/LearningProcess.js index 7d77e1f43..b6d349b21 100644 --- a/TaskServer/ReinforcementLearning/LearningProcess.js +++ b/TaskServer/ReinforcementLearning/LearningProcess.js @@ -721,7 +721,7 @@ exports.newLearningProcess = function (processIndex, bot, logger, UTILITIES) { thisReport.file.simulationState = bot.simulationState thisReport.file.timeFrames = currentTimeFrameLabel - logger.newInternalLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, LearningProcessDate) + logger.newInternalLoop(LearningProcessDate) await thisReport.asyncSave() } } diff --git a/TaskServer/SensorBot.js b/TaskServer/SensorBot.js index 06f0fb360..8a6e51209 100644 --- a/TaskServer/SensorBot.js +++ b/TaskServer/SensorBot.js @@ -135,7 +135,7 @@ bot.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution. /* Main Loop Console Logging */ - logger.newMainLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, '', ''); + logger.newMainLoop() /* We will prepare first the infraestructure needed for the bot to run. There are 4 modules we need to sucessfullly initialize first. */ let processExecutionEvents diff --git a/TaskServer/TradingBot.js b/TaskServer/TradingBot.js index 1bed39b9f..8e4608dff 100644 --- a/TaskServer/TradingBot.js +++ b/TaskServer/TradingBot.js @@ -89,7 +89,7 @@ bot.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution. /* Main Loop Console Logging */ - logger.newMainLoop(bot.codeName, TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName, '', ''); + logger.newMainLoop() /* Checking if we need to need to emit any event */ if (bot.TRADING_SESSION_STATUS === 'Idle' && bot.STOP_SESSION === false) {