diff --git a/Commons.js b/Commons.js index 9465fa5f7..6b850d879 100644 --- a/Commons.js +++ b/Commons.js @@ -476,7 +476,7 @@ dateForPath = "/" + currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); } - let filePathRoot = contextSummary.dataMine + "/" + contextSummary.bot + "." + contextSummary.botVersion.major + "." + contextSummary.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + contextSummary.dataSetVersion; + let filePathRoot = contextSummary.dataMine + "/" + contextSummary.bot + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + contextSummary.product + "/" + contextSummary.dataset + "/" + timeFrameLabel + dateForPath; filePath += '/' + fileName diff --git a/DataSet.js b/DataSet.js index e803faaeb..5110f2301 100644 --- a/DataSet.js +++ b/DataSet.js @@ -104,7 +104,7 @@ exports.newDataSet = function newDataSet(BOT, logger) { if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] getTextFile -> Entering function."); } - let filePathRoot = dataDependencyNode.dataMine + "/" + dataDependencyNode.bot + "." + dataDependencyNode.botVersion.major + "." + dataDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + dataDependencyNode.dataSetVersion; + let filePathRoot = dataDependencyNode.dataMine + "/" + dataDependencyNode.bot + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + pFolderPath; filePath += '/' + pFileName @@ -146,7 +146,7 @@ exports.newDataSet = function newDataSet(BOT, logger) { return; } - let filePathRoot = dataDependencyNode.dataMine + "/" + dataDependencyNode.bot + "." + dataDependencyNode.botVersion.major + "." + dataDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + dataDependencyNode.dataSetVersion; + let filePathRoot = dataDependencyNode.dataMine + "/" + dataDependencyNode.bot + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + pFolderPath + '/' + pFileName; fileStorage.createTextFile(dataDependencyNode.dataMine, filePath, pFileContent, onFileCreated); diff --git a/Root.js b/Root.js index 1f6344366..68f372a6e 100644 --- a/Root.js +++ b/Root.js @@ -227,7 +227,7 @@ botConfig.loopCounter = 0; /* File Path Root */ - botConfig.filePathRoot = botConfig.dataMine + "/" + botConfig.codeName + "." + botConfig.version.major + "." + botConfig.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + botConfig.exchange + "/" + botConfig.dataSetVersion; + botConfig.filePathRoot = botConfig.dataMine + "/" + botConfig.codeName + "/" + botConfig.exchange; /* Process Key */ botConfig.processKey = global.TASK_NODE.bot.processes[processIndex].name + '-' + global.TASK_NODE.bot.processes[processIndex].type + '-' + global.TASK_NODE.bot.processes[processIndex].id diff --git a/StatusReport.js b/StatusReport.js index 16c680ea1..90de88b4d 100644 --- a/StatusReport.js +++ b/StatusReport.js @@ -155,7 +155,7 @@ let botId = bot.dataMine + "-" + bot.codeName + "-" + bot.version.major + "-" + bot.version.minor + "-" + bot.process + "-" + bot.dataSetVersion; if (ownerId !== botId) { - let rootPath = statusDependencyNode.dataMine + "/" + statusDependencyNode.bot + "." + statusDependencyNode.botVersion.major + "." + statusDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + statusDependencyNode.dataSetVersion; + let rootPath = statusDependencyNode.dataMine + "/" + statusDependencyNode.bot + "/" + bot.exchange; filePath = rootPath + "/Reports/" + sessionPath + statusDependencyNode.process + timePath; } else { filePath = bot.filePathRoot + "/Reports/" + sessionPath + statusDependencyNode.process + timePath; diff --git a/TradingBot.js b/TradingBot.js index 19a14a7e8..357e6bc93 100644 --- a/TradingBot.js +++ b/TradingBot.js @@ -221,7 +221,7 @@ let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; filePath += '/' + fileName @@ -299,7 +299,7 @@ fileContent = "[" + JSON.stringify(tradingSystem) + "," + fileContent + "]"; let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; filePath += '/' + fileName @@ -369,7 +369,7 @@ fileContent = "[" + fileContent + "]"; let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + STRATEGIES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; filePath += '/' + fileName @@ -442,7 +442,7 @@ fileContent = "[" + fileContent + "]"; let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + TRADES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; filePath += '/' + fileName @@ -568,7 +568,7 @@ let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel; filePath += '/' + fileName @@ -675,7 +675,7 @@ let dateForPath = currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; filePath += '/' + fileName @@ -763,7 +763,7 @@ let dateForPath = currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; filePath += '/' + fileName @@ -840,7 +840,7 @@ let dateForPath = currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + STRATEGIES_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; filePath += '/' + fileName @@ -920,7 +920,7 @@ let dateForPath = currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + bot.exchange + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + TRADES_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; filePath += '/' + fileName diff --git a/server.js b/server.js index d0c2e7f0c..49a63094f 100644 --- a/server.js +++ b/server.js @@ -90,10 +90,6 @@ require('dotenv').config(); global.WRITE_LOGS_TO_FILES = process.env.WRITE_LOGS_TO_FILES -/* Default parameters can be changed by the execution configuration */ - -global.CLONE_EXECUTOR = { codeName: 'AACloud', version: '1.1' } // NOTE: To refactor the name of this variable you would need to go through the bots code that are using it. - /* We need to count how many process instances we deployd and how many of them have already finished their job, either because they just finished or because there was a request to stop the proceses. In this way, once we reach the