From b9e365254611f22614f9b1ad9316b853fac5e573 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 22 May 2020 14:54:42 +0200 Subject: [PATCH] multiple loops should resume --- MultiPeriod.js | 3 ++- TradingSimulation.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/MultiPeriod.js b/MultiPeriod.js index 219357a95..f29d1c0fa 100644 --- a/MultiPeriod.js +++ b/MultiPeriod.js @@ -835,7 +835,8 @@ return; } - botNeverRan = false; + botNeverRan = false + bot.RESUME = true // From here on, all other loops executions must resume from where we left at this current run. if (currentTimeFrame > global.dailyFilePeriods[0][0]) { writeMarketStatusReport(onMarketStatusReport) diff --git a/TradingSimulation.js b/TradingSimulation.js index 5014e1f1a..d55c3db4e 100644 --- a/TradingSimulation.js +++ b/TradingSimulation.js @@ -78,7 +78,7 @@ exports.newTradingSimulation = function newTradingSimulation(bot, logger, UTILIT lastInstantOfTheDay = currentDay.valueOf() + ONE_DAY_IN_MILISECONDS - 1 } - if (variable.isInitialized !== true) { + if (variable.isInitialized !== true || bot.RESUME === false) { variable.isInitialized = true variable.episode = {} // An Episode represents each execution of the Simulation