Extrema
This chapter covers extrema (i.e. minima and maxima) in Trading Conceiver. In particular, when the pattern is matched and what we mean by asymmetrical extrema.Expand the Patterns Branch
To view the implemented extrema patterns, in the Composer tab select the branch:Patterns
Minima and Maxima
We consider minima and maxima as relative, non strict extrema. We use the low price to determine minima and the high price for maxima.- A minimum occurs when the low price is lower than or equal to the low of its neighbors.
- A maximum occurs when the high price is higher than or equal to the high of its neighbors.
Minimum Maximum │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ radius = 2 │ │ │ k-2 k-1 k k+1 k+2 k-2 k-1 k k+1 k+2 ↑ ↑ ↑ ↑ k-radius k+radius k-radius k+radiusIn formula,
k
is a minimum if:
low(k) ≤ low(i) for all i ∈ [k - radius, k + radius]and is a maximum if:
high(k) ≥ high(i) for all i ∈ [k - radius, k + radius]
Non strict
We now focus on maxima; the same holds true for minima. Note that we accept the fact that the maximum can also be equal to and not necessarily only greater than its neighbors; hence it is not a strict maximum. This is to assure to detect situations where we would expect the pattern to be recognized; e.g.:m m │ │ │ │ │ │ │ │ │ │ │ │ │ │The bars marked with an
m
have equal high price, and they are both considered maxima and matched as such.
Note that, in this way, less intuitive formations are considered maxima:
m m | | | | | | | radius = 2 | | | | | | |Again, both bars marked with
m
are considered maxima.
The Effect of the Radius
By changing the input parameterradius
, different extrema are found. With a greater radius, less points are detected.
In the picture we can see the effect of selecting two different radii for finding maxima:
radius = 1 radius = 3In both cases, the bars highlighted in blue are found. The bars highlighted in yellow are found only with the smaller value. It is apparent that if you want to find prominent extrema, you need to select a big radius. If, on the contrary, you want to detect even small corrections, you need to select a small radius.
The Pattern Is Matched at the Last Bar
As always with pattern matching, the pattern is matched at the very last bar of the pattern, that is where the pattern is complete. It is NOT matched where the extremum is. So it does not indicate where the extrema are. As explained in the previous chapter, in Trading Conceiver the bar when the pattern is matched is labeledn
; this is the last bar of the pattern.
Previous bars in the pattern are labeled n-1, n-2...
This counting highlights the fact that, to match a pattern, you have to look into the past, not into the future,
and you can say a pattern is found only at the very last bar.
With this kind of notation, the previous example looks like this:
Minimum Maximum │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ radius = 2 │ │ │ n-4 n-3 n-2 n-1 n n-4 n-3 n-2 n-1 nThe pattern is matched on day
n
, not n-2
:
When used in the Composer, this trading algorithm will correctly be true on day n
, not n-2
.
If it were true at the extremum bar (n-2
), it would be predictive, as if it could look into the future,
and know from the past that this will be recognized as being an extremum.
You would be trading with foresight and clairvoyance.
You know that n-2
was an extremum only on bar n
, not before.
On bar n-2
you have to wait two more bars in order to know whether that was an extremum.
Example
In this example, we are using the minima algorithm with a radius of 3. The algorithm is true 3 bars after the minimum. The bar labeled 'no' is not a minimum, because its low is not the lowest among the three bars on the left and on the right.Asymmetrical Extrema
With maxima and minima as explained above, in order to find prominent extrema, a radius greater than 1 should be used. The greater the radius, the more prominent the extrema. However, the greater the radius, the more delayed the signal is, because the signal is true only at the last bar of the pattern. If the radius is big, the signal is given after a lot of bars after the extremum and it risks to be too late to be useful. In order to compensate for this, we introduced asymmetrical extrema, where the user can select different radii for the left and the right side of the interval. By selecting a big number for the left radius and a small number for the right radius, a compromise between identifying conspicuous extrema and not waiting too long can be achieved.Example
Let's look at the example pictured here, where the pattern matching for three selections of radii are represented, in the order:[1] radius = 1 (symmetrical) [2] radius = 3 (symmetrical) [3] radius left = 3, radius right = 1 (asymmetrical)Clearly, the occurrences of [1] are more numerous than both of the others. The occurrences of [2] are less numerous than both of the others. The occurrences of [3] are somewhere in between.
The notable maximum
M1
is detected by all three, but in [2] it comes 2 bars later.
The maximum M2
is detected only by [1], not a conspicuous maximum, but definitely useful as a correction.
The maximum M3
is detected only by [1] and [3], but not by [2].
Indeed, its prominence is something in the middle between those of M1
and M2
.