To access the value of any of the nodes in the trading engine hierarchy from within conditions and formulas, the syntax follows the ramifications of the data structure, exactly as seen in the visual representation of the hierarchy on the design space.
For example, let’s say you wish to access the value of the begin node under strategy open stage. The path to that node, as denoted by the structure of the hierachy below, is:
If you wish to go one step lower and access the value of the target size under the stage quoted asset, then the path is:
Copy Node Path
For ease of use, you may copy the path of any node that holds a valid value directly from within the node’s menu. Simply use the Copy Node Path button.
Let’s say you wish to set a take profit 3% above the initial target rate you defined in the open stage of your strategy.
As explained in the positions page, that value is stored in the entry target rate node under the current position.
So, the formula for the take profit phase is:
tradingEngine.current.position.entryTargetRate.value * 1.03