Improved modification of the moving average - indicator RAMA vs SMA

The higher quality of indicator averaging (smoothing) is associated with its higher noise immunity, i.e. with a significant reduction of fast pulsations of the coherent line of the indicator.

RAMA vs. SMA

The technical indicator developed by the author of the article, RAMA (Weighted RAMA), is offered for practical use in trading. moving average) with an averaging (smoothing) period equal to N, and with the averaging weight function W (solid line), which is shown in Figure 1 (the calculation is made with an averaging period N=20 bars).

For comparison, Figure 1 also shows the equal-weighted smoothing function (dashed line) of the classical SMA indicator, also with an averaging period of 20 bars.

Figure 1. Comparison of the RAMA indicator with the SMA
Figure 1. Comparison of the RAMA indicator with the SMA

We can see that the weighting function W has a significantly non-uniform character, the large weights (large W values) at averaging are given to the current values of the quotes. In this case, it is usually concluded that the time delay (introduced lag) of the smoothed line, which is formed by a smoothing indicator RAMA in relation to the initial time series of quotations, is reduced.

The conclusion about the reduction of the insertion time delay (insertion lag) of the indicator RAMA in relation to the insertion time delay (lag) of the indicator SMA is reflected in Figure 2.

The solid line is the smoothed output of the RAMA indicator (20), the dashed line is the smoothed output of the SMA indicator (20). In this example, the averaging period N=20.

Figure 2. Comparison of the RAMA indicator with the SMA at N = 20.
Figure 2. Comparison of the RAMA indicator with the SMA at N = 20.

If the averaging period N for the RAMA indicator increases, and the averaging period for the classic SMA indicator remains unchanged, the delay introduced by the RAMA indicator when the averaging period N increases, will also increase. For the example shown in Figure 2, increase of the averaging period N for the RAMA indicator by 2,5 times, that is up to the value N=50, and the N period for the SMA indicator is equal to 20. The result is shown in Figure 3.

We see that the lines of averaging obtained using the indicators RAMA(50) and SMA(20) in this case coincide, but the quality of the averaging (smoothing) of the indicator RAMA higher than that of the indicator SMA.

Figure 3: Comparison of the RAMA indicator (50) with the SMA (20).
Figure 3: Comparison of the RAMA indicator (50) with the SMA (20).

We can conclude that the use of the RAMA indicator obtains a better quality of smoothing (averaging) than using the classic SMA indicator, if you keep the same value of the introduced time delay (lag value).

Examples of the RAMA indicator

Figures 4-7 show examples of application of RAMA and SMA indicators for smoothing purposes. Values of smoothing periods (N) for the SMA indicator (dotted line) are 9, 26, 100, 200 according to the sequence of Figures 4-7. At the same time the values of the N smoothing periods for the RAMA indicator (solid line) are increased by 2,5 times and are equal to the values N=23, 65, 250, 500 (the number N=23 is obtained by rounding to the greater integer value of the product 9*2,5=22,5).

Figure 4: Comparison of the RAMA indicator (23) with the SMA (9).
Figure 4: Comparison of the RAMA indicator (23) with the SMA (9).
Figure 5. Comparison of the RAMA indicator (26) with the SMA (65).
Figure 5. Comparison of the RAMA indicator (26) with the SMA (65).
Figure 5. Comparison of the RAMA indicator (26) with the SMA (65).
Figure 6. Comparison of the indicator RAMA (100) with the SMA (250).
Figure 5. Comparison of the RAMA indicator (26) with the SMA (65).
Figure 7. Comparison of the indicator RAMA (200) with the SMA (500).

The figures show that the smoothing (averaging) indicator RAMA, offered by the author for practical use, provides a higher quality of averaging (smoothing) compared to the technical indicator SMA. The higher quality of averaging (smoothing) is connected with the higher noise immunity, i.e. a significant reduction of the fast pulsations of the coherent line of the RAMA indicator as compared to the SMA indicator.

Calculation of modified moving average RAMA

The technical indicator RAMA(N) is easy to use, has one adjustable parameter - the averaging period N, as well as the indicator SMA(N).

The calculation of RAMA(N) with the smoothing parameter N is performed according to the expression:

Calculation of the RAMA indicator

Here

  • RAMA(N)t - the current (last) with the current number t the calculated value of the RAMA(N) indicator.
  • W(i) - sequence of weights (values) of the weighting function W (Fig. 1), with i varying from 1 to N, where N is the smoothing parameter of the indicator RAMA(N).
  • P(t-(i-1)) - series of the last values of quotations for smoothing (total N values of quotations), for example, series N last values of close (t-(i-1)).

Calculation of the sequence W(i) of weights (values) of the weighting function W (Fig. 1), with the smoothing parameter N is determined according to the expression:

Calculation of the RAMA indicator,

where

  • at index value i=1, ww(i)=0.2144;
  • at index value i=0.25*N+1, ww(i)=0.3402;
  • for all other values of index i (up to and including N), but excluding the previous two values of index i:

Calculation of the RAMA indicator

For the value of the smoothing (averaging) period N=20, the calculation of W(i) when the index i changes from 1 to 20, is shown in Figure 1.

Obviously, if in the expression for calculating RAMA(N)t put all the values of W(i) =1/Nthen the calculation of the smoothed line of the RAMA(N) indicatort coincides with the calculation of the smoothed line of the SMA(N) indicatort.

You will also be interested in

Комментарии ( 2 )

Leave a Reply

Back to top button