Skip to content
72lab

Moving Average EA: no-code builder for MT4 / MT5

TrendA moving average smooths price over a period to show the trend. EAs use it as a filter (long only when the open is above the MA) or enter when it turns.

Rules you can build with it

Works as an entry rule or an exit rule. Short rules are mirrored automatically.

  • LongMA rises
    ShortMA falls
  • LongMA falls
    ShortMA rises
  • LongCandle opens above MA
    ShortCandle opens below MA
  • LongCandle opens below MA
    ShortCandle opens above MA
  • LongCandle opens above MA after opening below it
    ShortCandle opens below MA after opening above it
  • LongCandle opens below MA after opening above it
    ShortCandle opens above MA after opening below it
  • LongMA turns up
    ShortMA turns down
  • LongMA turns down
    ShortMA turns up

Settings

SettingsDefaultRange
Period202 – 200
MA typeSimple moving average (SMA)Simple moving average (SMA) / Exponential moving average (EMA) / Smoothed moving average (SMMA) / Linear weighted moving average (LWMA)
PriceCloseClose / Opening price / High / Low / Median price / Typical price / Weighted close
Shift00 – 10

How the backtest and the EA calculate it

Supports four methods (simple, exponential, smoothed, linear weighted) and seven price types, matching MT5's built-in Moving Average candle by candle; the shift is added to the candle index when values are read.

Signals use only closed candles and are filled at the next candle's open. The exported EA checks conditions in the same order, so you get similar results in the MT5 Strategy Tester.

Example strategies

Example 1
  • Entry · Moving Average (20, SMA, Close): MA rises
  • Stop-loss 300 points, take-profit 600 points
Open in the EA Workshop
Example 2
  • Entry · Moving Average (20, SMA, Close): MA rises
  • Entry · ADX (14): ADX is above 25
  • Stop-loss 300 points, take-profit 600 points
Open in the EA Workshop

Examples are just a starting point: open one to change settings or add filters, then check it with backtests and robustness tests. Backtest results don't indicate future returns.