No, the presented approach is not the only one, good results in determining extrema can be obtained using moving averages, but in this case additional algorithms are needed to select and correct the period of the moving average. Also, very good results are obtained by applying the Fourier series decomposition of the funuction.
If we talk about the only correct marking of extrema, then it is necessary to establish the criteria of fidelity. In this case, the presented methodology is one of the simplest, allowing to unambiguously determine all extrema according to the established criteria.
But one of its main advantages is the possibility to take into account the most recent price fluctuations as much as possible.
In the same way as the exponential moving average is in a certain sense better than the usual one, because it takes into account the latest price changes as much as possible, so the presented indicator will be better than traditional tools (for example, ZigZag), because the most recent price value will be the starting point when searching for extrema.
It is possible to find all extrema in one pass when the size of the min. movement is set. Look for the algorithm, it is very old and simple.
It is surprising that articles are written on this subject.
В один же проход можно находить все экстремумы, когда задан размер мин. движения. Поищите алгоритм, он ну очень древний и простой.
Initially the article was planned to be purely theoretical (without code).
Its goal was to popularlypresentthe difficulties arising when searching for extrema, as well as methods of their unambiguous determination,
with the subsequent software implementation of the presented algorithms.
Also the goal of the article was to show an example of using extrema when implementing one rather well-known strategy.
The task of code optimisation was not set.
the goal is to present in a popular way the difficulties arising when searching for extrema, as well as methods of their unambiguous determination,
The task of optimising the code was not set.
It's fine, they just over-optimised it a lot, that's why they saw the difficulties.
There is no need tooptimise thecode, the algorithm is very simple. Look it up, you will understand it at once.
Instead of the specified amplitude between fractals, in my opinion, it is more efficient to use the Highest and Lowest functions.
(set the condition that these levels are fractals). This is a more universal algorithm, as there is no rigid attachment
to the amplitude value between opposite fractals. It is enough to specify that the amplitude is not less than .... points.
New article Automatic detection of extreme points based on specific price changes has been published:
Author: Sergey Strutinskiy
Nice thought!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Auto detection of extreme points based on a specified price variation has been published:
Automation of trading strategies involving graphical patterns requires the ability to search for extreme points on the charts for further processing and interpretation. Existing tools do not always provide such an ability. The algorithms described in the article allow finding all extreme points on charts. The tools discussed here are equally efficient both during trends and flat movements. The obtained results are not strongly affected by a selected timeframe and are only defined by a specified scale.
Fractals are popular tools for finding extreme points. They allow finding the price Highs and Lows for the series of 5 bars (Fig. 1). Extreme points are defined both during strong and weak price movements. If a timeframe is selected correctly, the fractals may show good results, though they are strongly affected by market conditions.
Author: Sergey Strutinskiy