percentage implemented

This commit is contained in:
Luis Fernando Molina committed 2020-03-19 22:17:04 +01:00
1 parent 0caec98f36
commit 5fc682cf96
2 files changed
+20 -1

No files matched your search

+10 -1
View File
@@ -255,6 +255,8 @@
let n;
processDate = new Date(contextVariables.lastCandleFile.valueOf() - ONE_DAY_IN_MILISECONDS); // Go back one day to start well when we advance time at the begining of the loop.
let fromDate = new Date(processDate.valueOf())
let lastDate = new Date()
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> buildStairs -> processDate = " + processDate); }
advanceTime();
@@ -283,6 +285,11 @@
}
/* Telling the world we are alive and doing well */
let currentDateString = processDate.getUTCFullYear() + '-' + utilities.pad(processDate.getUTCMonth() + 1, 2) + '-' + utilities.pad(processDate.getUTCDate(), 2);
let currentDate = new Date(processDate)
bot.processHeartBeat(currentDateString, global.getPercentage(fromDate, currentDate, lastDate))
periodsLoop();
} catch (err) {
@@ -1620,7 +1627,9 @@
thisReport.file.beginingOfMarket = beginingOfMarket.toUTCString()
thisReport.save(callBack);
logger.newInternalLoop(bot.codeName, bot.process, lastFileDate);
if (global.areEqualDates(lastFileDate, new Date()) === false) {
logger.newInternalLoop(bot.codeName, bot.process, lastFileDate);
}
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> writeStatusReport -> err = " + err.stack);