Logo Compose your trading system through a user friendly
graphical interface and see when to go long, short or liquidate.

Parentheses

Here we describe the use of parentheses in the Composer of Trading Conceiver.

First we introduce the operator precedence concept. Then we show how to use parentheses in the Composer of Trading Conceiver. Finally, some examples of application are proposed.

Parentheses

Operator Precedence

All logical operators of Trading Conceiver described in the previous chapter, have the same precedence. This means that they are applied in the order they are encountered. In the Composer they are applied from top to bottom. In general, however, you want full control of the order in which they are applied, because by changing the order, the logic is completely different. A simple mathematical example:
  1 + (2 · 3) = 7     (1 + 2) · 3 = 9

Parentheses

You can control the order of expression execution through the use of parentheses. Operators, with their input arguments, in inner parentheses, will be executed first. The process is repeated up the hierarchy, always inner parentheses first. Parentheses can be nested. To activate a parenthesis, click it. To deactivate it, click it again.

Matching Parentheses

Obviously, parentheses must be matched. The same number of left and right parentheses must appear. If not, a warning is shown. You must explicitly click the parentheses buttons to activate or deactivate them. However, in the tabs
  Stop loss
  Take profit 
the behavior is slightly different, to facilitate the user. In these two tabs there are fewer possible combinations, so you need to click only once the desired parenthesis, to select or deselect it, and the matching parenthesis is managed automatically.

Colors

Colors In order to make operators and arguments of parentheses more visible, the background is colored according to the parentheses. You can select the color of inner and outer parentheses by clicking on the corresponding button in the Colors pane.

Examples of Application

Priority
Priority Suppose you are considering 4 algorithms to decide when to go long. One of your algorithms is the
  White Candle
You want to go long only on a white candle, and this is of priority importance for you. Another algorithm you are considering very important is the
  ∆DI positive
You deem the other two of less importance:
  - Stochastic greater
    than threshold
  - MACD Histogram positive 
You don't care about which of the last two is true, it is just enough for one of them to be. But you want the ∆DI positive to be true in any way. In this case you can use the parentheses, and the operators, as shown in the picture. The less important algorithms are enclosed in their own matching parentheses and ORed together. Then you AND the resulting signal with the ∆DI positive output. Finally, you AND such result with the White Candle algorithm. In this particular example the outer parentheses would not be strictly necessary, but it is always a good norm to explicitly select them, and not to rely on operator precedence.
At Least 2
At Least 2 The At least 2 operator, together with its arguments, must always be put between parentheses if another operator appears in the same tab. In the example, you want to enter a long position only on white candles, and when at least 2 of the other algorithms are true.