From 95a2631b3df9e89e079b74140b4572547e82b1c0 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 14 Jan 2021 08:25:43 +0100 Subject: [PATCH 1/3] Hot Fix - Bug that prevents running backtests when ome stages are missing. --- .../Low-Frequency-Trading/TradingStages.js | 60 ++++++++++--------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingStages.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingStages.js index db1f9e32e..b4460fa57 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingStages.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingStages.js @@ -274,18 +274,18 @@ exports.newSuperalgosBotModulesTradingStages = function (processIndex) { } function runWhenStatusIsOpening() { - /* - The system allows the user not to define a Open Stage, because the Open Stage is optional. - Here we are goint to see if that is the case and if it is, we will inmidiatelly consider - the Open Stage as closed. - */ - if (tradingSystem.tradingStrategies[tradingEngine.current.strategy.index.value].openStage === undefined) { - changeStageStatus('Open Stage', 'Closed', 'Open Stage Undefined') - changeStageStatus('Close Stage', 'Opening') - return - } /* Opening Status Procedure */ if (tradingEngine.current.strategyOpenStage.status.value === 'Opening') { + /* + The system allows the user not to define an Open Stage, because the Open Stage is optional. + Here we are going to see if that is the case and if it is, we will inmidiatelly consider + the Open Stage as closed. + */ + if (tradingSystem.tradingStrategies[tradingEngine.current.strategy.index.value].openStage === undefined) { + changeStageStatus('Open Stage', 'Closed', 'Open Stage Undefined') + changeStageStatus('Close Stage', 'Opening') + return + } /* This procedure is intended to run only once */ let tradingSystemStage = tradingSystem.tradingStrategies[tradingEngine.current.strategy.index.value].openStage @@ -399,18 +399,18 @@ exports.newSuperalgosBotModulesTradingStages = function (processIndex) { runWhenStatusIsOpen() function runWhenStatusIsOpening() { - /* - The system allows the user not to define a Manage Stage, because the Manage Stage is optional. - Here we are goint to see if that is the case and if it is, we will inmidiatelly consider - the Manage Stage as closed. - */ - if (tradingSystem.tradingStrategies[tradingEngine.current.strategy.index.value].manageStage === undefined) { - changeStageStatus('Manage Stage', 'Closed', 'Manage Stage Undefined') - changeStageStatus('Close Stage', 'Opening') - return - } /* Opening Status Procedure */ if (tradingEngine.current.strategyManageStage.status.value === 'Opening') { + /* + The system allows the user not to define a Manage Stage, because the Manage Stage is optional. + Here we are goint to see if that is the case and if it is, we will inmidiatelly consider + the Manage Stage as closed. + */ + if (tradingSystem.tradingStrategies[tradingEngine.current.strategy.index.value].manageStage === undefined) { + changeStageStatus('Manage Stage', 'Closed', 'Manage Stage Undefined') + changeStageStatus('Close Stage', 'Opening') + return + } /* Now we switch to the Open status. */ changeStageStatus('Manage Stage', 'Open') @@ -775,17 +775,19 @@ exports.newSuperalgosBotModulesTradingStages = function (processIndex) { await runWhenStatusIsOpen() function runWhenStatusIsOpening() { - /* - The system allows the user not to define a close stage, because the close stage is optional. - Here we are goint to see if that is the case and if it is, we will inmidiatelly consider - the close stage as closed. - */ - if (tradingSystem.tradingStrategies[tradingEngine.current.strategy.index.value].closeStage === undefined) { - changeStageStatus('Close Stage', 'Closed', 'Close Stage Undefined') - return - } + /* Opening Status Procedure */ if (tradingEngine.current.strategyCloseStage.status.value === 'Opening') { + /* + The system allows the user not to define a close stage, because the close stage is optional. + Here we are goint to see if that is the case and if it is, we will inmidiatelly consider + the close stage as closed. + */ + if (tradingSystem.tradingStrategies[tradingEngine.current.strategy.index.value].closeStage === undefined) { + changeStageStatus('Close Stage', 'Closed', 'Close Stage Undefined') + return + } + /* This will happen only once, as soon as the Take Profit or Stop was hit. */ From c5d84cba2ea191cbb08c0df485df15ff410bb8b0 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 14 Jan 2021 11:31:52 +0100 Subject: [PATCH 2/3] Delete debug.log --- debug.log | 1 - 1 file changed, 1 deletion(-) delete mode 100644 debug.log diff --git a/debug.log b/debug.log deleted file mode 100644 index 097051eec..000000000 --- a/debug.log +++ /dev/null @@ -1 +0,0 @@ -[1129/182047.011:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) From b2ea6d463477e819f2d72a4e7b068463615c37d2 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 14 Jan 2021 11:32:17 +0100 Subject: [PATCH 3/3] Update .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b6723d2d5..66684b0c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ Data-Storage Log-Files -My-Workspaces \ No newline at end of file +My-Workspaces +debug.log