From cba90c8a0e7e99513cd3d18eeb2c7a79f26a824a Mon Sep 17 00:00:00 2001 From: Alexandru Stefan Date: Mon, 18 Oct 2021 01:35:32 +0300 Subject: [PATCH 1/3] Log the eval error only if there is an error --- .../Trading-Bot/Low-Frequency-Trading/TradingSystem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Algorithmic-Trading/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSystem.js b/Projects/Algorithmic-Trading/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSystem.js index 4f3d5691a..0f1eba81c 100644 --- a/Projects/Algorithmic-Trading/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSystem.js +++ b/Projects/Algorithmic-Trading/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSystem.js @@ -348,13 +348,13 @@ exports.newAlgorithmicTradingBotModulesTradingSystem = function (processIndex) { } if (errorMessage !== undefined) { tradingSystem.addError([node.id, errorMessage, docs]) + TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[ERROR] evalCondition -> errorMessage = ' + errorMessage) } if (value !== undefined) { tradingSystem.values.push([node.id, value]) } TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] evalCondition -> value = ' + value) - TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] evalCondition -> errorMessage = ' + errorMessage) } function evalFormula(node) { From 35bec1d96ee03307b56c9cfc2261e846e2c4abad Mon Sep 17 00:00:00 2001 From: Alexandru Stefan Date: Mon, 18 Oct 2021 01:37:38 +0300 Subject: [PATCH 2/3] due to changes in Environment file (basePath has been added) the concatenation with dot will break the path while debugging TaskServer --- TaskServer/TaskServer.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/TaskServer/TaskServer.js b/TaskServer/TaskServer.js index 49a1f31d7..c9e327ed6 100644 --- a/TaskServer/TaskServer.js +++ b/TaskServer/TaskServer.js @@ -48,16 +48,6 @@ exports.newTaskServer = function newTaskServer() { } } else { - /* - This process was started not by the Task Manager, but independently - (most likely for debugging purposes). In this case we listen to an event - with the Task Info that should be emitted at the UI, bypassing the Task Manager. - But before that, we need to change the path of these env variables since the home - directory now is TaskServer and not its parent. - */ - global.env.PATH_TO_DATA_STORAGE = '.' + global.env.PATH_TO_DATA_STORAGE - global.env.PATH_TO_PROJECTS = '.' + global.env.PATH_TO_PROJECTS - global.env.PATH_TO_LOG_FILES = '.' + global.env.PATH_TO_LOG_FILES try { TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.listenToEvent('Task Server', 'Debug Task Started', undefined, 'Task Server', undefined, startDebugging) From 5e50d7dd3d61ccbf903cfdc992350e55a557a96e Mon Sep 17 00:00:00 2001 From: Alexandru Stefan Date: Mon, 18 Oct 2021 01:39:43 +0300 Subject: [PATCH 3/3] fixed TaskServer vscode launch file --- TaskServer/.vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskServer/.vscode/launch.json b/TaskServer/.vscode/launch.json index b58818fa9..be9dde86d 100644 --- a/TaskServer/.vscode/launch.json +++ b/TaskServer/.vscode/launch.json @@ -11,7 +11,7 @@ "skipFiles": [ "/**" ], - "program": "/home/algos/SA2/Superalgos/TaskServerRoot.js" + "program": "${workspaceFolder}\\..\\TaskServerRoot.js" } ] } \ No newline at end of file