Forex
Indicator

Indicator: What Is a Moving Average (MA) and How to Use It

Last updated 2026-07-14

Moving Average (MA) is one of the most basic indicators. It calculates the average price over a set number of past candles, making the trend clearer by smoothing out short-term volatility. A 20-period MA on a daily chart, for example, plots the average closing price of the last 20 days at every point — turning a jagged series of candles into a single readable line.

Types of Moving Average

  • SMA (Simple Moving Average) — a plain average, weighting every candle equally. Smoother, slower, better at showing the big picture.
  • EMA (Exponential Moving Average) — weights recent prices more heavily, so it responds to price changes faster than SMA — at the cost of also reacting faster to noise.

Neither is universally better: the EMA turns earlier at real reversals and gets faked out more often. Trend-followers who value stability lean SMA; shorter-term traders who value responsiveness lean EMA.

Choosing the Period

The period controls the trade-off between speed and reliability, and a handful of settings are so widely used that the market itself pays attention to them:

  • 10–20 — short-term direction; hugs price closely.
  • 50 — the classic medium-term trend line.
  • 100–200 — long-term trend. The 200-day MA is probably the most watched single line in all of technical analysis — financial media routinely describe markets as "above" or "below" it.

A longer period means fewer, later, but more meaningful signals; a shorter period means earlier but noisier ones. There is no secret optimal number — consistency matters more than the exact choice.

Using MA to Read the Trend

  • Price staying above the MA line consistently is usually interpreted as an uptrend.
  • Price staying below the MA line consistently is usually interpreted as a downtrend.
  • The slope of the MA adds a second read: a rising MA confirms upward pressure, while a flat MA is the classic signature of a ranging market (see Trend vs Range) — the condition where MA signals stop working.
  • The MA line can also act as a dynamic support/resistance level: in a steady uptrend, pullbacks frequently pause and bounce near a widely watched MA (like the 20 EMA or 50 SMA), giving trend traders a repeatable place to look for entries — ideally confirmed by a candlestick rejection there, just as with a horizontal support level.

The MA Cross Strategy

A popular strategy uses two MA lines with different periods (e.g. 20 and 50) and watches for where they cross.

  • Golden Cross — the short-period MA crosses above the long-period MA, usually interpreted as a bullish signal.
  • Death Cross — the short-period MA crosses below the long-period MA, usually interpreted as a bearish signal.
Golden CrossBUYDeath CrossSELLLong-period MA (slow)Short-period MA (fast)
Entry conditions: BUY on a Golden Cross — SELL on a Death Cross

The logic: the short MA represents recent consensus, the long MA older consensus — a cross means recent price action has changed character relative to the bigger picture. Common pairings are 20/50 for swing trading and 50/200 for the long-term version (the one financial media report on).

MA Cross signals always come later than the actual price move (a lagging indicator) — by the time the lines cross, a chunk of the move has already happened. That's an acceptable price in a long trend, but fatal in a range, where each late signal fires just in time for the next reversal. Two practical filters help:

  1. Only take crosses in the direction of the higher-timeframe trend — e.g. only Golden Crosses on H1 while the daily chart is clearly rising.
  2. Check trend strength first — a cross with ADX above 25 has a real trend behind it; the same cross with ADX below 20 is probably range noise.

Common Mistakes

  • Using MA signals in a flat market — the single biggest one. If the MA is flat and price keeps weaving through it, no MA-based signal is trustworthy.
  • Stacking many MAs of similar periods — five lines saying the same thing isn't confirmation, it's clutter.
  • Constantly re-optimizing the period after every losing streak — the new "best" setting is usually just fitted to the last few weeks of data.

MA crosses should be used alongside price structure or other indicators — for momentum confirmation, MACD is itself built from the gap between two EMAs, making it a natural companion — not as the sole basis for a decision.

Download the Indicator

This custom indicator plots two MA lines on the chart, with automatic alerts when a Golden Cross / Death Cross occurs. It's available for both MetaTrader 4 and MetaTrader 5 below.

How to Install — MetaTrader 4

  1. Download the ma-cross-alert.mq4 file below.
  2. Open MetaTrader 4 → click FileOpen Data Folder.
  3. Place the file in the MQL4/Indicators folder.
  4. Restart MetaTrader 4, then drag the indicator from the Navigator window onto the chart.

How to Install — MetaTrader 5

  1. Download the ma-cross-alert.mq5 file below.
  2. Open MetaTrader 5 → click FileOpen Data Folder.
  3. Place the file in the MQL5/Indicators folder.
  4. Restart MetaTrader 5, then drag the indicator from the Navigator window onto the chart.

Both files are source code — open and review the full code before using it, for your own safety.

Download ma-cross-alert.mq4

For MetaTrader 4 — this is source code (.mq4), open and review it fully before using it.

Download File

Download ma-cross-alert.mq5

For MetaTrader 5 — this is source code (.mq5), open and review it fully before using it.

Download File