diff --git a/Commons.js b/Commons.js index 5ad2fb509..8bf6a01da 100644 --- a/Commons.js +++ b/Commons.js @@ -469,14 +469,14 @@ if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> writeFile -> Entering function."); } let market = bot.market; - let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; + let fileName = 'Data.json'; let dateForPath = '' if (processingDailyFiles === true) { dateForPath = "/" + currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); } - let filePathRoot = contextSummary.dataMine + "/" + contextSummary.bot + "/" + bot.exchange; + let filePathRoot = bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + "/" + contextSummary.dataMine + "/" + contextSummary.bot; let filePath = filePathRoot + "/Output/" + contextSummary.product + "/" + contextSummary.dataset + "/" + timeFrameLabel + dateForPath; filePath += '/' + fileName diff --git a/DataSet.js b/DataSet.js index 4ecbbb6b3..ee04b4a21 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 + "/" + bot.exchange; + let filePathRoot = bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + "/" + dataDependencyNode.dataMine + "/" + dataDependencyNode.bot; let filePath = filePathRoot + "/Output/" + pFolderPath; filePath += '/' + pFileName @@ -146,7 +146,7 @@ exports.newDataSet = function newDataSet(BOT, logger) { return; } - let filePathRoot = dataDependencyNode.dataMine + "/" + dataDependencyNode.bot + "/" + bot.exchange; + let filePathRoot = bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + "/" + dataDependencyNode.dataMine + "/" + dataDependencyNode.bot; let filePath = filePathRoot + "/Output/" + pFolderPath + '/' + pFileName; fileStorage.createTextFile(filePath, pFileContent, onFileCreated); diff --git a/MultiPeriod.js b/MultiPeriod.js index 2a801d7c6..d9047fb3f 100644 --- a/MultiPeriod.js +++ b/MultiPeriod.js @@ -312,7 +312,7 @@ if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> processTimeFramesMarketFiles -> periodsLoopBody -> dependencyLoopBody -> getFile -> Entering function."); } - let fileName = market.baseAsset + '_' + market.quotedAsset + ".json"; + let fileName = "Data.json"; if (dependency.dataSet !== "Multi-Period-Market") { @@ -632,7 +632,7 @@ } else { filePath = dependency.product + '/' + dependency.dataSet + "/" + dateForPath; } - let fileName = market.baseAsset + '_' + market.quotedAsset + ".json"; + let fileName = "Data.json"; dataset.getTextFile(filePath, fileName, onFileReceived); @@ -708,7 +708,7 @@ } else { filePath = dependency.product + '/' + dependency.dataSet + "/" + dateForPath; } - let fileName = market.baseAsset + '_' + market.quotedAsset + ".json"; + let fileName = "Data.json"; dataset.getTextFile(filePath, fileName, onFileReceived); @@ -986,7 +986,7 @@ let fileContent = JSON.stringify(dataRange); - let fileName = '/Data.Range.' + market.baseAsset + '_' + market.quotedAsset + '.json'; + let fileName = '/Data.Range.json'; let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + productCodeName + "/" + 'Multi-Period-Daily' + fileName; fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated); diff --git a/MultiPeriodDaily.js b/MultiPeriodDaily.js index 886b3d759..c9e9acc25 100644 --- a/MultiPeriodDaily.js +++ b/MultiPeriodDaily.js @@ -451,7 +451,7 @@ } else { filePath = dependency.product + '/' + dependency.dataSet + "/" + dateForPath; } - let fileName = market.baseAsset + '_' + market.quotedAsset + ".json"; + let fileName = "Data.json"; dataset.getTextFile(filePath, fileName, onFileReceived); @@ -521,7 +521,7 @@ } else { filePath = dependency.product + '/' + dependency.dataSet + "/" + dateForPath; } - let fileName = market.baseAsset + '_' + market.quotedAsset + ".json"; + let fileName = "Data.json"; dataset.getTextFile(filePath, fileName, onFileReceived); @@ -755,7 +755,7 @@ let fileContent = JSON.stringify(dataRange); - let fileName = '/Data.Range.' + market.baseAsset + '_' + market.quotedAsset + '.json'; + let fileName = '/Data.Range.json'; let filePath = bot.filePathRoot + "/Output/" + productCodeName + "/" + bot.process + fileName; fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated); diff --git a/MultiPeriodMarket.js b/MultiPeriodMarket.js index 134c994ca..66cf11951 100644 --- a/MultiPeriodMarket.js +++ b/MultiPeriodMarket.js @@ -173,7 +173,7 @@ if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> processTimeFrames -> periodsLoopBody -> dependencyLoopBody -> getFile -> Entering function."); } let dateForPath = bot.processDatetime.getUTCFullYear() + '/' + utilities.pad(bot.processDatetime.getUTCMonth() + 1, 2) + '/' + utilities.pad(bot.processDatetime.getUTCDate(), 2); - let fileName = market.baseAsset + '_' + market.quotedAsset + ".json"; + let fileName = "Data.json"; let filePath if (dependency.dataSet === "Multi-Period-Market") { diff --git a/Root.js b/Root.js index 1619c0a99..cf7957c2a 100644 --- a/Root.js +++ b/Root.js @@ -225,7 +225,7 @@ botConfig.loopCounter = 0; /* File Path Root */ - botConfig.filePathRoot = botConfig.dataMine + "/" + botConfig.codeName + "/" + botConfig.exchange; + botConfig.filePathRoot = botConfig.exchange + "/" + botConfig.market.baseAsset + "-" + botConfig.market.quotedAsset + "/" + botConfig.dataMine + "/" + botConfig.codeName ; /* 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 3219a6587..4e1eec387 100644 --- a/StatusReport.js +++ b/StatusReport.js @@ -136,14 +136,16 @@ if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] load -> Entering function."); } - let fileName = "Status.Report." + bot.market.baseAsset + '_' + bot.market.quotedAsset + ".json"; + let fileName = "Status.Report.json"; let filePath; let ownerId = statusDependencyNode.dataMine + "-" + statusDependencyNode.bot + "-" + statusDependencyNode.botVersion.major + "-" + statusDependencyNode.botVersion.minor + "-" + statusDependencyNode.process + "-" + statusDependencyNode.dataSetVersion; 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 + "/" + bot.exchange; + + let rootPath = bot.exchange + "/" + bot.market.baseAsset + "-" + bot.market.quotedAsset + "/" + statusDependencyNode.dataMine + "/" + statusDependencyNode.bot + filePath = rootPath + "/Reports/" + sessionPath + statusDependencyNode.process ; } else { filePath = bot.filePathRoot + "/Reports/" + sessionPath + statusDependencyNode.process ; @@ -233,7 +235,7 @@ return; } - let fileName = "Status.Report." + bot.market.baseAsset + '_' + bot.market.quotedAsset + ".json"; + let fileName = "Status.Report.json"; let filePath = bot.filePathRoot + "/Reports/" + sessionPath + statusDependencyNode.process; filePath += '/' + fileName diff --git a/TradingBot.js b/TradingBot.js index 3129df6d7..ee6647948 100644 --- a/TradingBot.js +++ b/TradingBot.js @@ -219,10 +219,8 @@ fileContent = "[" + fileContent + "]"; - let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - - let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; - let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; + let fileName = 'Data.json'; + let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; filePath += '/' + fileName fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated); @@ -297,10 +295,9 @@ fileContent = "[" + fileContent + "]"; fileContent = "[" + JSON.stringify(tradingSystem) + "," + fileContent + "]"; - let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; - let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; + let fileName = 'Data.json'; + let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; filePath += '/' + fileName fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated); @@ -367,10 +364,9 @@ } fileContent = "[" + fileContent + "]"; - let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; - let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + STRATEGIES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; + let fileName = 'Data.json'; + let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + STRATEGIES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; filePath += '/' + fileName fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated); @@ -440,10 +436,9 @@ } fileContent = "[" + fileContent + "]"; - let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; - let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + TRADES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; + let fileName = 'Data.json'; + let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + TRADES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timeFrameLabel; filePath += '/' + fileName fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated); @@ -566,10 +561,8 @@ fileContent = "[" + fileContent + "]"; - let fileName = '' + market.baseAsset + '_' + market.quotedAsset + '.json'; - - let filePathRoot = bot.dataMine + "/" + bot.codeName + "/" + bot.exchange; - let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel; + let fileName = 'Data.json'; + let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel; filePath += '/' + fileName fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated); @@ -673,10 +666,8 @@ fileContent = "[" + fileContent + "]"; 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.exchange; - let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; + let fileName = 'Data.json'; + let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; filePath += '/' + fileName fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated); @@ -761,10 +752,8 @@ fileContent = "[" + JSON.stringify(tradingSystem) + "," + fileContent + "]"; 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.exchange; - let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; + let fileName = 'Data.json'; + let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; filePath += '/' + fileName fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated); @@ -838,10 +827,8 @@ fileContent = "[" + fileContent + "]"; 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.exchange; - let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + STRATEGIES_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; + let fileName = 'Data.json'; + let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + STRATEGIES_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; filePath += '/' + fileName fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated); @@ -918,10 +905,8 @@ fileContent = "[" + fileContent + "]"; 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.exchange; - let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + TRADES_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; + let fileName = 'Data.json'; + let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + TRADES_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timeFrameLabel + "/" + dateForPath; filePath += '/' + fileName fileStorage.createTextFile(filePath, fileContent + '\n', onFileCreated);