From f71f4f59b577571ada72466a81ff62742abcfd2f Mon Sep 17 00:00:00 2001 From: Matias Benitez Date: Fri, 6 Jul 2018 11:31:02 -0300 Subject: [PATCH] Merging Cloud Content --- Context.js | 29 ++++++++--------------------- Root.js | 2 +- TradingBotProcessMainLoop.js | 4 ++++ 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/Context.js b/Context.js index 08f829955..9fceb3106 100644 --- a/Context.js +++ b/Context.js @@ -6,30 +6,17 @@ /* - This module allows deals with keeping the context between different executions of the bot. - It deals with these 3 different files that helps the bot process remember where it is standing: + This module deals with keeping the context between different executions of the bot. Conceptually this context is divided in 3 main parts: - 1. The Status Report. - 2. The Execution History. - 3. The Execution Context. + I. The non-business information which helps the mechanisms of giving continuety to the bots execution over time. This information goes in a file + called the Status Report, and there is a module, child of this one called Status Report that deals with loading and saving the contents of that file. - */ + II. The business information around the bot execution, including its balance, positions at exchanges, trades executed and many other things. These + are platform data mantained on behalf of the executing bot. All these is kept in one file per execution called the Execution Context. The collection + of all these files can later reconstruct the vital business information the bot had at each moment in time. - - - /* - - Here we will keep the last status report, to be available during the whole process. The Status Report is a file the bot process - reads and saves again after each execution. Its main purpose is to know when the last execution was in order to locate the execution - context. When the bot runs for the first time it takes some vital parameters from there and it checks them through its lifecycle to see - if they changed. The Status Report file can eventually be manipulated by the bot operators / developers in order to change those parameters - or to point the last execution to a different date. Humans are not supose to manipulate the Execution Histroy or the execution Context files. - - The Execution History is basically an index with dates of all the executions the bot did across its history. It allows the bot plotter - to know which datetimes have informacion about the bots execution in order to display it. - - The Execution Context file records all the context information of the bot at the moment of execution and the final state of all of its - positions on the market. + II. Execution of any bot cannot be guaranteed that will be on fixed interval of times. We need an index of all executions that points to the detailed files + with all the business informatino the bot had each time it executed. We call this index the Execution History and there is one file to store it. */ diff --git a/Root.js b/Root.js index cf2dd5839..1fe0135d1 100644 --- a/Root.js +++ b/Root.js @@ -132,7 +132,7 @@ exports.newRoot = function newRoot() { logInfo: true, logWarnings: false, logErrors: true, - logContent: false, + logContent: true, intensiveLogging: false } }; diff --git a/TradingBotProcessMainLoop.js b/TradingBotProcessMainLoop.js index 1e155f837..4dd3897be 100644 --- a/TradingBotProcessMainLoop.js +++ b/TradingBotProcessMainLoop.js @@ -58,6 +58,10 @@ filePath = global.DEV_TEAM + "/" + "members" + "/" + global.USER_LOGGED_IN + "/" + global.CURRENT_BOT_REPO + "/" + pProcessConfig.name; // DevTeam Members bots only are run at the browser. break; } + case "IDE": { + filePath = global.DEV_TEAM + "/" + "bots" + "/" + bot.repo + "/" + pProcessConfig.name; // This works like Cloud except of a few things. + break; + } default: { parentLogger.write(MODULE_NAME, "[ERROR] initialize -> onInizialized -> CURRENT_EXECUTION_AT must be either 'Cloud' or 'Browser'."); parentLogger.write(MODULE_NAME, "[ERROR] initialize -> onInizialized -> global.CURRENT_EXECUTION_AT = " + global.CURRENT_EXECUTION_AT);