From 367af99cfba1e4fd875143ceb2e86d14cd47d402 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 8 Mar 2019 13:58:05 +0100 Subject: [PATCH] Receiveing extra status information on the file --- Conditions.js | 12 ++++++++++-- ConditionsPanel.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Conditions.js b/Conditions.js index b352eef41..054ce6179 100644 --- a/Conditions.js +++ b/Conditions.js @@ -403,7 +403,11 @@ record.begin = marketFile[1][i][0]; record.end = marketFile[1][i][1]; - record.conditions = marketFile[1][i]; + record.strategyNumber = marketFile[1][i][2]; + record.strategyPhase = marketFile[1][i][3]; + record.stopLossPhase = marketFile[1][i][4]; + record.buyOrderPhase = marketFile[1][i][5]; + record.conditions = marketFile[1][i][6]; if (record.begin >= leftDate.valueOf() && record.end <= rightDate.valueOf()) { @@ -487,7 +491,7 @@ let conditionRecord; - for (let i = 1; i < conditions.length; i++) { // We do not start in 0 because there we have the headers. + for (let i = 0; i < conditions.length; i++) { conditionRecord = conditions[i]; @@ -499,6 +503,10 @@ let currentRecord = { conditionsNames: headers, + strategyNumber: conditionRecord.strategyNumber, + strategyPhase: conditionRecord.strategyPhase, + stopLossPhase: conditionRecord.stopLossPhase, + buyOrderPhase: conditionRecord.buyOrderPhase, conditionsValues: conditionRecord.conditions }; thisObject.container.eventHandler.raiseEvent("Current Condition Record Changed", currentRecord); diff --git a/ConditionsPanel.js b/ConditionsPanel.js index a9481547a..39389a392 100644 --- a/ConditionsPanel.js +++ b/ConditionsPanel.js @@ -86,7 +86,7 @@ function newAAMastersPlottersTradingSimulationConditionsConditionsPanel() { browserCanvasContext.beginPath(); let simulationLogic = currentRecord.conditionsNames; - let conditionIndex = 2; // Jump the first 2 items since they are the .begin and the .end of the record. + let conditionIndex = 0; for (let j = 0; j < simulationLogic.strategies.length; j++) {