diff --git a/.vs/AACloud/v15/.suo b/.vs/AACloud/v15/.suo index 1cb233468..58e375e05 100644 Binary files a/.vs/AACloud/v15/.suo and b/.vs/AACloud/v15/.suo differ diff --git a/Assistant.js b/Assistant.js index 7d7081b63..1bb495387 100644 --- a/Assistant.js +++ b/Assistant.js @@ -63,7 +63,7 @@ any reason stops being updated. */ - if (candle.begin < global.processDatetime.valueOf() - 2 * 60 * 1000) { + if (candle.begin < bot.processDatetime.valueOf() - 2 * 60 * 1000) { logger.write("[ERROR] initialize -> Candles more than two minutes old. Retrying later."); callBack(global.DEFAULT_RETRY_RESPONSE); @@ -632,7 +632,7 @@ rate: pRate, amountA: pAmountA, amountB: pAmountB, - date: (global.processDatetime.valueOf()), + date: (bot.processDatetime.valueOf()), status: "open", trades: [] }; @@ -724,7 +724,7 @@ rate: pNewRate, amountA: pPosition.amountB * pNewRate, amountB: pPosition.amountB, - date: (global.processDatetime.valueOf()), + date: (bot.processDatetime.valueOf()), status: "open", trades: [] }; diff --git a/Context.js b/Context.js index c8eefe7a6..14b13d575 100644 --- a/Context.js +++ b/Context.js @@ -103,7 +103,7 @@ if (err.result === global.DEFAULT_OK_RESPONSE.result) { - thisObject.newHistoryRecord.date = global.processDatetime; + thisObject.newHistoryRecord.date = bot.processDatetime; getStatusReport(onDone); @@ -398,7 +398,7 @@ if (FULL_LOG === true) { logger.write("[INFO] saveThemAll -> writeExecutionContext -> Entering function."); } let fileName = "Execution.Context.json" - let dateForPath = global.processDatetime.getUTCFullYear() + '/' + utilities.pad(global.processDatetime.getUTCMonth() + 1, 2) + '/' + utilities.pad(global.processDatetime.getUTCDate(), 2) + '/' + utilities.pad(global.processDatetime.getUTCHours(), 2) + '/' + utilities.pad(global.processDatetime.getUTCMinutes(), 2); + let dateForPath = bot.processDatetime.getUTCFullYear() + '/' + utilities.pad(bot.processDatetime.getUTCMonth() + 1, 2) + '/' + utilities.pad(bot.processDatetime.getUTCDate(), 2) + '/' + utilities.pad(bot.processDatetime.getUTCHours(), 2) + '/' + utilities.pad(bot.processDatetime.getUTCMinutes(), 2); let filePath = bot.filePathRoot + "/Output/" + bot.process + '/' + dateForPath; if (FULL_LOG === true) { logger.write("[INFO] saveThemAll -> writeExecutionContext -> fileName = " + fileName); } @@ -534,7 +534,7 @@ if (FULL_LOG === true) { logger.write("[INFO] saveThemAll -> writeStatusReport -> Entering function."); } - statusReportModule.file.lastExecution = global.processDatetime; + statusReportModule.file.lastExecution = bot.processDatetime; statusReportModule.save(callBack); } diff --git a/Datasource.js b/Datasource.js index e602b5dfa..54c6993c7 100644 --- a/Datasource.js +++ b/Datasource.js @@ -178,7 +178,7 @@ let periodTime = global.dailyFilePeriods[i][0]; let periodName = global.dailyFilePeriods[i][1]; - getFile(oliviaAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Output/Candles/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, global.processDatetime, onFileReceived, callBack); + getFile(oliviaAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Output/Candles/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, bot.processDatetime, onFileReceived, callBack); function onFileReceived(err, file) { @@ -253,7 +253,7 @@ let timePeriod = candle.end - candle.begin + 1; // In miliseconds. (remember each candle spans a period minus one milisecond) - if (candle.begin >= global.processDatetime.valueOf() - timePeriod * 10 && candle.begin <= global.processDatetime.valueOf()) { + if (candle.begin >= bot.processDatetime.valueOf() - timePeriod * 10 && candle.begin <= bot.processDatetime.valueOf()) { candlesArray.push(candle); @@ -357,7 +357,7 @@ let periodTime = global.dailyFilePeriods[i][0]; let periodName = global.dailyFilePeriods[i][1]; - getFile(tomAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Tom/dataSet.V1/Output/Candle-Stairs/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, global.processDatetime, onFileReceived, callBack); + getFile(tomAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Tom/dataSet.V1/Output/Candle-Stairs/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, bot.processDatetime, onFileReceived, callBack); function onFileReceived(err, file) { @@ -436,7 +436,7 @@ stairs.lastMin = pStairsFile[i][10]; stairs.lastMax = pStairsFile[i][11]; - if (global.processDatetime.valueOf() >= stairs.begin && global.processDatetime.valueOf() <= stairs.end) { + if (bot.processDatetime.valueOf() >= stairs.begin && bot.processDatetime.valueOf() <= stairs.end) { thisObject.stairsMap.set(pPeriodName, stairs); diff --git a/Extraction Bot Main Loop.js b/Extraction Bot Main Loop.js index f6c2c15d1..8fce769a2 100644 --- a/Extraction Bot Main Loop.js +++ b/Extraction Bot Main Loop.js @@ -71,7 +71,7 @@ /* We define the datetime for the process that we are running now. This will be the official processing time for both the infraestructure and the bot. */ - global.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution. + bot.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution. /* We will prepare first the infraestructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */ diff --git a/Indicator Bot Main Loop.js b/Indicator Bot Main Loop.js index 484fcd81d..09042037c 100644 --- a/Indicator Bot Main Loop.js +++ b/Indicator Bot Main Loop.js @@ -70,7 +70,7 @@ /* We define the datetime for the process that we are running now. This will be the official processing time for both the infraestructure and the bot. */ - global.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution. + bot.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution. /* We will prepare first the infraestructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */ diff --git a/Trading Bot Main Loop.js b/Trading Bot Main Loop.js index acb803908..5404743f6 100644 --- a/Trading Bot Main Loop.js +++ b/Trading Bot Main Loop.js @@ -75,8 +75,7 @@ /* We define the datetime for the process that we are running now. This will be the official processing time for both the infraestructure and the bot. */ - global.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution. - global.processDatetime = new Date(global.processDatetime.valueOf() - 30 * 24 * 60 * 60 * 1000); // we go 30 days back in time since candles are currently not up to date. + bot.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution. /* We will prepare first the infraestructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */