Available translations

Accessing Trading System Definitions and Session Parameters

foundations.png
Summary: The Trading System may access it's own definitions as well as Session Parameters from any Formula or Condition.
Trading System definitions and Trading Session Parameters are accessible from within conditions and formulas, pretty much like conditions and formulas may access the values of indicators, or the Trading Engine hierarchy.
Syntax
To access a trading system definition, follow the path given by the trading system structure. For example, to access a condition in the take position event, use:
 tradingSystem.tradingStrategies[i].triggerStage.takePositionEvent.situations[n].conditions[m].code
To access a trading session parameter, use the syntax starting with sessionParameters followed by the name of the parameter, and the name of the specific parameter in the configuration. For example, to access the taker parameter in the fee structure, use:
 sessionParameters.feeStructure.config.taker
Example
Such a feature may be useful, for instance, to include such definitions or parameters on Telegram announcement messages, as in:
 "The condition with the following code: " + 
tradingSystem.tradingStrategies[tradingEngine.tradingCurrent.strategy.index.value].triggerStage.takePositionEvent.situations[0].conditions[0].code +
" triggered the take position event."
Notice that...
 [tradingEngine.tradingCurrent.strategy.index.value]
... corresponds to the syntax deriving from the trading engine hierarchy.
Previous
Accessing Runtime Data