# 3rd Generation Moving Average Indicator

## Indicator for MetaTrader 4

## 3rd Generation Moving AverageMoving Averages based on the Nyquist-Shannon Signal Theorem. Mathematically suggested to have the least possible lag. Less lag than general and second generation averages like Ehler's 'zero-lag' averages. |
Download |

Fig. 1. Comparison of Moving Averages. The 3rd generation average performes best with least lag in comparison to all other averages.

All averages were run with the same window size 21. The data represents 3x60 data points with a Gaussian distribution
around 100 and 200 and a standard deviation of 5 points. Formulas as in Dürschner 2011. EMA implementation based on MetaTrader4 algorithm, 2nd generation uses Ehler (2001) correction,
3rd generation is based on the Nyquist-Shannon theorem as outlined in Dürschner (2011) with lambda of 4.

## Moving Averages of the 3rd Generation

Moving averages are supposed to "smooth" data
and to remove noise and useless information.
Multiple average variants are used widely, for example Simple
Moving Average (SMA) or Exponentially Moving Average (EMA)
(Wikipedia, Moving Averages, 2011). One
challenge is that moving averages introduce a lag, i.e.
the smoothed curve follows the trend usually later (see Fig. 1).
Adaptive moving averages like VIYDA (Chande, 1992; Brown) and Kaufman`s Adaptive Moving Average (KAMA)
(Kaufmann, 1995) tried to address this issue by incorporating
dynamic variables. In 2001, J. Ehler introduced a general
concept based on signal theory which we refer as second
generation averages (Ehler, 2001). Here, the basic
assumption is that the time series is composed from a limited
number of overlapping signal phases which would make signal
theory applicable (Ehler, 2001; Huang, et
al., 1998). In 2011, M. G. Dürschner stated that –under the
signal theory model- the Nyquist-Shannon theorem (Wikipedia,
Nyquist, 2008) must be applied
(Dürschner, 2011). In his work, Dürschner
outlined that averages according to these criteria would have
the least theoretically possible lag and termed them 3rd
generation Moving Averages.

##
Indicator Parameter

Parameter Name |
Default
Value |
Description |

MA_Period | 21 | The window size of the moving average |

MA_Method | 1 (EMA) | SMA (Simple Moving Average) = 0; EMA (Exponetially Moving Average) = 1; SMMA (Smoothed Moving Average) = 2; LWMA (Linear Weighted Moving Average) = 3; |

MA_priceType | 6 (Weighted) | Close = 0; Open = 1; High = 2; Low = 3; Median = 4; Typical = 5; Weighted = 6; |

MA_correction | 2 (3rd Gen.) | 1st Generation, no lag correction =0; 2nd Generation (correction based on Ehler 2001) = 1; 3rd Generation (correction based on Dürschner 2011) = 2; |

Price calculations and basic averages implemented as in MetaTrader 4.

Install instructions can be
found here.

If you have further questions please don't hesitate to contact us.

List of all available downloads

## References

Brown, D. (n.d.). The Variable Moving Average (VMA) aka
Volatility Index Dynamic Average (VIDYA). Retrieved 09 01, 2011,
from
http://etfhq.com/blog/2011/02/22/variable-moving-average-vma-volatility-index-dynamic-average-vidya/

Chande, T. S. (1992, 05). Adapting Moving Averages To Market
Volatility. Technical Analysis of Stocks & Commodities .

Dürschner, M. G. (2011, 04). VTAD Forschungsarbeiten, Award.
Retrieved from Gleitende Durchschnitte 3.0 (Moving Averages
3.0): http://www.vtad.de/node/1441

Ehler, J. F. (2001). Signal Analysis Concepts. Retrieved 09 01,
2011, from
http://www.technicalanalysis.org.uk/moving-averages/Ehle.pdf

Huang, N., Shen, Z., Long, S., Mu, M., Shih, E., Zhang, Q., et
al. (1998). The empirical mode decomposition and the Hilbert
Spectrum for nonlinear and non-stationary time series analysis.
Proceedings of the Royal Society London , pp. A 454: 903 - 905

Kaufmann, P. J. (1995). Kaufman’s Adaptive Moving Average
(KAMA). In P. J. Kaufmann, Smarter Trading. New York:
McGraw-Hill.

Wikipedia. (2008, 08 25). Retrieved from Nyquist–Shannon
sampling theorem:
http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem

Wikipedia. (2011, 08 24). Moving Averages. Retrieved from
http://en.wikipedia.org/wiki/Moving_average