From 34eddf6734581fca236fb74412765c0b2c6535ed Mon Sep 17 00:00:00 2001 From: Matias Date: Wed, 7 Aug 2019 17:42:06 -0300 Subject: [PATCH] Improving sequence --- MultiPeriodMarket.js | 28 ++--- Run.js | 29 ++--- sequence.json | 251 ++++++++++++++++++++++--------------------- 3 files changed, 160 insertions(+), 148 deletions(-) diff --git a/MultiPeriodMarket.js b/MultiPeriodMarket.js index eadf332f2..2990cbc56 100644 --- a/MultiPeriodMarket.js +++ b/MultiPeriodMarket.js @@ -58,7 +58,7 @@ usertBot.initialize(dataDependencies, callBackFunction); } catch (err) { - logger.write(MODULE_NAME, "[ERROR] initialize -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] initialize -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } @@ -124,7 +124,7 @@ } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoop -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoop -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } @@ -183,7 +183,7 @@ if (err.result !== global.DEFAULT_OK_RESPONSE.result) { - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> err = ", err); callBackFunction(err); return; } @@ -195,20 +195,20 @@ } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoop -> dependencyLoopBody -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoop -> dependencyLoopBody -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } @@ -232,7 +232,7 @@ } } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> dependencyControlLoop -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> dependencyControlLoop -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } @@ -269,19 +269,19 @@ periodsControlLoop(); } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> callTheBot -> onBotFinished -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> callTheBot -> onBotFinished -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } } catch(err){ - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> callTheBot -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> callTheBot -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } @@ -305,14 +305,14 @@ } } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsControlLoop -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsControlLoop -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } @@ -331,14 +331,14 @@ } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> writeStatusReport -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> writeStatusReport -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } } catch (err) { - logger.write(MODULE_NAME, "[ERROR] start -> err = "+ err); + logger.write(MODULE_NAME, "[ERROR] start -> err = ", err); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } diff --git a/Run.js b/Run.js index ec6f96b75..03cc89876 100644 --- a/Run.js +++ b/Run.js @@ -12,7 +12,7 @@ global.CLONE_EXECUTOR = { codeName: 'AACloud', version: '1.1' }; process.on('uncaughtException', function (err) { console.log('[INFO] Run -> uncaughtException -> err.message = ' + err.message); - console.log('[INFO] Run -> uncaughtException -> err.stack = '+ err.stack); + console.log('[INFO] Run -> uncaughtException -> err.stack = ' + err.stack); process.exit(1) }); @@ -43,19 +43,20 @@ if (isRunSequence) { function sequenceExecution(currentStep) { let execution = sequenceList[currentStep]; process.env.STOP_GRACEFULLY = true; - process.env.DEV_TEAM = execution.devTeam; - process.env.BOT = execution.bot; - process.env.START_MODE = execution.mode; - process.env.RESUME_EXECUTION = execution.resumeExecution; - process.env.TYPE = execution.type; - process.env.PROCESS = execution.process; - process.env.MIN_YEAR = execution.startYear; - process.env.MAX_YEAR = execution.endYear; - process.env.MONTH = execution.month; - process.env.BEGIN_DATE_TIME = execution.beginDatetime; - process.env.TIME_PERIOD = execution.timePeriod; + execution.devTeam ? process.env.DEV_TEAM = execution.devTeam : undefined; + execution.bot ? process.env.BOT = execution.bot : undefined; + execution.mode ? process.env.START_MODE = execution.mode : undefined; + execution.resumeExecution ? process.env.RESUME_EXECUTION = execution.resumeExecution : undefined; + execution.type ? process.env.TYPE = execution.type : undefined; + execution.process ? process.env.PROCESS = execution.process : undefined; + execution.startYear ? process.env.MIN_YEAR = execution.startYear : undefined; + execution.endYear ? process.env.MAX_YEAR = execution.endYear : undefined; + execution.month ? process.env.MONTH = execution.month : undefined; + execution.beginDatetime ? process.env.BEGIN_DATE_TIME = execution.beginDatetime : undefined; - global.EXCHANGE_NAME = execution.exchangeName; + execution.timePeriod ? process.env.TIME_PERIOD = execution.timePeriod : undefined; + + execution.exchangeName ? global.EXCHANGE_NAME = execution.exchangeName : undefined; // global.FULL_LOG = execution.fullLog; let stepKey = execution.devTeam + '.' + execution.bot + '.' + execution.process; @@ -180,7 +181,7 @@ function readExecutionConfiguration() { } catch (err) { - console.log("[ERROR] readExecutionConfiguration -> err = "+ err); + console.log("[ERROR] readExecutionConfiguration -> err = " + err); console.log("[ERROR] readExecutionConfiguration -> Please verify that the Start Mode for the type of Bot configured applies to that type."); console.log("[ERROR] readExecutionConfiguration -> err = " + err.stack); } diff --git a/sequence.json b/sequence.json index 208078dad..27d5df3d4 100644 --- a/sequence.json +++ b/sequence.json @@ -23,6 +23,137 @@ "endYear": 2021, "month": 1 }, + { + "devTeam": "AAMasters", + "bot": "AAOlivia", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Daily", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAMasters", + "bot": "AAOlivia", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Market", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAMasters", + "bot": "AATom", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Daily", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAMasters", + "bot": "AATom", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Market", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAMasters", + "bot": "AAChris", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Daily", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAMasters", + "bot": "AAChris", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Market", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAMasters", + "bot": "AAPaula", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Daily", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAMasters", + "bot": "AAPaula", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Market", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAVikings", + "bot": "AAGauss", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Daily", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAVikings", + "bot": "AAGauss", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Market", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "vikingsalerts", + "bot": "simulator-bot-vikingsalerts", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Multi-Period-Daily", + "beginDatetime": "2019-08-01T08:00:00.000Z", + "timePeriod": "05-min" + }, { "devTeam": "AAMasters", "bot": "AABruce", @@ -34,125 +165,5 @@ "startYear": 2019, "endYear": 2021, "month": 1 - }, - { - "devTeam": "AAMasters", - "bot": "AAOlivia", - "mode": "noTime", - "resumeExecution": true, - "type": "Indicator", - "exchangeName": "Poloniex", - "process": "Multi-Period-Daily", - "startYear": 2019, - "endYear": 2021, - "month": 1 - }, - { - "devTeam": "AAMasters", - "bot": "AAOlivia", - "mode": "noTime", - "resumeExecution": true, - "type": "Indicator", - "exchangeName": "Poloniex", - "process": "Multi-Period-Market", - "startYear": 2019, - "endYear": 2021, - "month": 1 - }, - { - "devTeam": "AAMasters", - "bot": "AATom", - "mode": "noTime", - "resumeExecution": true, - "type": "Indicator", - "exchangeName": "Poloniex", - "process": "Multi-Period-Daily", - "startYear": 2019, - "endYear": 2021, - "month": 1 - }, - { - "devTeam": "AAMasters", - "bot": "AATom", - "mode": "noTime", - "resumeExecution": true, - "type": "Indicator", - "exchangeName": "Poloniex", - "process": "Multi-Period-Market", - "startYear": 2019, - "endYear": 2021, - "month": 1 - }, - { - "devTeam": "AAMasters", - "bot": "AAChris", - "mode": "noTime", - "resumeExecution": true, - "type": "Indicator", - "exchangeName": "Poloniex", - "process": "Multi-Period-Daily", - "startYear": 2019, - "endYear": 2021, - "month": 1 - }, - { - "devTeam": "AAMasters", - "bot": "AAChris", - "mode": "noTime", - "resumeExecution": true, - "type": "Indicator", - "exchangeName": "Poloniex", - "process": "Multi-Period-Market", - "startYear": 2019, - "endYear": 2021, - "month": 1 - }, - { - "devTeam": "AAMasters", - "bot": "AAPaula", - "mode": "noTime", - "resumeExecution": true, - "type": "Indicator", - "exchangeName": "Poloniex", - "process": "Multi-Period-Daily", - "startYear": 2019, - "endYear": 2021, - "month": 1 - }, - { - "devTeam": "AAMasters", - "bot": "AAPaula", - "mode": "noTime", - "resumeExecution": true, - "type": "Indicator", - "exchangeName": "Poloniex", - "process": "Multi-Period-Market", - "startYear": 2019, - "endYear": 2021, - "month": 1 - }, - { - "devTeam": "AAVikings", - "bot": "AAGauss", - "mode": "noTime", - "resumeExecution": true, - "type": "Indicator", - "exchangeName": "Poloniex", - "process": "Multi-Period-Daily", - "startYear": 2019, - "endYear": 2021, - "month": 1 - }, - { - "devTeam": "AAVikings", - "bot": "AAGauss", - "mode": "noTime", - "resumeExecution": true, - "type": "Indicator", - "exchangeName": "Poloniex", - "process": "Multi-Period-Market", - "startYear": 2019, - "endYear": 2021, - "month": 1 } ]