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 137b3029b..263a99d63 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 @@ -340,7 +340,7 @@ let dateForPath = previousDay.getUTCFullYear() + '/' + utilities.pad(previousDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(previousDay.getUTCDate(), 2); let fileName = "Data.json" - let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Candles-Volumes" + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Candles-Volumes" + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset let filePath = filePathRoot + "/Output/" + CANDLES_FOLDER_NAME + '/' + "Multi-Period-Daily" + "/" + timeFrame + "/" + dateForPath; filePath += '/' + fileName @@ -379,7 +379,7 @@ let dateForPath = processDate.getUTCFullYear() + '/' + utilities.pad(processDate.getUTCMonth() + 1, 2) + '/' + utilities.pad(processDate.getUTCDate(), 2); let fileName = "Data.json" - let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Candles-Volumes" + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Candles-Volumes" + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset let filePath = filePathRoot + "/Output/" + CANDLES_FOLDER_NAME + '/' + "Multi-Period-Daily" + "/" + timeFrame + "/" + dateForPath; filePath += '/' + fileName 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 005e99a7a..a4a6067f2 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 @@ -111,7 +111,7 @@ let fileName = "Data.json"; - let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Candles-Volumes" + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Candles-Volumes" + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset let filePath = filePathRoot + "/Output/" + CANDLES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrame; filePath += '/' + fileName 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 5d9a23ea5..95fba54ba 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 @@ -316,7 +316,7 @@ Read the candles and volumes from Exchange Raw Data and produce a file for each let dateForPath = contextVariables.lastCandleFile.getUTCFullYear() + '/' + utilities.pad(contextVariables.lastCandleFile.getUTCMonth() + 1, 2) + '/' + utilities.pad(contextVariables.lastCandleFile.getUTCDate(), 2); let fileName = "Data.json" - let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Exchange-Raw-Data" + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Exchange-Raw-Data" + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset let filePath = filePathRoot + "/Output/" + CANDLES_FOLDER_NAME + '/' + CANDLES_ONE_MIN + '/' + dateForPath; filePath += '/' + fileName @@ -443,7 +443,7 @@ Read the candles and volumes from Exchange Raw Data and produce a file for each let dateForPath = contextVariables.lastCandleFile.getUTCFullYear() + '/' + utilities.pad(contextVariables.lastCandleFile.getUTCMonth() + 1, 2) + '/' + utilities.pad(contextVariables.lastCandleFile.getUTCDate(), 2); let fileName = "Data.json" - let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Exchange-Raw-Data" + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Exchange-Raw-Data" + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset let filePath = filePathRoot + "/Output/" + VOLUMES_FOLDER_NAME + '/' + VOLUMES_ONE_MIN + '/' + dateForPath; filePath += '/' + fileName @@ -765,7 +765,7 @@ Read the candles and volumes from Exchange Raw Data and produce a file for each logger.write(MODULE_NAME, "[INFO] start -> writeDataRange -> onFileCreated -> Content written = " + fileContent); } - let key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "-" + bot.codeName + "-" + pProductFolder + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset + let key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "-" + bot.codeName + "-" + pProductFolder + "-" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset let event = { dateRange: dataRange } 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 71875db6c..db87d148e 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 @@ -537,7 +537,7 @@ let dateForPath = contextVariables.lastCandleFile.getUTCFullYear() + '/' + utilities.pad(contextVariables.lastCandleFile.getUTCMonth() + 1, 2) + '/' + utilities.pad(contextVariables.lastCandleFile.getUTCDate(), 2); let fileName = "Data.json" - let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Exchange-Raw-Data" + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Exchange-Raw-Data" + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset let filePath = filePathRoot + "/Output/" + CANDLES_FOLDER_NAME + '/' + CANDLES_ONE_MIN + '/' + dateForPath; filePath += '/' + fileName @@ -669,7 +669,7 @@ let dateForPath = contextVariables.lastCandleFile.getUTCFullYear() + '/' + utilities.pad(contextVariables.lastCandleFile.getUTCMonth() + 1, 2) + '/' + utilities.pad(contextVariables.lastCandleFile.getUTCDate(), 2); let fileName = "Data.json" - let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Exchange-Raw-Data" + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + let filePathRoot = 'Project/' + TS.projects.superalgos.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.type.replace(' ', '-') + "/" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "/" + "Exchange-Raw-Data" + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset let filePath = filePathRoot + "/Output/" + VOLUMES_FOLDER_NAME + '/' + VOLUMES_ONE_MIN + '/' + dateForPath; filePath += '/' + fileName 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 e68b1f38d..8ff73334a 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 @@ -54,31 +54,31 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI statusDependencies = pStatusDependencies; - exchangeId = bot.exchange.toLowerCase().replace(' ', '') + exchangeId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name.toLowerCase().replace(' ', '') /* Applying the parameters defined by the user at the Exchange Node Config */ - if (bot.exchangeNode.config.API !== undefined) { - for (let i = 0; i < bot.exchangeNode.config.API.length; i++) { - if (bot.exchangeNode.config.API[i].method === 'fetch_ohlcv') { - if (bot.exchangeNode.config.API[i].class !== undefined) { - exchangeId = bot.exchangeNode.config.API[i].class + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API !== undefined) { + for (let i = 0; i < TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API.length; i++) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].method === 'fetch_ohlcv') { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].class !== undefined) { + exchangeId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].class } - if (bot.exchangeNode.config.API[i].fetchOHLCVsMethod !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].fetchOHLCVsMethod !== undefined) { options = { - 'fetchOHLCVsMethod': bot.exchangeNode.config.API[i].fetchOHLCVsMethod + 'fetchOHLCVsMethod': TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].fetchOHLCVsMethod } } - if (bot.exchangeNode.config.API[i].firstId !== undefined) { - firstId = bot.exchangeNode.config.API[i].firstId + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].firstId !== undefined) { + firstId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].firstId } - if (bot.exchangeNode.config.API[i].rateLimit !== undefined) { - rateLimit = bot.exchangeNode.config.API[i].rateLimit + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].rateLimit !== undefined) { + rateLimit = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].rateLimit } - if (bot.exchangeNode.config.API[i].hostname !== undefined) { - hostname = bot.exchangeNode.config.API[i].hostname + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].hostname !== undefined) { + hostname = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].hostname } - if (bot.exchangeNode.config.API[i].fetchType !== undefined) { - fetchType = bot.exchangeNode.config.API[i].fetchType + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].fetchType !== undefined) { + fetchType = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].fetchType } } } @@ -259,8 +259,8 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI function heartBeat(noNewInternalLoop) { let processingDate = new Date(since) processingDate = processingDate.getUTCFullYear() + '-' + utilities.pad(processingDate.getUTCMonth() + 1, 2) + '-' + utilities.pad(processingDate.getUTCDate(), 2); - if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getOHLCVs -> Fetching OHLCVs @ " + processingDate + "-> exchange = " + bot.exchange + " -> symbol = " + symbol + " -> since = " + since + " -> limit = " + limit) } - let heartBeatText = "Fetching " + allOHLCVs.length.toFixed(0) + " OHLCVs from " + bot.exchange + " " + symbol + " @ " + processingDate + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getOHLCVs -> Fetching OHLCVs @ " + processingDate + "-> exchange = " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " -> symbol = " + symbol + " -> since = " + since + " -> limit = " + limit) } + let heartBeatText = "Fetching " + allOHLCVs.length.toFixed(0) + " OHLCVs from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate let currentDate = new Date(since) let percentage = TS.projects.superalgos.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate) bot.processHeartBeat(heartBeatText, percentage) // tell the world we are alive and doing well @@ -355,17 +355,17 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI } } catch (err) { if (err.stack.toString().indexOf('ERR_RATE_LIMIT') >= 0) { - logger.write(MODULE_NAME, "[ERROR] start -> getOHLCVs -> Retrying Later -> The Exchange " + bot.exchange + " is saying you are requesting data too often. I will retry the request later, no action is required. To avoid this happening again please increase the rateLimit at the Exchange node config. You might continue seeing this if you are retrieving data from multiple markets at the same time. In this case I tried to get 1 min OHLCVs from " + symbol); + logger.write(MODULE_NAME, "[ERROR] start -> getOHLCVs -> Retrying Later -> The Exchange " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " is saying you are requesting data too often. I will retry the request later, no action is required. To avoid this happening again please increase the rateLimit at the Exchange node config. You might continue seeing this if you are retrieving data from multiple markets at the same time. In this case I tried to get 1 min OHLCVs from " + symbol); return } if (err.stack.toString().indexOf('RequestTimeout') >= 0) { - logger.write(MODULE_NAME, "[ERROR] start -> getOHLCVs -> Retrying Later -> The Exchange " + bot.exchange + " is not responding at the moment. I will save the data already fetched and try to reconnect later to fetch the rest of the missing data."); + logger.write(MODULE_NAME, "[ERROR] start -> getOHLCVs -> Retrying Later -> The Exchange " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " is not responding at the moment. I will save the data already fetched and try to reconnect later to fetch the rest of the missing data."); return } if (err.stack.toString().indexOf('ExchangeNotAvailable') >= 0) { - logger.write(MODULE_NAME, "[ERROR] start -> getOHLCVs -> Retrying Later -> The Exchange " + bot.exchange + " is not available at the moment. I will save the data already fetched and try to reconnect later to fetch the rest of the missing data."); + logger.write(MODULE_NAME, "[ERROR] start -> getOHLCVs -> Retrying Later -> The Exchange " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " is not available at the moment. I will save the data already fetched and try to reconnect later to fetch the rest of the missing data."); return } @@ -447,7 +447,7 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI saveFile(currentDay) if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> saveOHLCVs -> Before Fetch -> Saving OHLCVs @ " + processingDate + " -> i = " + i + " -> total = " + allOHLCVs.length) } - bot.processHeartBeat("Saving " + i.toFixed(0) + " / " + allOHLCVs.length + " OHLCVs from " + bot.exchange + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well + bot.processHeartBeat("Saving " + i.toFixed(0) + " / " + allOHLCVs.length + " OHLCVs from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well /* We exit the loop and we aint comming back*/ return @@ -514,7 +514,7 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI if (heartBeatCounter <= 0) { heartBeatCounter = 1440 if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> saveOHLCVs -> After Fetch -> Saving OHLCVs @ " + processingDate + " -> i = " + i + " -> total = " + allOHLCVs.length) } - bot.processHeartBeat("Saving " + i.toFixed(0) + " / " + allOHLCVs.length + " OHLCVs from " + bot.exchange + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well + bot.processHeartBeat("Saving " + i.toFixed(0) + " / " + allOHLCVs.length + " OHLCVs from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well } /* End Reporting */ diff --git a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Exchange-Raw-Data-Sensor-Bot/Historic-Trades/User.Bot.js b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Exchange-Raw-Data-Sensor-Bot/Historic-Trades/User.Bot.js index 45e1b9efd..6963ca5cf 100644 --- a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Exchange-Raw-Data-Sensor-Bot/Historic-Trades/User.Bot.js +++ b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Exchange-Raw-Data-Sensor-Bot/Historic-Trades/User.Bot.js @@ -49,28 +49,28 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI statusDependencies = pStatusDependencies; - exchangeId = bot.exchange.toLowerCase() + exchangeId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name.toLowerCase() /* Applying the parameters defined by the user at the Exchange node */ - if (bot.exchangeNode.config.API !== undefined) { - for (let i = 0; i < bot.exchangeNode.config.API.length; i++) { - if (bot.exchangeNode.config.API[i].method === 'fetchTrades') { - if (bot.exchangeNode.config.API[i].class !== undefined) { - exchangeId = bot.exchangeNode.config.API[i].class + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API !== undefined) { + for (let i = 0; i < TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API.length; i++) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].method === 'fetchTrades') { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].class !== undefined) { + exchangeId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].class } - if (bot.exchangeNode.config.API[i].fetchType !== undefined) { - fetchType = bot.exchangeNode.config.API[i].fetchType + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].fetchType !== undefined) { + fetchType = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].fetchType } - if (bot.exchangeNode.config.API[i].fetchTradesMethod !== undefined) { + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].fetchTradesMethod !== undefined) { options = { - 'fetchTradesMethod': bot.exchangeNode.config.API[i].fetchTradesMethod + 'fetchTradesMethod': TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].fetchTradesMethod } } - if (bot.exchangeNode.config.API[i].firstId !== undefined) { - firstId = bot.exchangeNode.config.API[i].firstId + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].firstId !== undefined) { + firstId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].firstId } - if (bot.exchangeNode.config.API[i].rateLimit !== undefined) { - rateLimit = bot.exchangeNode.config.API[i].rateLimit + if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].rateLimit !== undefined) { + rateLimit = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API[i].rateLimit } } } @@ -224,8 +224,8 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI /* Reporting we are doing well */ let processingDate = new Date(since) processingDate = processingDate.getUTCFullYear() + '-' + utilities.pad(processingDate.getUTCMonth() + 1, 2) + '-' + utilities.pad(processingDate.getUTCDate(), 2); - if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getTrades -> Fetching Trades @ " + processingDate + "-> exchange = " + bot.exchange + " -> symbol = " + symbol + " -> since = " + since + " -> limit = " + limit ) } - bot.processHeartBeat("Fetching " + allTrades.length.toFixed(0) + " trades from " + bot.exchange + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getTrades -> Fetching Trades @ " + processingDate + "-> exchange = " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " -> symbol = " + symbol + " -> since = " + since + " -> limit = " + limit ) } + bot.processHeartBeat("Fetching " + allTrades.length.toFixed(0) + " trades from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well if (fetchType === "by Id") { params = { @@ -263,8 +263,8 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI lastTradeKey = tradeKey } - if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getTrades -> Fetching Trades @ " + processingDate + "-> exchange = " + bot.exchange + " -> symbol = " + symbol + " -> since = " + since + " -> limit = " + limit) } - bot.processHeartBeat("Fetching " + allTrades.length.toFixed(0) + " trades from " + bot.exchange + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getTrades -> Fetching Trades @ " + processingDate + "-> exchange = " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " -> symbol = " + symbol + " -> since = " + since + " -> limit = " + limit) } + bot.processHeartBeat("Fetching " + allTrades.length.toFixed(0) + " trades from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well } @@ -324,7 +324,7 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI if (heartBeatCounter <= 0) { heartBeatCounter = 1000 if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> saveTrades -> Saving Trades @ " + processingDate + " -> i = " + i + " -> total = " + allTrades.length) } - bot.processHeartBeat("Saving " + i.toFixed(0) + " trades from " + bot.exchange + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well + bot.processHeartBeat("Saving " + i.toFixed(0) + " trades from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well } /* Saving the trades in Files*/ @@ -360,7 +360,7 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI } if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> saveTrades -> Saving Trades @ " + processingDate + " -> i = " + i + " -> total = " + allTrades.length) } - bot.processHeartBeat("Saving " + i.toFixed(0) + " trades from " + bot.exchange + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well + bot.processHeartBeat("Saving " + i.toFixed(0) + " trades from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well return } diff --git a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Webhooks-Sensor-Bot/Check-Webhook/User.Bot.js b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Webhooks-Sensor-Bot/Check-Webhook/User.Bot.js index 892de7ee8..7c30276c1 100644 --- a/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Webhooks-Sensor-Bot/Check-Webhook/User.Bot.js +++ b/Projects/Superalgos/Bots-Plotters-Code/Masters/bots/Webhooks-Sensor-Bot/Check-Webhook/User.Bot.js @@ -101,7 +101,7 @@ exports.newUserBot = function (processIndex, bot, logger, COMMONS, UTILITIES, FI let url = 'http://' + process.env.WEB_SERVER_URL + ':' + process.env.HTTP_INTERFACE_PORT + '/Webhook/Fetch-Messages/' + - bot.exchange + "/" + + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset http.get(url, onResponse); diff --git a/TaskServer/Commons.js b/TaskServer/Commons.js index 10518a35d..0939c8731 100644 --- a/TaskServer/Commons.js +++ b/TaskServer/Commons.js @@ -521,7 +521,7 @@ dateForPath = "/" + currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); } - let filePathRoot = 'Project/' + contextSummary.project + "/" + contextSummary.mineType + "/" + contextSummary.dataMine + "/" + contextSummary.bot + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + 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 + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset let filePath = filePathRoot + "/Output/" + contextSummary.product + "/" + contextSummary.dataset + "/" + timeFrameLabel + dateForPath; filePath += '/' + fileName diff --git a/TaskServer/DataSet.js b/TaskServer/DataSet.js index dc3609fff..1ac348f29 100644 --- a/TaskServer/DataSet.js +++ b/TaskServer/DataSet.js @@ -87,7 +87,7 @@ exports.newDataSet = function (processIndex, BOT, logger) { if (networkNode === undefined) { logger.write(MODULE_NAME, "[WARN] initialize -> Network Node not found.") logger.write(MODULE_NAME, "[WARN] initialize -> Initialization Failed because we could not find where the data of this dataset is located within the network. Check the logs for more info."); - logger.write(MODULE_NAME, "[WARN] initialize -> Could not find where " + datasetProductDefinition.name + " for " + bot.exchange + " " + bot.market.baseAsset + "/" + bot.market.quotedAsset + " is stored within the network."); + logger.write(MODULE_NAME, "[WARN] initialize -> Could not find where " + datasetProductDefinition.name + " for " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + bot.market.baseAsset + "/" + bot.market.quotedAsset + " is stored within the network."); callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE, false); return } @@ -119,7 +119,7 @@ exports.newDataSet = function (processIndex, BOT, logger) { let project = thisObject.node.parentNode.parentNode.parentNode.project let botCodeName = thisObject.node.parentNode.parentNode.config.codeName - let filePathRoot = 'Project/' + project + "/" + mineType + "/" + mine + "/" + botCodeName + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + let filePathRoot = 'Project/' + project + "/" + mineType + "/" + mine + "/" + botCodeName + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset let filePath = filePathRoot + "/Output/" + pFolderPath; filePath += '/' + pFileName @@ -156,7 +156,7 @@ exports.newDataSet = function (processIndex, BOT, logger) { return; } - let filePathRoot = 'Project/' + thisObject.node.project + "/" + thisObject.node.mineType + "/" + thisObject.node.dataMine + "/" + thisObject.node.bot + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + let filePathRoot = 'Project/' + thisObject.node.project + "/" + thisObject.node.mineType + "/" + thisObject.node.dataMine + "/" + thisObject.node.bot + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset let filePath = filePathRoot + "/Output/" + pFolderPath + '/' + pFileName; fileStorage.createTextFile(filePath, pFileContent, onFileCreated); diff --git a/TaskServer/DebugLog.js b/TaskServer/DebugLog.js index b42cb08b8..694387c70 100644 --- a/TaskServer/DebugLog.js +++ b/TaskServer/DebugLog.js @@ -51,8 +51,30 @@ 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"); - console.log(new Date().toISOString() + " " + strPad(thisObject.bot.exchange, 20) + " " + strPad(thisObject.bot.market.baseAsset + '/' + thisObject.bot.market.quotedAsset, 10) + " " + strPad(pBot, 30) + " " + strPad(pProcess, 30) - + " Internal Loop # " + strPad(internalLoopCounter + 1, 8) + " " + strPad(date, 30) + " " + strPad(percentage, 10)) + console.log( + new Date().toISOString() + + " " + + strPad( + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + , 20) + + " " + + strPad( + thisObject.bot.market.baseAsset + + '/' + + thisObject.bot.market.quotedAsset + , 10) + + " " + + strPad(pBot, 30) + + " " + + strPad(pProcess, 30) + + " Internal Loop # " + + strPad(internalLoopCounter + 1, 8) + + " " + + strPad(date, 30) + + " " + + strPad(percentage, 10) + ) + persist(); @@ -165,10 +187,7 @@ exports.newDebugLog = function (processIndex) { let logLine = '\r\n' + message; if (process.env.CONSOLE_LOG === "true" || message.indexOf("ERROR") > 0) { - let key = '' - if (thisObject.bot) { - key = thisObject.TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + '-' + thisObject.bot.codeName + '-' + thisObject.bot.process - } + let key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + '-' + thisObject.bot.codeName + '-' + thisObject.bot.process console.log('*********** ' + message + ' @ ' + key) } diff --git a/TaskServer/IndicatorBot.js b/TaskServer/IndicatorBot.js index c0ac4ddd2..0ee2e9449 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. /* High level log entry */ - console.log(new Date().toISOString() + " " + pad(bot.exchange, 20) + " " + pad(bot.market.baseAsset + '/' + bot.market.quotedAsset, 10) + " " + pad(bot.codeName, 30) + " " + pad(bot.process, 30) + console.log(new Date().toISOString() + " " + pad(TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name, 20) + " " + pad(bot.market.baseAsset + '/' + bot.market.quotedAsset, 10) + " " + pad(bot.codeName, 30) + " " + pad(bot.process, 30) + " Main Loop # " + pad(Number(bot.loopCounter), 8)) /* We will prepare first the infraestructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */ diff --git a/TaskServer/LowFrequencyTrading/ExchangeAPI.js b/TaskServer/LowFrequencyTrading/ExchangeAPI.js index e1802f12e..2c9bceb22 100644 --- a/TaskServer/LowFrequencyTrading/ExchangeAPI.js +++ b/TaskServer/LowFrequencyTrading/ExchangeAPI.js @@ -23,7 +23,7 @@ function initialize() { tradingSystem = bot.simulationState.tradingSystem - exchangeId = bot.exchange.toLowerCase() + exchangeId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name.toLowerCase() let key = bot.KEY let secret = bot.SECRET diff --git a/TaskServer/LowFrequencyTrading/TradingProcess.js b/TaskServer/LowFrequencyTrading/TradingProcess.js index a59cb8abd..e4e7fb37d 100644 --- a/TaskServer/LowFrequencyTrading/TradingProcess.js +++ b/TaskServer/LowFrequencyTrading/TradingProcess.js @@ -664,7 +664,7 @@ /* Raise the event that the Data Range was Updated. */ - let key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "-" + bot.codeName + "-" + productCodeName + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset + let key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "-" + bot.codeName + "-" + productCodeName + "-" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset let event = { dateRange: dataRange } diff --git a/TaskServer/MultiPeriodDaily.js b/TaskServer/MultiPeriodDaily.js index c2a416d42..e7cf8c704 100644 --- a/TaskServer/MultiPeriodDaily.js +++ b/TaskServer/MultiPeriodDaily.js @@ -503,7 +503,7 @@ callBack(err) return } - let key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "-" + bot.codeName + "-" + productCodeName + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset + let key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "-" + bot.codeName + "-" + productCodeName + "-" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset let event = { dateRange: dataRange } diff --git a/TaskServer/ProcessExecutionEvents.js b/TaskServer/ProcessExecutionEvents.js index c71316082..22c21eca6 100644 --- a/TaskServer/ProcessExecutionEvents.js +++ b/TaskServer/ProcessExecutionEvents.js @@ -37,7 +37,7 @@ } let market = bot.market.baseAsset + '/' + bot.market.quotedAsset - currentProcessKey = bot.processNode.referenceParent.name + "-" + bot.processNode.referenceParent.type + "-" + bot.processNode.referenceParent.id + "-" + bot.exchange + "-" + market + currentProcessKey = bot.processNode.referenceParent.name + "-" + bot.processNode.referenceParent.type + "-" + bot.processNode.referenceParent.id + "-" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "-" + market /* A process can depend for its own execution on another process to finish, and @@ -194,7 +194,7 @@ let extraCallerId = '-' + Math.trunc(Math.random() * 10000) + '-' let market = bot.market.baseAsset + '/' + bot.market.quotedAsset - let key = processThisDependsOn.name + "-" + processThisDependsOn.type + "-" + processThisDependsOn.id + "-" + bot.exchange + "-" + market + let key = processThisDependsOn.name + "-" + processThisDependsOn.type + "-" + processThisDependsOn.id + "-" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "-" + market let callerId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "-" + bot.codeName + "-" + bot.process + extraCallerId let subscriptionId diff --git a/TaskServer/ProcessInstance.js b/TaskServer/ProcessInstance.js index e3906806d..f5e4bef09 100644 --- a/TaskServer/ProcessInstance.js +++ b/TaskServer/ProcessInstance.js @@ -41,8 +41,6 @@ botConfig.DELETE_QUEUE_SIZE = 10 // This number represents how many log files can be at the queue at any point in time, which means how many logs are not still deleted. /* Simplifying the access to basic info */ - botConfig.exchange = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name - botConfig.exchangeNode = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode botConfig.market = { baseAsset: TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName, quotedAsset: TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName @@ -64,7 +62,7 @@ "/" + botConfig.codeName + '/' + - botConfig.exchange + + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + botConfig.market.baseAsset + "-" + diff --git a/TaskServer/ProcessOutput.js b/TaskServer/ProcessOutput.js index 66fc94cbf..96196009c 100644 --- a/TaskServer/ProcessOutput.js +++ b/TaskServer/ProcessOutput.js @@ -89,7 +89,7 @@ let product = outputDataset.referenceParent.parentNode.config.codeName let dataset = outputDataset.referenceParent.config.codeName - let key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset + let key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset let event = { lastFile: lastFile, timeFrames: timeFrames @@ -171,7 +171,7 @@ let product = outputDataset.referenceParent.parentNode.config.codeName let dataset = outputDataset.referenceParent.config.codeName - let key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset + let key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset let event = { lastFile: lastFile, timeFrames: timeFrames diff --git a/TaskServer/ReinforcementLearning/LearningBot.js b/TaskServer/ReinforcementLearning/LearningBot.js index 85dfb30d7..140bcabbc 100644 --- a/TaskServer/ReinforcementLearning/LearningBot.js +++ b/TaskServer/ReinforcementLearning/LearningBot.js @@ -89,7 +89,7 @@ exports.newLearningBot = function newLearningBot(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. /* High level log entry */ - console.log(new Date().toISOString() + " " + pad(bot.exchange, 20) + " " + pad(bot.market.baseAsset + '/' + bot.market.quotedAsset, 10) + " " + pad(bot.codeName, 30) + " " + pad(bot.process, 30) + console.log(new Date().toISOString() + " " + pad(TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name, 20) + " " + pad(bot.market.baseAsset + '/' + bot.market.quotedAsset, 10) + " " + pad(bot.codeName, 30) + " " + pad(bot.process, 30) + " Main Loop # " + pad(Number(bot.loopCounter), 8) + " " + bot.processNode.session.type + " " + bot.processNode.session.name) /* Checking if we need to need to emit any event */ diff --git a/TaskServer/ReinforcementLearning/LearningProcess.js b/TaskServer/ReinforcementLearning/LearningProcess.js index 47eb960d5..9cd486b2e 100644 --- a/TaskServer/ReinforcementLearning/LearningProcess.js +++ b/TaskServer/ReinforcementLearning/LearningProcess.js @@ -664,7 +664,7 @@ exports.newLearningProcess = function (processIndex, bot, logger, UTILITIES) { /* Raise the event that the Data Range was Updated. */ - let key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "-" + bot.codeName + "-" + productCodeName + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset + let key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "-" + bot.codeName + "-" + productCodeName + "-" + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset let event = { dateRange: dataRange } diff --git a/TaskServer/SensorBot.js b/TaskServer/SensorBot.js index fe8f84332..5494a1dee 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. /* High level log entry */ - console.log(new Date().toISOString() + " " + pad(bot.exchange, 20) + " " + pad(bot.market.baseAsset + '/' + bot.market.quotedAsset, 10) + " " + pad(bot.codeName, 30) + " " + pad(bot.process, 30) + console.log(new Date().toISOString() + " " + pad(TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name, 20) + " " + pad(bot.market.baseAsset + '/' + bot.market.quotedAsset, 10) + " " + pad(bot.codeName, 30) + " " + pad(bot.process, 30) + " Main Loop # " + pad(Number(bot.loopCounter), 8)) /* We will prepare first the infraestructure needed for the bot to run. There are 4 modules we need to sucessfullly initialize first. */ diff --git a/TaskServer/StatusReport.js b/TaskServer/StatusReport.js index d3ab955d1..83b10333e 100644 --- a/TaskServer/StatusReport.js +++ b/TaskServer/StatusReport.js @@ -258,7 +258,7 @@ if (ownerId !== botId) { - let filePathRoot = 'Project/' + statusDependencyNode.project + "/" + statusDependencyNode.mineType + "/" + statusDependencyNode.dataMine + "/" + statusDependencyNode.bot + '/' + bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + let filePathRoot = 'Project/' + statusDependencyNode.project + "/" + statusDependencyNode.mineType + "/" + statusDependencyNode.dataMine + "/" + statusDependencyNode.bot + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset filePath = filePathRoot + "/Reports/" + sessionPath + statusDependencyNode.process } else { filePath = bot.filePathRoot + "/Reports/" + sessionPath + statusDependencyNode.process diff --git a/TaskServer/TradingBot.js b/TaskServer/TradingBot.js index 364bd82b1..3cc3bf501 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. /* High level log entry */ - console.log(new Date().toISOString() + " " + pad(bot.exchange, 20) + " " + pad(bot.market.baseAsset + '/' + bot.market.quotedAsset, 10) + " " + pad(bot.codeName, 30) + " " + pad(bot.process, 30) + console.log(new Date().toISOString() + " " + pad(TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name, 20) + " " + pad(bot.market.baseAsset + '/' + bot.market.quotedAsset, 10) + " " + pad(bot.codeName, 30) + " " + pad(bot.process, 30) + " Main Loop # " + pad(Number(bot.loopCounter), 8) + " " + bot.processNode.session.type + " " + bot.processNode.session.name) /* Checking if we need to need to emit any event */