Exponential moving average (EMA): how to calculate it and how to read it
Exponential moving average (EMA): what it is, on a real chart
The exponential moving average (EMA) is an average of closing prices that gives more weight to recent sessions: each day it moves toward the new close by a fixed fraction of the distance, α = 2/(n+1). You read it like the simple moving average (slope, price above or below, crossovers), but it reacts sooner when the price changes pace.
Amber: the 50-day EMA; blue: the 50-day SMA. Same period, different weights.
InteractiveRead a session. Click a day on the chart: I’ll tell you the close, both averages and why each one rose or fell that day.
How do you calculate the exponential moving average?
You start from the simple average of the first n closes. From there, every session, the EMA takes a step toward the new close and covers a fixed fraction of the distance: α = 2/(n+1). With 5 days α is one third, with 20 days 2/21, with 50 days 2/51.
Fig. 1 · The weights of the closes, with 10 days
- Each amber bar is the weight of one close in the EMA: today on the right, the oldest on the left.
- Today’s close weighs α, yesterday’s α × (1 − α), and so on: a little less every day.
- The blue step is the SMA: the last 10 closes weigh the same, the others zero.
- With α = 2/(n+1) today’s close weighs almost twice as much as in the SMA, and old closes never fully drop out.
Fig. 2 · One session’s step
- The dashed line is yesterday’s EMA; today’s candle closes much higher.
- The new EMA covers one third of the distance, which is α with 5 days: not all of it, not none of it.
- Close above yesterday’s EMA: the EMA rises. Below it: it falls. That is all.
first value: the simple average of the first n closes
The same formula can be written EMAtoday = α × Ctoday + (1 − α) × EMAyesterday: today’s close weighs α, the whole past together weighs 1 − α.
The EMA calculation, step by step
JPMorgan Chase, 5-day EMA, last ten closes of 2025| Session | Close | 5-day SMA | 5-day EMA |
|---|---|---|---|
| 315.55 | — | — | |
| 314.98 | — | — | |
| 313.00 | — | — | |
| 317.21 | — | — | |
| 323.09 | 316.766 | 316.766 | |
| 325.93 | 318.842 | 319.821 | |
| 329.17 | 321.680 | 322.937 | |
| 327.91 | 324.662 | 324.595 | |
| 323.75 | 325.970 | 324.313 | |
| 323.42 | 326.036 | 324.015 |
| Step | Calculation | Result |
|---|---|---|
| Starting point: the simple average of the first 5 closes, up to | (315.55 + 314.98 + 313.00 + 317.21 + 323.09) / 5 | 316.766 |
| α with 5 days | 2 / (5 + 1) | 1 / 3 |
| : the distance between the close and yesterday’s EMA | 325.93 − 316.766 | 9.164 |
| One third of the distance: divide by 3 | 9.164 / 3 | 3.055 |
| The EMA on | 316.766 + 3.055 | $319.821 |
| Last session, : same calculation | 324.313 + (323.42 − 324.313) / 3 | $324.015 |
On a chart the EMA does not start five sessions earlier: on this page it starts on , the first session we cut. At the start of 2025 that starting point weighs 0.34% of the 50-day EMA. That is why two platforms starting from different dates can show slightly different values in the first sessions, and then almost the same.
What is the difference between EMA and SMA?
The EMA is the weighted sibling of the simple moving average (SMA): with the same period the closes have the same average age, (n − 1)/2 sessions, but the weight is spread in a different way. That is why on a steady climb the two lines stay together, and they part when the price changes pace.
Fig. 3 · The jump
- The price jumps and stays up.
- The EMA moves more at once: on the first day it covers α of the jump, the SMA only 1/n.
- The SMA arrives in n sessions, in a straight line; the EMA gets closer ever more slowly.
Fig. 4 · The turn
- On a straight climb the EMA and the SMA of the same period are one single line.
- At the price peak the EMA turns first: it weighs the first falling closes more.
- The SMA turns only when the close coming in is lower than the one going out.
Fig. 5 · The echo
- One single unusual day, then everything as before.
- The SMA rises by one step and, n sessions later, drops all at once: that day leaves the calculation.
- The EMA rises more and then forgets it slowly: it has no exit day.
Fig. 6 · The sideways market
- Without a trend the price goes up and down around both averages.
- It keeps crossing them: a different weighting does not create a trend that is not there.
- A moving average describes a trend: where there is none, it says little.
On the chart at the top, in 2025 the 50-day EMA and SMA of JPMorgan Chase moved in opposite directions on 34 sessions out of 249: one rose, the other fell. The EMA compares today’s close with yesterday’s EMA; the SMA compares the close coming in with the one going out, 50 sessions earlier. Click a session and read why.
InteractiveHow much does each close weigh in an EMA? The calculator
type the period and a past session: the page does the mathPeriod between 2 and 400 days. The numbers hold on a series long enough for the starting point no longer to matter.
How do you read the exponential moving average?
six things to look at, one at a time1The slope is the trend
- rising EMA: recent closes are above their weighted average
- flat EMA: no trend to describe
2Close above the EMA, EMA rising
- the EMA rises every time the close is above yesterday’s EMA, and falls when it is below
- the SMA does not work that way: the close going out counts too
3It moves first when the pace changes
- at a sharp turn the EMA changes direction as soon as the closes cross to the other side of the EMA
- the SMA waits for the closes from n sessions ago to drop out
4No echo
- in the EMA there is no day on which an old close drops out
- a jump in the SMA can come from a close n sessions ago, not from today
5Same period, different lines
- the 20-day EMA and the 20-day SMA have the same average age, but they are not the same line
- on different platforms the EMA can start from different dates: in the first sessions the values differ slightly
6Inside other indicators
- the MACD is the difference between the 12-day EMA and the 26-day EMA
- its signal line is a 9-day EMA of the MACD itself
Exponential averages are the building blocks of the MACD. The weighted moving average (WMA) weighs the closes in a third way, in a straight line, and stops at the last n. Bollinger Bands instead use the 20-day simple average as their middle line.
Deeper dives: the simple moving average · the MACD · Bollinger Bands.
Interactive exerciseFind where the EMA turns and where the SMA turns
JPMorgan Chase, March to July 2025: two clicks on the chart, the judge tells you whether they are right and why- Click the lowest point of the 50-day EMA (amber): where it stops falling and starts rising.
- Click the lowest point of the 50-day SMA (blue).
- Read the verdict. A click is right if on that session the average is within 0.3% of its lowest point.
Two lines: amber is the 50-day EMA, blue the 50-day SMA. Find the lowest point of each.
Where to go from here
The indicators · Moving averagesThe other indicators in the «Moving averages» family
Simple moving average (SMA)
- the average of the last n closes, recalculated every session
- 20, 50 and 200 days, golden cross, death cross and lag
- try the periods on a real chart and find the crossovers
The other lessons in the guide
What is technical analysis
- the study of price and volume to recognise the trend and the levels
- three premises: price discounts everything, trends, history repeats
- exercise: uptrend, downtrend or sideways on three real charts
Efficient market hypothesis
- One chart is real, the other is the same deck shuffled.
- The three forms of the hypothesis, from Fama to Malkiel.
- The critics and how to measure the problem, with no verdicts.
Candlestick chart
- the four prices of a session: body and shadows
- green and red, long and short bodies, long shadows, the doji
- find the candle on a real chart: the judge says yes or no with the numbers
Frequently asked questions
What is the exponential moving average (EMA)?
It is an average of closing prices that gives more weight to recent sessions: each day it moves toward the new close by a fixed fraction of the distance, α = 2/(n+1). Older closes weigh less and less but never fully drop out. On the chart it is a line that follows the price and reacts sooner than the simple average when the price changes pace.
How do you calculate the exponential moving average?
Start from the simple average of the first n closes; then, every session, today’s EMA = yesterday’s EMA + α × (close − yesterday’s EMA), with α = 2/(n+1). A real example, JPMorgan Chase with 5 days, α = 1/3: on yesterday’s EMA was $316.766 and the close $325.93, so the new EMA is $319.821.
What is the difference between EMA and SMA?
The SMA gives the same weight to the last n closes and no weight to the others; the EMA gives more weight to recent closes and an ever smaller weight, never zero, to older ones. With the same period they have the same average age of the closes: the EMA parts from the SMA at turns and after jumps, where it moves first. They are two ways of weighting the same closes.
What periods are used for the exponential moving average?
On daily charts you often see 9, 12, 20, 26, 50 and 200 days. The MACD uses the 12-day and the 26-day EMA, and a 9-day EMA as its signal line. These are common conventions, not numbers with special properties.
Method and sources
| Source |
|---|
| John J. Murphy, Technical Analysis of the Financial Markets: chapter 9, moving averages (simple, weighted, exponential). |
| Charles D. Kirkpatrick and Julie R. Dahlquist, Technical Analysis (CMT curriculum): moving averages. |
| Gerald Appel, Technical Analysis: Power Tools for Active Investors: the MACD, built from exponential averages. |
The chart uses the JPMorgan Chase sessions from to in our end-of-day archive, adjusted for dividends and corporate actions and rounded to the cent: 2025 is shown, the 2024 sessions are needed to start the averages. The EMA starts from the simple average of the first n closes. The exercise example is chosen by a rule: from to the lowest point of the 50-day EMA and that of the 50-day SMA are apart, and the sessions within 0.3% of each do not overlap. The page recalculates both dates on every build and is not published if they do not match. The numbered figures are diagrams drawn to explain, not prices. This guide explains how the tools work: it does not contain investment recommendations and promises no returns. Our method · license · report an error.
DOMINA’s stock pages, indices and commodities are rebuilt every night. Leave your email: we write to you when the picture changes.
No third-party advertising. Unsubscribe with one click. Go to the platform →With your consent we use Google Analytics cookies to count visits. If you decline, the page works the same and no measurement cookie is set. Cookie policy