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

Momentum Indicators: RSI and MACD in Depth

Understand how RSI and MACD are calculated, how to read divergence, and how to avoid indicator overload.

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

What you will learn

  • How the RSI value is calculated from average gains and losses.
  • How MACD is built from two EMAs, a signal line and a histogram.
  • What divergence is and why it is a warning, not an entry.
  • How to avoid indicator overload.

Explanation

Momentum describes the speed of price change. Momentum indicators are calculated from price, so they never contain information that price does not already have. They only present it differently.

RSI

The Relative Strength Index (RSI), developed by J. Welles Wilder, compares average gains with average losses over N periods (often 14):

  • RS = average gain ÷ average loss
  • RSI = 100 − 100 ÷ (1 + RS)

RSI moves between 0 and 100. In strong uptrends RSI can stay above 70 for a long time, so "above 70 = sell" is a poor rule. Many traders instead watch whether RSI holds above about 40 to 50 during pullbacks in an uptrend.

MACD

The Moving Average Convergence Divergence (MACD), developed by Gerald Appel, is built from EMAs. Common settings are 12, 26 and 9:

  1. MACD line = EMA(12) − EMA(26)
  2. Signal line = EMA(9) of the MACD line
  3. Histogram = MACD line − signal line

A positive MACD line means the short EMA is above the long EMA. A growing histogram means momentum is increasing.

Divergence

Bearish divergence: price makes a higher high, but the indicator makes a lower high. Bullish divergence: price makes a lower low, but the indicator makes a higher low. Divergence shows that momentum is slowing. Trends can continue with divergence for a long time, so use it only as a warning. The trigger is still a break of structure.

Indicator overload

RSI, MACD and stochastic indicators are all built from the same closing prices. Adding three of them does not give three independent confirmations. Choose one momentum indicator, learn it well, and let structure and zones lead.

Worked example

Hypothetical example: an index in points. We round each step to two decimals.

RSI: 14-period average gain 0.80, average loss 0.40.

  1. RS = 0.80 ÷ 0.40 = 2.00
  2. RSI = 100 − 100 ÷ (1 + 2.00) = 100 − 33.33 = 66.67

MACD update: yesterday EMA(12) = 105.40, EMA(26) = 103.90, signal = 1.20. Today's close = 107.00.

  1. k for 12: 2 ÷ 13 ≈ 0.1538. New EMA(12) = 105.40 + 0.1538 × (107.00 − 105.40) ≈ 105.65
  2. k for 26: 2 ÷ 27 ≈ 0.0741. New EMA(26) = 103.90 + 0.0741 × (107.00 − 103.90) ≈ 104.13
  3. MACD line: 105.65 − 104.13 = 1.52
  4. k for 9: 2 ÷ 10 = 0.20. New signal = 1.20 + 0.20 × (1.52 − 1.20) ≈ 1.26
  5. Histogram: 1.52 − 1.26 = 0.26

The formula EMA + k × (close − EMA) is the same as the one in lesson 6, just written differently.

Divergence: price highs at 120 and then 124; RSI at those highs: 72 and then 65. Price higher, RSI lower: bearish divergence. The trader does not short yet; they wait for a break of the last higher low.

Common mistake

Trading divergence aloneSelling every bearish divergence in an uptrend means fighting the trend again and again. Divergence can repeat several times before the trend ends. Combine it with a structure break and a zone.

Practice activity

Hypothetical: average gain 0.60, average loss 0.90. Calculate RSI. Then: EMA(12) = 50.30, EMA(26) = 50.80, signal = −0.30. Calculate the MACD line and histogram.

Show solution

RS = 0.60 ÷ 0.90 ≈ 0.67. RSI = 100 − 100 ÷ 1.67 ≈ 100 − 60.00 = 40.00.

MACD line = 50.30 − 50.80 = −0.50. Histogram = −0.50 − (−0.30) = −0.20. Momentum is negative and below the signal line.

Limitations: platforms smooth averages in slightly different ways, so values may differ a little.

Key takeaways

  • RSI = 100 − 100 ÷ (1 + RS); in trends it can stay extreme for long periods.
  • MACD = EMA(12) − EMA(26); signal = EMA(9) of MACD; histogram = difference.
  • Divergence is a warning; structure gives the trigger.
  • Several momentum indicators are not independent confirmations.

Next step

In the next lesson you will add volume and volatility, and calculate the average true range by hand.

Self-check

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

1. Hypothetical: average gain 1.20, average loss 0.40. What is the RSI?

2. Hypothetical: EMA(12) = 80.50, EMA(26) = 79.70, signal line = 0.50. What is the MACD histogram?

3. Price makes a lower low, but RSI makes a higher low. What is this, and what should a disciplined trader do?

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.