diff --git a/.vs/AACloud/v15/.suo b/.vs/AACloud/v15/.suo index a77a0e353..0dee02ef0 100644 Binary files a/.vs/AACloud/v15/.suo and b/.vs/AACloud/v15/.suo differ diff --git a/Assistant.js b/Assistant.js index bc57fa469..09f77ba0f 100644 --- a/Assistant.js +++ b/Assistant.js @@ -73,7 +73,7 @@ let timePeriod = "01-min"; let fileName = '' + global.MARKET.assetA + '_' + global.MARKET.assetB + '.json'; - let filePath = bot.filePathRoot + "/Output/" + global.PLATFORM_CONFIG.marketRateProvider.product + "/" + global.PLATFORM_CONFIG.marketRateProvider.dataSet + "/" + timePeriod; + let filePath = global.PLATFORM_CONFIG.marketRateProvider.product + "/" + global.PLATFORM_CONFIG.marketRateProvider.dataSet + "/" + timePeriod; dataSet.getTextFile(filePath, fileName, onFileReceived, true); diff --git a/Data Set.js b/Data Set.js index 00de4af72..fb852199c 100644 --- a/Data Set.js +++ b/Data Set.js @@ -71,7 +71,10 @@ if (FULL_LOG === true) { logger.write("[INFO] getTextFile -> pFolderPath = " + pFolderPath); } if (FULL_LOG === true) { logger.write("[INFO] getTextFile -> pFileName = " + pFileName); } - cloudStorage.getTextFile(pFolderPath, pFileName, onFileReceived); + let filePathRoot = dependencyConfig.devTeam + "/" + dependencyConfig.bot + "." + dependencyConfig.botVersion.major + "." + dependencyConfig.botVersion.minor + "/" + global.PLATFORM_CONFIG.codeName + "." + global.PLATFORM_CONFIG.version.major + "." + global.PLATFORM_CONFIG.version.minor + "/" + global.EXCHANGE_NAME + "/" + dependencyConfig.dataSetVersion; + let filePath = filePathRoot + "/Output/" + pFolderPath; + + cloudStorage.getTextFile(filePath, pFileName, onFileReceived); function onFileReceived(err, text) { @@ -109,7 +112,10 @@ return; } - cloudStorage.createTextFile(pFolderPath, pFileName, pFileContent, onFileCreated); + let filePathRoot = dependencyConfig.devTeam + "/" + dependencyConfig.bot + "." + dependencyConfig.botVersion.major + "." + dependencyConfig.botVersion.minor + "/" + global.PLATFORM_CONFIG.codeName + "." + global.PLATFORM_CONFIG.version.major + "." + global.PLATFORM_CONFIG.version.minor + "/" + global.EXCHANGE_NAME + "/" + dependencyConfig.dataSetVersion; + let filePath = filePathRoot + "/Output/" + pFolderPath; + + cloudStorage.createTextFile(filePath, pFileName, pFileContent, onFileCreated); function onFileCreated(err) { diff --git a/Extraction Bot Process Main Loop.js b/Extraction Bot Process Main Loop.js index bc05f9e1c..f9b03944e 100644 --- a/Extraction Bot Process Main Loop.js +++ b/Extraction Bot Process Main Loop.js @@ -109,6 +109,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -140,6 +147,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> initializeUserBot -> onInizialized > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> initializeUserBot -> onInizialized > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -213,6 +227,13 @@ } } } + default: { + logger.write("[ERROR] run -> loop -> startUserBot -> onFinished > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> startUserBot -> onFinished > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } diff --git a/Indicator Bot Process Main Loop.js b/Indicator Bot Process Main Loop.js index d67faa7e8..28fc84534 100644 --- a/Indicator Bot Process Main Loop.js +++ b/Indicator Bot Process Main Loop.js @@ -109,6 +109,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -140,6 +147,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> initializeUserBot -> onInizialized > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> initializeUserBot -> onInizialized > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -213,6 +227,13 @@ } } } + default: { + logger.write("[ERROR] run -> loop -> startUserBot -> onFinished > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> startUserBot -> onFinished > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } diff --git a/Run.js b/Run.js index f04147d0d..cf3c5e684 100644 --- a/Run.js +++ b/Run.js @@ -128,9 +128,8 @@ function pad(str, max) { return str.length < max ? pad("0" + str, max) : str; } -/* Some LAGACY code starts here. Pending for clean up. */ +/* Process Loops Declarations. */ -const INTERVAL_EXECUTOR_MODULE = require('./Interval Executor'); const TRADING_BOT_MAIN_LOOP_MODULE = require('./Trading Bot Process Main Loop'); const INDICATOR_BOT_MAIN_LOOP_MODULE = require('./Indicator Bot Process Main Loop'); const EXTRACTION_BOT_MAIN_LOOP_MODULE = require('./Extraction Bot Process Main Loop'); @@ -428,11 +427,8 @@ for (let p = 0; p < global.PLATFORM_CONFIG.executionList.length; p++) { function whenRunFinishes(err) { let botId; - if (pYear !== undefined) { - botId = pBotConfig.devTeam + "." + pBotConfig.codeName + "." + pBotConfig.process + "." + pYear + "." + pMonth; - } else { - botId = pBotConfig.devTeam + "." + pBotConfig.codeName + "." + pBotConfig.process; - } + + botId = pBotConfig.devTeam + "." + pBotConfig.codeName + "." + pBotConfig.process; if (err.result === global.DEFAULT_OK_RESPONSE.result) { diff --git a/Trading Bot Process Main Loop.js b/Trading Bot Process Main Loop.js index 8ebfba91f..e7fabb498 100644 --- a/Trading Bot Process Main Loop.js +++ b/Trading Bot Process Main Loop.js @@ -119,6 +119,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -150,6 +157,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> initializeDataDependencies -> onInizialized > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> initializeDataDependencies -> onInizialized > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -180,6 +194,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> initializeContext -> onInizialized > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> initializeContext -> onInizialized > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -210,6 +231,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> initializeExchangeAPI -> onInizialized > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> initializeExchangeAPI -> onInizialized > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -240,6 +268,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> initializeAssistant -> onInizialized > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> initializeAssistant -> onInizialized > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -271,6 +306,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> initializeUserBot -> onInizialized > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> initializeUserBot -> onInizialized > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -300,6 +342,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> startUserBot -> onFinished > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> startUserBot -> onFinished > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } @@ -329,6 +378,13 @@ callBackFunction(err); return; } + default: { + logger.write("[ERROR] run -> loop -> saveContext -> onFinished > Unhandled err.result received. -> err.result = " + err.result); + logger.write("[ERROR] run -> loop -> saveContext -> onFinished > Unhandled err.result received. -> err.message = " + err.message); + + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } } } } diff --git a/this.config.json b/this.config.json index c96f6c4ec..74522385e 100644 --- a/this.config.json +++ b/this.config.json @@ -7,7 +7,7 @@ }, "executionList": [ { - "enabled": "false", + "enabled": "true", "botPath": "../Bots/AAMasters/AAMariam-Trading-Bot", "process": "Trading-Process" }, @@ -37,7 +37,7 @@ "process": "Poloniex-Live-Trades" }, { - "enabled": "true", + "enabled": "false", "botPath": "../Bots/AAMasters/AAMiguel-Indicator-Bot", "process": "Trades-Files-To-Blobs" }