⚠ Trading involves significant risk of loss. Everything on this site is for education only and is not financial advice.
Lesson 6 of 10 · Free

Moving Averages in Depth

Calculate simple and exponential moving averages and understand crossovers, dynamic support and lag.

Author: Moustafa HijaziContent reviewed: 2026-10-303 min readSelf-study course

What you will learn

  • How to calculate a simple moving average step by step.
  • How an exponential moving average gives more weight to recent prices.
  • Why crossovers are late and when they are useful.
  • How to use a moving average as dynamic support or resistance.

Explanation

A moving average (MA) is the average of the last N closing prices, recalculated every candle. It smooths noise and shows the general direction.

SMA

The simple moving average (SMA) gives every close the same weight: SMA = (sum of the last N closes) ÷ N. When a new candle closes, the oldest close drops out.

EMA

The exponential moving average (EMA) gives more weight to recent closes. It uses a multiplier k = 2 ÷ (N + 1). The formula is: EMA today = close today × k + EMA yesterday × (1 − k). The first EMA value is usually started (seeded) with an SMA.

Lag

Every moving average uses past data, so it always reacts after price. This delay is called lag. Longer periods lag more. The EMA lags less than the SMA of the same length, but it also reacts more to noise.

Crossovers

A crossover happens when a faster MA crosses a slower MA, for example the 50-period crossing the 200-period. Because both lines lag, the crossover often comes after a large part of the move. In ranges, MAs cross back and forth and give many false signals. Crossovers work better as a filter (for example "only look for longs while the 50 is above the 200") than as entry signals.

Dynamic support

In a clean trend, price often pulls back toward a moving average and continues. Traders then call the MA dynamic support (in an uptrend) or dynamic resistance (in a downtrend). Treat it as an area, not an exact line, and combine it with structure and zones.

Worked example

Hypothetical example: daily closes of a share in €: day 1 €20, day 2 €21, day 3 €22, day 4 €21, day 5 €23. We calculate a 5-period SMA and EMA.

  1. Sum of 5 closes: 20 + 21 + 22 + 21 + 23 = €107
  2. SMA on day 5: €107 ÷ 5 = €21.40
  3. Day 6 closes at €24. The oldest close (€20) drops out: €107 − €20 + €24 = €111
  4. SMA on day 6: €111 ÷ 5 = €22.20

Now the EMA, seeded with the day-5 SMA of €21.40:

  1. Multiplier: k = 2 ÷ (5 + 1) = 0.3333
  2. EMA on day 6: €24 × 0.3333 + €21.40 × 0.6667 ≈ €8.00 + €14.27 = €22.27

The EMA (€22.27) moved slightly more toward the new close of €24 than the SMA (€22.20). In this tiny example the difference is small; with real data and sharp moves it can be larger. Both values are still below €24: this is lag.

Common mistake

Searching for the "best" periodTesting 9, 13, 21, 34, 50 and more until one looks perfect on past charts is curve-fitting (see lesson 10). Choose one or two common periods, keep them fixed and learn how price behaves around them.

Practice activity

Hypothetical closes in $: 10, 12, 14, 13. Calculate the 3-period SMA on day 3 and day 4. Then calculate the 3-period EMA on day 4, seeded with the day-3 SMA.

Show solution

Day 3 SMA: (10 + 12 + 14) ÷ 3 = 36 ÷ 3 = $12.00. Day 4 SMA: (12 + 14 + 13) ÷ 3 = 39 ÷ 3 = $13.00.

EMA: k = 2 ÷ (3 + 1) = 0.5. Day 4 EMA = $13 × 0.5 + $12.00 × 0.5 = $6.50 + $6.00 = $12.50.

Limitations: charting platforms may seed the EMA differently, so early values can differ slightly.

Key takeaways

  • SMA weights all closes equally; EMA weights recent closes more with k = 2 ÷ (N + 1).
  • All moving averages lag; longer periods lag more.
  • Crossovers are late and noisy in ranges; use them as filters.
  • Dynamic support is an area, best used together with structure.

Next step

In the next lesson you will see how RSI and MACD are built, and how MACD is made directly from EMAs.

Self-check

Answer the questions, then check your answers. You can retry as often as you like.

1. Hypothetical: the last five closes are €30, €31, €29, €32, €33. What is the 5-period SMA?

2. What is the EMA multiplier k for a 9-period EMA?

3. A trader uses a 50/200 moving average crossover as an entry signal in a sideways market. What is the most likely problem?

Automatic self-check for your own revision. Your answers are checked in your browser and are not seen or assessed by us. It is not an exam and not a qualification.

Your progress

“Complete” only means you marked the lesson as done. It is not a test of your understanding. Progress and notes are saved only in this browser on this device — not in an account.