Considering first ever bot execution with no status report

This commit is contained in:
Luis Fernando Molina committed 2018-06-23 09:39:24 +02:00
1 parent 24ca28d752
commit 484fc13da6
1 file changed
+17
+17
View File
@@ -165,6 +165,23 @@
statusReportModule = statusDependencies.statusReports.get(key);
thisObject.statusReport = statusReportModule.file;
/*
The first time ever a bot is run, it will not have a status report previously saved. In that case, we need to create the basic structure of it
in order to work.
*/
if (thisObject.statusReport.liveRuns === undefined) {
thisObject.statusReport.liveRuns = [];
}
if (thisObject.statusReport.backtestRuns === undefined) {
thisObject.statusReport.backtestRuns = [];
}
if (thisObject.statusReport.competitionRuns === undefined) {
thisObject.statusReport.competitionRuns = [];
}
if (bot.hasTheBotJustStarted === true) {
createConext(callBack);