---
type: "Lesson"
title: "Exponential moving average (EMA)"
description: "An exponential moving average (EMA) is a moving average that gives the most recent prices more weight, so it reacts to new moves faster than a simple average of the same length."
tags: ["ema","exponential moving average","moving average","smoothing","20 ema","weighted average"]
sources: [{"id":"s1","resource":"https://en.wikipedia.org/wiki/Moving_average"}]
generated: {"by":"process:eqdoc-okf-export","at":"2026-10-25"}
stale_after: "2027-04-25"
x-eqdoc-id: "ta-exponential-moving-average"
x-eqdoc-reviewed-at: "2026-10-25"
x-eqdoc-questions: ["What is an exponential moving average?","How is EMA different from SMA?","How is the EMA calculated?"]
x-eqdoc-licence-note: "Written by eqdoc in its own words; facts checked against the CC BY-SA page listed"
---

An exponential moving average (EMA) is a moving average that gives the most recent prices more weight, so it reacts to new moves faster than a simple average of the same length.

- **How it is calculated.** Each day's EMA blends today's close with yesterday's EMA, using a smoothing factor alpha.
  `alpha = 2 / (n + 1)`
  `EMA today = alpha x Close today + (1 - alpha) x EMA yesterday`
  For a 20-day EMA, alpha = 2 / 21, about 0.095, so today's close carries roughly 9.5% of the weight. The very first value is usually seeded with a simple average of the first n closes. The TA-Lib function is `EMA`.
- **Why "exponential".** The weight on each older day shrinks by the same factor (1 - alpha) every step back. Old prices never fully vanish, they just fade.
- **Common settings.** 9, 12, 20, 26, 50 and 200 periods. The 12 and 26 EMAs are the building blocks of MACD.
- **How analysts read it.** Like any moving average, the slope describes the recent direction and price above or below the line describes where the latest close sits relative to that smoothed trend. Because it turns sooner than an SMA, an EMA is often preferred by people watching shorter swings.
- **Pitfalls.** Faster reaction also means more false turns in choppy markets. An EMA still lags; it is a summary of the past, not a forecast. Values can differ slightly between charting tools because of the seeding method and how much history was loaded, so a short history gives a less settled EMA.
- **India note.** Periods are counted in trading sessions on NSE or BSE. Use split- and bonus-adjusted prices, or the EMA will show a sudden false drop on the adjustment date.
