diff --git a/.vs/AACloud/v15/.suo b/.vs/AACloud/v15/.suo index b8cf5298c..635a925b3 100644 Binary files a/.vs/AACloud/v15/.suo and b/.vs/AACloud/v15/.suo differ diff --git a/Debug Log.js b/Debug Log.js index 6a026938c..827f6b47b 100644 --- a/Debug Log.js +++ b/Debug Log.js @@ -24,23 +24,23 @@ try { - folderPath = '../../Logs'; + folderPath = '../Logs'; createFolderSync(folderPath); - folderPath = '../../Logs/' + thisObject.bot.devTeam; + folderPath = '../Logs/' + thisObject.bot.devTeam; createFolderSync(folderPath); - folderPath = '../../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type; + folderPath = '../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type; createFolderSync(folderPath); - folderPath = '../../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor; + folderPath = '../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor; createFolderSync(folderPath); - folderPath = '../../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor + "/" + thisObject.bot.process; + folderPath = '../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor + "/" + thisObject.bot.process; createFolderSync(folderPath); @@ -81,7 +81,7 @@ function createFolderSync(name) { try { - fileSystem.mkdirSync( './logs/' + name) + fileSystem.mkdirSync( name) } catch (err) { if (err.code !== 'EEXIST') throw err } @@ -96,7 +96,7 @@ try { for (i = 1; i < 1000000; i++) { - filePath = './logs/' + relativePath + i + "." + fileName + '.log'; + filePath = relativePath + i + "." + fileName + '.log'; stats = fileSystem.statSync(filePath); } } @@ -104,14 +104,14 @@ if (i > 1) { - filePath = './logs/' + relativePath + (i - 1) + "." + fileName + '.log'; + filePath = relativePath + (i - 1) + "." + fileName + '.log'; stats = fileSystem.statSync(filePath); const fileSizeInBytes = stats.size; if (fileSizeInBytes > 10240000) { - filePath = './logs/' + relativePath + i + "." + fileName + '.log'; + filePath = relativePath + i + "." + fileName + '.log'; } return filePath; diff --git a/Indicator Bot Main Loop.js b/Indicator Bot Main Loop.js index b86e2e5f4..be85aa5ca 100644 --- a/Indicator Bot Main Loop.js +++ b/Indicator Bot Main Loop.js @@ -7,6 +7,7 @@ const FULL_LOG = true; let USER_BOT_MODULE; + let COMMONS_MODULE; const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log'); const logger = DEBUG_MODULE.newDebugLog(); @@ -30,6 +31,12 @@ USER_BOT_MODULE = require(pBotPath + "/" + pProcessConfig.name + "/" + 'User.Bot'); + try { + COMMONS_MODULE = require(pBotPath + "/" + 'Commons'); + } catch (err) { + // Nothing happens since COMMONS modules are optional. + } + callBackFunction(global.DEFAULT_OK_RESPONSE); } catch (err) { @@ -73,7 +80,7 @@ if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeUserBot -> Entering function."); } - usertBot = USER_BOT_MODULE.newUserBot(bot, UTILITIES, DEBUG_MODULE, FILE_STORAGE, STATUS_REPORT); + usertBot = USER_BOT_MODULE.newUserBot(bot, COMMONS_MODULE, UTILITIES, DEBUG_MODULE, FILE_STORAGE, STATUS_REPORT); usertBot.initialize(undefined, undefined, onInizialized); diff --git a/Project.njsproj b/Project.njsproj index a46d74930..9f1586e98 100644 --- a/Project.njsproj +++ b/Project.njsproj @@ -7,13 +7,13 @@ ShowAllFiles Run.js - C:\Users\Luis\source\repos\AACloudPlatform + C:\Users\Luis\source\repos\AACloud . {3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD} 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) Project - Trading-Process + Multi-Period-Market C:\Program Files\nodejs\node.exe False @@ -51,7 +51,6 @@ - diff --git a/Run.js b/Run.js index 07ca2dc98..07afeb2b7 100644 --- a/Run.js +++ b/Run.js @@ -3,7 +3,7 @@ const FULL_LOG = true; /* The following global variable tells the system if it is running on test mode or production. */ -global.RUNNING_MODE = 'Production'; // 'Testnet' or 'Production' +global.RUNNING_MODE = 'Mixed'; // 'Testnet' or 'Production' /* You do not have funds at the exchange and still want run your bot? No problem activate the exchange simulation mode: */ @@ -88,6 +88,11 @@ global.DEFAULT_RETRY_RESPONSE = { message: "Retry Later" }; +global.CUSTOM_OK_RESPONSE = { + result: "Ok, but check Message", + message: "Custom Message" +}; + global.CUSTOM_FAIL_RESPONSE = { result: "Fail Because", message: "Custom Message" diff --git a/Trading Bot Main Loop.js b/Trading Bot Main Loop.js index cb90e7544..3c6cd52e2 100644 --- a/Trading Bot Main Loop.js +++ b/Trading Bot Main Loop.js @@ -7,6 +7,7 @@ const FULL_LOG = true; let USER_BOT_MODULE; + let COMMONS_MODULE; const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log'); const logger = DEBUG_MODULE.newDebugLog(); @@ -30,6 +31,12 @@ USER_BOT_MODULE = require(pBotPath + "/" + pProcessConfig.name + "/" + 'User.Bot'); + try { + COMMONS_MODULE = require(pBotPath + "/" + 'Commons'); + } catch (err) { + // Nothing happens since COMMONS modules are optional. + } + callBackFunction(global.DEFAULT_OK_RESPONSE); } catch (err) { @@ -215,7 +222,7 @@ if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeUserBot -> Entering function."); } - usertBot = USER_BOT_MODULE.newUserBot(bot, DEBUG_MODULE); + usertBot = USER_BOT_MODULE.newUserBot(bot, DEBUG_MODULE, COMMONS_MODULE); let platform = { datasource: datasource, diff --git a/obj/Debug/Project.njsproj.FileListAbsolute.txt b/obj/Debug/Project.njsproj.FileListAbsolute.txt index 8949330d2..2a5ce536d 100644 --- a/obj/Debug/Project.njsproj.FileListAbsolute.txt +++ b/obj/Debug/Project.njsproj.FileListAbsolute.txt @@ -1,3 +1,6 @@ C:\Users\Luis\source\repos\AACloudPlatform\obj\Debug\Project.njsproj.CoreCompileInputs.cache C:\Users\Luis\source\repos\AACloudPlatform\bin\Microsoft.NodejsTools.WebRole.dll C:\Users\Luis\source\repos\AACloudPlatform\obj\Debug\Project.njsprojResolveAssemblyReference.cache +C:\Users\Luis\source\repos\AACloud\obj\Debug\Project.njsprojResolveAssemblyReference.cache +C:\Users\Luis\source\repos\AACloud\obj\Debug\Project.njsproj.CoreCompileInputs.cache +C:\Users\Luis\source\repos\AACloud\bin\Microsoft.NodejsTools.WebRole.dll diff --git a/this.config.json b/this.config.json index 53b059787..23049ff1b 100644 --- a/this.config.json +++ b/this.config.json @@ -6,7 +6,7 @@ "patch": 0 }, "bot": { - "path": "../Bots/AAMasters/AAMariam-Trading-Bot" + "path": "../Bots/AAMasters/AAOlivia-Indicator-Bot" }, "stopGracefully": "false" } \ No newline at end of file