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 risesShortMA falls
- LongMA fallsShortMA rises
- LongCandle opens above MAShortCandle opens below MA
- LongCandle opens below MAShortCandle opens above MA
- LongCandle opens above MA after opening below itShortCandle opens below MA after opening above it
- LongCandle opens below MA after opening above itShortCandle opens above MA after opening below it
- LongMA turns upShortMA turns down
- LongMA turns downShortMA turns up
Settings
| Settings | Default | Range |
|---|---|---|
| Period | 20 | 2 – 200 |
| MA type | Simple moving average (SMA) | Simple moving average (SMA) / Exponential moving average (EMA) / Smoothed moving average (SMMA) / Linear weighted moving average (LWMA) |
| Price | Close | Close / Opening price / High / Low / Median price / Typical price / Weighted close |
| Shift | 0 | 0 – 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
- Entry · Moving Average (20, SMA, Close): MA rises
- Stop-loss 300 points, take-profit 600 points
- Entry · Moving Average (20, SMA, Close): MA rises
- Entry · ADX (14): ADX is above 25
- Stop-loss 300 points, take-profit 600 points
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.