From d793ddbe6d40fdc66e2878707e9fe8ee21d91b50 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 19 May 2020 12:20:09 +0200 Subject: [PATCH] variable refactoring --- MultiPeriod.js | 12 ++++++------ TradingBot.js | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MultiPeriod.js b/MultiPeriod.js index 217e49077..939d30a50 100644 --- a/MultiPeriod.js +++ b/MultiPeriod.js @@ -86,7 +86,7 @@ let previousDay; // Holds the date of the previous day relative to the processing date. - let interExecutionMemoryArray = []; + let variableArray = []; getContextVariables(); @@ -177,7 +177,7 @@ } contextVariables.lastFile = new Date(thisReport.lastFile); - interExecutionMemoryArray = thisReport.interExecutionMemoryArray; + variableArray = thisReport.variableArray; processSingleFiles(); return; @@ -203,11 +203,11 @@ This data structure has one object per each timeFrame. */ - interExecutionMemoryArray = []; + variableArray = []; for (let i = 0; i < global.dailyFilePeriods.length; i++) { let emptyObject = {}; - interExecutionMemoryArray.push(emptyObject); + variableArray.push(emptyObject); } processSingleFiles(); @@ -942,7 +942,7 @@ currentTimeFrame, currentTimeFrameLabel, bot.multiPeriodProcessDatetime, - interExecutionMemoryArray[n], + variableArray[n], onBotFinished); function onBotFinished(err) { @@ -1135,7 +1135,7 @@ thisReport.file.lastExecution = bot.currentDaytime; thisReport.file.lastFile = lastFileDate; - thisReport.file.interExecutionMemoryArray = interExecutionMemoryArray; + thisReport.file.variableArray = variableArray; thisReport.save(callBack); bot.hasTheBotJustStarted = false; diff --git a/TradingBot.js b/TradingBot.js index 1a2852487..b7e99da99 100644 --- a/TradingBot.js +++ b/TradingBot.js @@ -47,7 +47,7 @@ } } - function start(multiPeriodDataFiles, timeFrame, timeFrameLabel, currentDay, interExecutionMemory, callBackFunction) { + function start(multiPeriodDataFiles, timeFrame, timeFrameLabel, currentDay, variable, callBackFunction) { try { @@ -137,7 +137,7 @@ timeFrame, timeFrameLabel, currentDay, - interExecutionMemory, + variable, exchangeAPI, writeFiles, callBackFunction)