Moving Average Zoo Comparator
Every "best moving average" comparison on the internet compares averages that were never actually tested under identical conditions - different periods, different lookback windows, a chart picked because it flatters the author's favourite. This EA removes that excuse: all twenty types read the same close-price array, use the same InpPeriod, and are scored over the same InpLookbackBars window. The twenty types span the familiar (SMA, EMA, WMA, Wilder's SMMA) through statistical alternatives (median, geometric mean, harmonic mean, midpoint) to the cascaded and adaptive families (Hull, DEMA, TEMA, a simplified two-pass T3, zero-lag EMA, Kaufman's KAMA) and weighted-window forms (ALMA, least-squares/LSMA, volume-weighted, sine- weighted, Welch-weighted). Every formula is hand-written from its published definition rather than wrapped around a platform indicator, so the comparison covers exactly the formulas it claims to. Three honest, cheap metrics are computed per type, none of them a backtest or a profit claim: tracking error (mean absolute distance from price - how tightly the line hugs price), whipsaw count (how often price crosses back and forth through the line inside the window - fewer means smoother), and next-bar hit rate (how often the line's slope direction agrees with the sign of the following bar's move - a weak edge-detection proxy, not a trading signal). The ranking is sorted by hit rate, tie-broken on fewer whipsaws, and both the on-chart panel and an optional CSV report show every type's raw numbers, not just the winner. Notes and limitations This is a comparison tool, not a signal generator - a high hit rate here is a description of past behaviour on this exact symbol/timeframe/period, not a forecast. The T3 implementation is a documented simplification (one generalised-DEMA pass applied twice) rather than the original six-EMA cascade, and is labelled as such in the ranking. KAMA uses the classic Kaufman efficiency-ratio formula with fixed fast/ slow constants (2 and 30 bars), not a user-tunable adaptive range. Recalculation cost scales with InpLookbackBars x InpPeriod; very large values on a slow machine may make the on-chart update stutter, though it never blocks trading since this EA sends no orders at all.
Expert advisor · MT5 · v1.0 · Free
About Moving Average Zoo Comparator
Moving Average Zoo Comparator is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Period, Lookback bars and Recalc interval sec. MQL source code included.
Files in the download: MovingAverageZooComparator.ex5, MovingAverageZooComparator.mq5, MovingAverageZooComparator.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Period | 14 | Period used by every average type, for a fair comparison |
| Lookback bars | 300 | Bars included in the scored window |
| Recalc interval sec | 30 | Seconds between recalculations |
| Write report file | true | Write a CSV ranking report to MQL5\Files |
| Report file name | MovingAverageZooComparator_Report.csv |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Moving Average · Alerts · MT5 Expert Advisor · MQL5 Source Code