diff --git a/AppSchema.json b/AppSchema.json index 8df269763..ad225cc22 100644 --- a/AppSchema.json +++ b/AppSchema.json @@ -2774,6 +2774,11 @@ "editors": { "config": true }, + "isTitleAllwaysVisible": true, + "title": [ + "Use Reference Parent Parent Parent", + "Use Reference Parent Parent" + ], "level": 3, "referenceAttachesTo": { "compatibleTypes": "->Status Report->" @@ -3060,6 +3065,10 @@ } ], "isTitleAllwaysVisible": true, + "title": [ + "Use Reference Parent Parent", + "Use Reference Parent" + ], "addLeftIcons": true, "level": 3, "referenceAttachesTo": { diff --git a/CanvasApp/FloatingSpace/FloatingObject.js b/CanvasApp/FloatingSpace/FloatingObject.js index 70dc25f4c..cd4f32a8f 100644 --- a/CanvasApp/FloatingSpace/FloatingObject.js +++ b/CanvasApp/FloatingSpace/FloatingObject.js @@ -321,7 +321,7 @@ function newFloatingObject () { thisObject.payload.distance = distanceToParent - if (distanceToParent > 2000 || thisObject.isPinned === true) { return } // this is introduced to avoid edges cases when importing workspaces. + if (distanceToParent > 3000 || thisObject.isPinned === true) { return } // this is introduced to avoid edges cases when importing workspaces. newPosition = { x: parent.payload.position.x + distanceToParent * Math.cos(toRadians(thisObject.payload.angle)), diff --git a/CanvasApp/FloatingSpace/UiObjectTitle.js b/CanvasApp/FloatingSpace/UiObjectTitle.js index 78d4d66e1..cb723a0b0 100644 --- a/CanvasApp/FloatingSpace/UiObjectTitle.js +++ b/CanvasApp/FloatingSpace/UiObjectTitle.js @@ -136,6 +136,20 @@ function newUiObjectTitle () { } break } + case 'Use Reference Parent Parent Parent': { + let nodeToUse = thisObject.payload.node.payload.referenceParent + if (nodeToUse !== undefined && nodeToUse.payload !== undefined) { + nodeToUse = thisObject.payload.node.payload.referenceParent.payload.parentNode + if (nodeToUse !== undefined && nodeToUse.payload !== undefined) { + nodeToUse = thisObject.payload.node.payload.referenceParent.payload.parentNode.payload.parentNode + if (nodeToUse !== undefined && nodeToUse.payload !== undefined) { + thisObject.payload.title = thisObject.payload.title + separator + nodeToUse.payload.title + thisObject.payload.node.name = thisObject.payload.node.name + separator + nodeToUse.payload.node.name + } + } + } + break + } default: { if (titleReference.indexOf('Use Child @') === 0) { let propertyName = titleReference.substring(titleReference.indexOf('@') + 1, titleReference.length) diff --git a/Legacy-Code/TradingEngines/plotters/Plotters-Trading-Simulation/Conditions.js b/Legacy-Code/TradingEngines/plotters/Plotters-Trading-Simulation/Conditions.js index 9258a7b1e..f65c5d9e6 100644 --- a/Legacy-Code/TradingEngines/plotters/Plotters-Trading-Simulation/Conditions.js +++ b/Legacy-Code/TradingEngines/plotters/Plotters-Trading-Simulation/Conditions.js @@ -935,9 +935,9 @@ if (condition !== undefined) { condition.payload.uiObject.setErrorMessage(situation.conditions[m].error) - if (situation.conditions[m].code !== undefined) { - if (condition.code !== undefined) { - condition.code.payload.uiObject.setErrorMessage(situation.conditions[m].code.error) + if (situation.conditions[m].javascriptCode !== undefined) { + if (condition.javascriptCode !== undefined) { + condition.javascriptCode.payload.uiObject.setErrorMessage(situation.conditions[m].javascriptCode.error) } } diff --git a/TaskServer/TradingSimulation.js b/TaskServer/TradingSimulation.js index 15d0ae74c..59413023f 100644 --- a/TaskServer/TradingSimulation.js +++ b/TaskServer/TradingSimulation.js @@ -658,7 +658,7 @@ let key = j + '-' + 'triggerStage' + '-' + 'triggerOn' + '-' + k + '-' + m; if (condition.javascriptCode !== undefined) { - newCondition(key, condition.javascriptCode); + newCondition(key, condition.javascriptCode, chart); } } } @@ -676,7 +676,7 @@ let key = j + '-' + 'triggerStage' + '-' + 'triggerOff' + '-' + k + '-' + m; if (condition.javascriptCode !== undefined) { - newCondition(key, condition.javascriptCode); + newCondition(key, condition.javascriptCode, chart); } } } @@ -694,7 +694,7 @@ let key = j + '-' + 'triggerStage' + '-' + 'takePosition' + '-' + k + '-' + m; if (condition.javascriptCode !== undefined) { - newCondition(key, condition.javascriptCode); + newCondition(key, condition.javascriptCode, chart); } } } @@ -825,7 +825,7 @@ let key = j + '-' + 'openStage' + '-' + 'initialDefinition' + '-' + 'stopLoss' + '-' + p + '-' + k + '-' + m; if (condition.javascriptCode !== undefined) { - newCondition(key, condition.javascriptCode); + newCondition(key, condition.javascriptCode, chart); } } } @@ -891,7 +891,7 @@ let key = j + '-' + 'openStage' + '-' + 'initialDefinition' + '-' + 'takeProfit' + '-' + p + '-' + k + '-' + m; if (condition.javascriptCode !== undefined) { - newCondition(key, condition.javascriptCode); + newCondition(key, condition.javascriptCode, chart); } } } @@ -967,7 +967,7 @@ let key = j + '-' + 'manageStage' + '-' + 'stopLoss' + '-' + p + '-' + k + '-' + m; if (condition.javascriptCode !== undefined) { - newCondition(key, condition.javascriptCode); + newCondition(key, condition.javascriptCode, chart); } } } @@ -1034,7 +1034,7 @@ let key = j + '-' + 'manageStage' + '-' + 'takeProfit' + '-' + p + '-' + k + '-' + m; if (condition.javascriptCode !== undefined) { - newCondition(key, condition.javascriptCode); + newCondition(key, condition.javascriptCode, chart); } } } @@ -1043,7 +1043,7 @@ } } - function newCondition(key, node) { + function newCondition(key, node, chart) { let condition; let error = '' @@ -1103,6 +1103,14 @@ maximumBalance = bot.VALUES_TO_USE.maximumBalanceB } + if (minimumBalance === undefined) { + minimumBalance = 0 + } + + if (maximumBalance === undefined) { + maximumBalance = 10000000000000000 + } + if (balance > minimumBalance && balance < maximumBalance) { /*