This indicator has been developed to show the features of cluster filters described in the article "Creating Non-Lagging Digital Filters". It contains a set of tests allowing users to examine behavior of such filters in more details.
All tests are based on Momentum indicator.
Method - Momentum calculation method:
- Relative Momentum - calculation is performed similar to the one described by William Blau. It is set by default.
- Absolute Momentum - calculation is performed similar to the built-in Momentum.
- Price Rate of Change - calculation is performed as in ROC indicator.
All indicator lines are similar to one another differing only by vertical axis scale. All test descriptions are performed for the relative Momentum.
Max bars - number of bars for calculation. The default value is 1 000.
Filter - built-in cluster filter operation mode:
- Off - filter disabled.
- Test No.1 Advance - filter settings for "Advanced smoothing effect" test.
- Test No.2 Smoothing - filter settings for "Non-lagging smoothing" test
- Test No.3 Impulse - settings for examining Momentum's impulse parameter.
Test 1. Advanced Smoothing Effect
Filter parameter should be set to "Test No.1 Advance" mode for the first demonstration.
The cluster filter's settings for the first test allow quite often observe the effect that can be called "advanced" or "outrunning". In this mode, you will not see the smoothing of an entire Momentum's initial line. The filter looks for the areas where there is a chance to receive an outrunning effect. That occurs often enough to be able to notice it.
The first screenshot displays one of the most significant areas of the filter's operation. Please note that this is not a real advanced filtration but only a formal resemblance. This resemblance appears solely because of the present "noise" movements of the non-smoothed Momentum line and not because of the filter actually being ahead of time.
Test 2. Non-Lagging Smoothing
The first test shows that if the initial Momentum line makes an error ("makes noise") against a trend, that leads to the effect of the initial line being overrun by the smoothed one. Obviously, the line can make a mistake in another direction suddenly slipping towards the trend for quite a considerable distance and staying there for quite a long time, though the trend may have reversed already. It would be reasonable for the filter to slow down such movements.
We can see how the algorithm works when filtering such trend-overrunning errors. To do this, set Filter parameter to "Test No.2 Smoothing" when launching the indicator. The cluster filter's operation is divided into two parts during the test.
"GMomentum (Parameter 1, Parameter 2)" short indicator name displayed in the chart subwindow contains two parameters in brackets. If the second parameter is equal to -1, the attempt to fix (reduce) trend-outrunning errors is performed. If the second parameter is equal to or greater than zero, settings for receiving the advanced smoothing are enabled. Use Up and Down keys to change the filter's sensitivity.
The second screenshot shows that despite sharp leaps of price and Momentum's initial line, smoothing of Momentum line is performed without delays. As a result of sufficient smoothing, we obtain suitable entry points.
By the way, flat areas are a great issue for most indicators. But here, some of them are easily reduced to a straight line even with used settings. In fact, this method allows you to improve any of the existing indicators without the need to create additional delay.
Test 3. Examining Impulse Parameters
Examining parameters of Momentum with the built-in filter can turn out to be quite exciting. For example, the impulse parameter can clearly show how and where peaks on the Momentum line disappear when using the settings for the second test. To perform the third test, set Filter parameter to "Test No.3 Impulse". A single impulse is activated at each 1 024th bar. Find this moment on the chart after launching the indicator. It should look as shown in the third screenshot.
The filter is disabled when launching the indicator. Therefore, you will see two peaks at blue and red lines. One of the peaks appears during a single impulse and is equal to it, another one is directed in the opposite direction after the specified number of periods. That is what the impulse parameter of "bare" Momentum looks like. Next, gradually increase or decrease the filter's sensitivity using Up and Down keys.
We can see that the filter gradually but completely "consumes" the second peak leaving the first one absolutely intact. The filter fixes all the consequences of using Momentum recreating the initial picture in details: a single impulse in pure form. There is no lagging, no distortion of the single impulse's amplitude and form. Perhaps, this is an ideal filter, indeed.
Find more information in the article "Creating Non-Lagging Digital Filters".