|A situation refers to a specific state of the market in which a certain event should take place, as defined by any number of conditions.|
In other words, you define situations in which you wish a certain event to happen (i.e.: trigger on the strategy, take a position, etc.) and each situation is described as a set of conditions that need to be met for the event to be triggered.
A situation gets validated when all conditions under it are true.
An event may have more than one situation attached to it. In such a case, when any of the situations gets validated, the event gets triggered. That is, events may be triggered in different circumstances, meaning that you are free to define different situations upon which the same event would be triggered. In such a case, when any of the situations evaluate true, then the event is triggered.
Click to learn more about situations
Adding a Situation Node
|Conditions are rules within a situation. When all conditions under a situation validate true, then the situation gets validated as well, and the associated event is triggered.|
Therefore, conditions are used to mathematically describe what needs to happen with the market for a certain action to be taken.
chart.at01hs.candle.close > chart.at01hs.bollingerBand.MovingAverage→ This means that the latest candle at the 1 hour chart closed above the Bollinger Bands moving average.
chart.at01hs.candle.previous.max > chart.at01hs.bollingerBand.previous.MovingAverage→ This means that the maximum value of the candle before the last one, was higher than the Bollinger Bands moving average.
In the example above, conditions A and B are comparison statements that may evaluate either true or false. In the case both would evaluate true then Situation 1 would be true as well.
Click to learn more about conditions
Adding a Condition Node
|A formula is a mathematical expression intended to determine a numerical value to be applied dynamically to a certain property.|
In the context of a trading system, formulas are used to determine the values for stopLoss, takeProfit, positionRate, and positionSize.
Formulas may use indicators and internal variables made available by the system. The main difference between writing a formula and writing a condition is that while conditions must evaluate to
false, formulas must evaluate to a number.
positionRate - positionRate * 2.5 / 100→ This formula may be used to define an initial stop target 2.5% below the rate at which the position was taken.
Click to learn more about formulas
Adding a Formula Node
To add a formula, select Add Formula on the corresponding parent node menu.