Moving Average
The Moving Average is the bedrock of technical analysis: it averages the last N closes into one line that filters noise and reveals the true direction of the trend.
What it is
A Moving Average (MA) averages the last N closing prices and draws the result as a continuous line. By averaging out short-term noise it shows the underlying trend direction. MA itself is not a signal generator — it is the raw material of many other tools: MACD, Bollinger Bands and Envelopes are all built on it, and traders use it to define trend direction, dynamic support/resistance, and crossover entries.
Origin
The moving average is one of the oldest tools in technical analysis, mainstreamed through mid-20th-century charting. Computation standardized in the 1980s–90s into four methods — Simple (SMA), Exponential (EMA), Smoothed (SMMA) and Linear-Weighted (LWMA) — all four still shipped in MT5's parameter panel. EMA, balancing responsiveness and smoothness, is the modern default choice.
Download Camovia Tray free — check quotes, manage positions, and hide in one click from your system tray.
Download FreeThe formula
How the four MT5 methods differ:
At the same period, EMA and LWMA react faster and turn sooner; SMA is the slowest but steadiest; SMMA is the smoothest. There is no "best" — intraday favors EMA, long-term trend-following often uses SMA. The key is not switching mid-stream.
Worked example
Why the whole world watches the 200-day MA:
- On a daily chart, MA200 is the average close of the last 200 trading days — roughly the "average holding cost" of the past year.
- Price above MA200 means buyers over the past year are, on average, in profit — a long-term optimistic regime.
- Price below MA200 means that cohort is, on average, losing — long-term sentiment has turned defensive.
That is why "bull/bear line" became folklore: MA200 has no magic in its math — it matters because everyone watches it, and because everyone watches it, it works (self-fulfilling).
How to read it
Classic MA readings (using common daily periods):
| Range | Common interpretation |
|---|---|
| Price > MA, MA rising | Uptrend; pullbacks to the MA are read as trend entries (dynamic support) |
| Price < MA, MA falling | Downtrend; rallies into the MA often stall (dynamic resistance) |
| MA50 crosses above MA200 | The "Golden Cross" — a long-term bullish signal |
| MA50 crosses below MA200 | The "Death Cross" — a long-term bearish signal |
| Short/medium/long MAs stacked in order | A clean "bullish/bearish stack" — a healthy, orderly trend |
The entire value of moving averages rests on one premise: a trend exists. In ranges the MAs knot together and every cross is noise — if you cannot identify a trend, switch MA signals off.
Common signals & usage
Golden / Death Cross
A short MA crossing a longer MA. The 50/200 pair is the most famous long-term signal, but confirm with volume and price location — if price has already run far from the averages, the cross arrives late.
Pullback to the MA
A first pullback into MA20/MA50 that stabilizes on shrinking volume is a higher-probability trend entry; each subsequent test of the same MA tends to be weaker.
Bullish / Bearish stack
MA5 > MA20 > MA60 rising in order = bullish stack (hold with the trend); mirror for bearish. While the stack holds, fighting it is low-probability.
The squeeze before the break
Several MAs converging = a coiled decision zone. A breakout with volume confirmation often produces a clean run — MAs double as a "spring coiling" ruler.
Limitations & common mistakes
- Failure in ranges is the cardinal sin: MA value comes entirely from trends; in chop, crosses are random numbers. Judge the regime first.
- Lag is unavoidable: an average of the past N bars is always half a step behind. "By the time the signal fires, half the move is done" is normal — treat MA as confirmation, not prediction.
- Do not numerology the parameters: 5/10/20/60/120/200 all have fans; the digits themselves have no magic (Fibonacci included). What matters is matching the period to your holding time.
- A single MA is a weak signal: one line's support/resistance read is too thin — pair it with a second MA or price structure (prior swing highs/lows).
- Over-optimization trap: tuning parameters to make backtests pretty is meaningless — the future does not replay history. Keep parameters simple.
MA in MT5
MA is a built-in MT5 trend indicator and can use any of the four methods. The MQL5 function for programmatic use is iMA:
| MQL5 function | iMA() |
| Four methods (ma_method) | SMA / EMA / SMMA / LWMA |
| MT5 default period | 10 (practitioners commonly use 20 / 50 / 200) |
| Default applied price | PRICE_CLOSE |
| Display window | Main chart overlay (shares the price window) |
The ma_shift parameter slides the whole line left/right, often used to align signals to a specific bar. iMA selects the algorithm via the ma_method enum (MODE_SMA/MODE_EMA/MODE_SMMA/MODE_LWMA) — one function, four methods.
Behavior across timeframes
15-minute
MA5/MA20 give the intraday rhythm, but noise is heavy — use with the trend only
1-hour / 4-hour
The MA20/MA50 pair is the most common swing-trading "double MA" structure
Daily
MA50/MA200 crosses and the bull/bear line are the classics; annual-line signals get global attention
Weekly
MA30 (about half a year) serves as a long-cycle trend filter — weekly MA direction rarely flips
Indicator combinations
Common pairings for MA:
- With MACD: a long MA sets the macro direction; MACD times momentum restarts in that direction only — trend filter plus momentum timing. MACD
- With RSI: in a bullish stack, wait for RSI to dip into the 40–50 zone and recover at an MA support for entries. RSI
- With Bollinger Bands: the BB middle band is an SMA20 — MA direction plus channel squeeze/stretch is a natural pair. BOLL
Symbols commonly watched with MA
Symbol pages that list this indicator as a common tool:
FAQ
Q What is the difference between SMA and EMA?
SMA weights every bar in the window equally — slower but steadier. EMA weights recent prices by α=2/(N+1) — faster and earlier to turn. Intraday traders usually prefer EMA; long-term trend followers often prefer SMA. Neither is universally better — match the method to your timeframe.
Q Why is the 200-day MA so important?
The daily MA200 approximates the average cost of the past year and is the most widely watched long-term bull/bear line. It matters not because the math is special but because so many people watch it — the signal is self-fulfilling.
Q How do I choose MA periods?
Start from your holding period, then pick: 5/20 for intraday (15-minute charts), 20/50 for swing (1H/4H), 50/200 for position (daily). Do not tune parameters to make backtests pretty — their job is to match your holding time.
Q Are golden/death crosses reliable?
Quite reliable in trending markets (especially the long-period crosses) and completely unreliable in ranges, where every cross is noise. Confirm a trend exists first (ADX or price structure) and take crosses only with the trend.
Q How do I add and configure MA in MT5?
Menu: Insert → Indicators → Trend → Moving Average, or drag it from the Navigator. The dialog offers the four methods (SMA/EMA/SMMA/LWMA), period, shift and applied price. Stack several MAs of different periods to build combos.
Turn MT5 / MT4 into a Tray Tool
Check quotes, manage positions, and hide in one click.
Download Camovia TrayThis page is educational content about a technical indicator. It is not investment advice. Indicator signals can and do fail — always combine them with your own risk management.