From 1d7e99426f50159e4801f975575e6c9b0909e6b7 Mon Sep 17 00:00:00 2001 From: Matias Date: Wed, 7 Aug 2019 15:26:26 -0300 Subject: [PATCH 1/3] All indicators sequence --- sequence.json | 145 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 144 insertions(+), 1 deletion(-) diff --git a/sequence.json b/sequence.json index ae710da07..208078dad 100644 --- a/sequence.json +++ b/sequence.json @@ -1,5 +1,112 @@ [ - + { + "devTeam": "AAMasters", + "bot": "AACharly", + "mode": "noTime", + "resumeExecution": true, + "type": "Sensor", + "exchangeName": "Poloniex", + "process": "Live-Trades", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAMasters", + "bot": "AACharly", + "mode": "noTime", + "resumeExecution": true, + "type": "Sensor", + "exchangeName": "Poloniex", + "process": "Hole-Fixing", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, + { + "devTeam": "AAMasters", + "bot": "AABruce", + "mode": "allMonths", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Single-Period-Daily", + "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", @@ -11,5 +118,41 @@ "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 } ] From 34eddf6734581fca236fb74412765c0b2c6535ed Mon Sep 17 00:00:00 2001 From: Matias Date: Wed, 7 Aug 2019 17:42:06 -0300 Subject: [PATCH 2/3] 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 } ] From 9a5183177e71eba047a1eaaede469dc5d98b0893 Mon Sep 17 00:00:00 2001 From: Matias Date: Thu, 8 Aug 2019 07:09:52 -0300 Subject: [PATCH 3/3] Reordering sequence --- Run.js | 4 ++++ sequence.json | 29 +++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/Run.js b/Run.js index 03cc89876..06de091d0 100644 --- a/Run.js +++ b/Run.js @@ -29,6 +29,7 @@ process.on('exit', function (code) { let isRunSequence = false; let sequenceStep = 0; +let loopCount = 0; let processedSteps = new Map() if (process.env.RUN_SEQUENCE !== undefined) { isRunSequence = JSON.parse(process.env.RUN_SEQUENCE) @@ -53,6 +54,8 @@ function sequenceExecution(currentStep) { 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; + execution.dataSet ? process.env.DATA_SET = execution.dataSet : undefined; + process.env.CLONE_ID = 1; execution.timePeriod ? process.env.TIME_PERIOD = execution.timePeriod : undefined; @@ -80,6 +83,7 @@ function onExecutionFinish(result, finishStepKey) { } else { setTimeout(function () { console.log("[INFO] onExecutionFinish -> New round for sequence execution started."); + loopCount++; sequenceStep = 0; processedSteps = new Map(); sequenceExecution(sequenceStep); diff --git a/sequence.json b/sequence.json index 27d5df3d4..3e7206562 100644 --- a/sequence.json +++ b/sequence.json @@ -23,6 +23,19 @@ "endYear": 2021, "month": 1 }, + + { + "devTeam": "AAMasters", + "bot": "AABruce", + "mode": "noTime", + "resumeExecution": true, + "type": "Indicator", + "exchangeName": "Poloniex", + "process": "Single-Period-Daily", + "startYear": 2019, + "endYear": 2021, + "month": 1 + }, { "devTeam": "AAMasters", "bot": "AAOlivia", @@ -155,15 +168,15 @@ "timePeriod": "05-min" }, { - "devTeam": "AAMasters", - "bot": "AABruce", - "mode": "allMonths", + "devTeam": "vikingsalerts", + "bot": "bot-vikingsalerts", + "mode": "live", "resumeExecution": true, - "type": "Indicator", + "type": "Trading", "exchangeName": "Poloniex", - "process": "Single-Period-Daily", - "startYear": 2019, - "endYear": 2021, - "month": 1 + "process": "Trading-Process", + "beginDatetime": "2019-08-01T08:00:00.000Z", + "timePeriod": "05-min", + "dataSet": "Multi-Period-Daily" } ]