The indicators that matter Lesson 2 of 10
Indicators · Trend and moving averages
Exponential moving average (EMA): formula and how to use it
How the exponential moving average weights recent prices, how to compute it step by step, how it compares with the SMA, and how Finabase scans and scores it.
On this page
- The idea
- How the EMA weights prices
- The formula
- EMA versus SMA: what faster really means
- How traders use the EMA
- A signal that worked and one that failed
- Pitfalls and limitations
- Comparison with other moving averages
- How Finabase calculates and scores the EMA
- Frequently asked questions
- Summary
- Check your understanding
- Exercise
The exponential moving average (EMA) is a moving average that gives the newest price the most weight and lets older prices fade away gradually instead of dropping out all at once. It reacts faster than a simple moving average of the same length after a sharp move, and it is the building block of several other indicators, including MACD, TRIX, the Percentage Price Oscillator and Keltner Channels.
Exponential smoothing came from operations research, not trading. Robert G. Brown used it in the 1950s to forecast inventory demand for the US Navy, because it needs only one stored number to update and adapts to new data quickly. Traders adopted it for the same reasons. This guide shows the recursion with real NVIDIA prices, explains what the smoothing constant does, compares the EMA honestly with the SMA, and shows how Finabase uses it.
The idea
A moving average is a set of weights: how much each past close counts toward today's value. Seen that way, the difference between a simple and an exponential average fits in one picture.
The SMA is the flat step: twenty closes with an equal say, then a cliff. The EMA is the slope: today's close counts almost twice as much as it does in the SMA, and the weight then fades without ever reaching zero.
Everything that separates the two averages follows from those shapes. The EMA reacts sooner to a new price because the newest closes weigh more. It never jumps when an old price leaves the window, because nothing ever leaves. And it responds to a single odd close more than the SMA does, for the same reason it responds to a real turn sooner.
How the EMA weights prices
Picture the EMA as a running estimate that you nudge every day. If today's close is above the estimate, you move the estimate up by a fixed share of the gap; if below, you move it down. The share is the smoothing constant, usually written α (alpha).
Because each day's nudge is a fraction of a gap that already includes the past, the weight on any given close shrinks geometrically as it ages. With α = 2 ÷ 21, today's close gets 9.5% of the weight, yesterday's 8.6%, the day before 7.8%, and so on. After 20 bars, those 20 closes together carry about 86% of the weight; the remaining 14% is spread across all older history.
The formula
| Period n | α = 2 ÷ (n + 1) | Weight on today's close |
|---|---|---|
| 9 | 0.200 | 20.0% |
| 12 | 0.154 | 15.4% |
| 20 | 0.095 | 9.5% |
| 26 | 0.074 | 7.4% |
| 50 | 0.039 | 3.9% |
| 200 | 0.010 | 1.0% |
The "period" of an EMA is a convention that lines it up with an SMA of similar smoothness: the average age of the data in an n-period EMA, (n − 1) ÷ 2 bars, is the same as in an n-period SMA. That is why a 20-day EMA and a 20-day SMA sit close together most of the time.
A worked example on NVIDIA
Finabase's 20-day EMA of NVIDIA (NVDA) stood at $177.00 on March 31, 2026. Here are the next two sessions, with α = 2 ÷ 21 = 0.09524.
| Date | Close | Calculation | EMA (20) |
|---|---|---|---|
| Mar 31, 2026 | $174.40 | (given) | $177.00 |
| Apr 1, 2026 | $175.75 | 177.00 + 0.09524 × (175.75 − 177.00) | $176.88 |
| Apr 2, 2026 | $177.39 | 176.88 + 0.09524 × (177.39 − 176.88) | $176.93 |
On April 1 the close was $1.25 below the EMA, so the EMA fell by about 9.5% of that, 12 cents. On April 2 the close finished above the EMA for the first time since mid-March. Both values match the Finabase chart to the cent.
EMA versus SMA: what "faster" really means
It is common to read that the EMA "has less lag." That is only half right.
On a steady trend, the lag is the same. A straight-line rise makes both a 20-day EMA and a 20-day SMA trail price by about 9.5 bars. The EMA's speed advantage shows up after a sudden change of direction or level: because the newest closes carry more weight, the EMA starts turning sooner, while the SMA keeps averaging in pre-change prices for its full window.
The EMA has no drop-off effect. A 20-day SMA can jump on a quiet day simply because a big move from 20 days ago left the window. The EMA never does that; old data fades smoothly.
The cost is more crossings. In the year to October 29, 2026, NVIDIA closed across its 20-day EMA 43 times and across its 20-day SMA 37 times. More signals means more of them are noise.
The spring 2026 low shows the trade-off in one picture. NVIDIA bottomed at an intraday low of $164.27 on March 30. It closed above its 20-day EMA on April 2 at $177.39; it closed above its 20-day SMA on April 6 at $177.64, the next trading session (markets were closed on April 3 for Good Friday). Over the 20 sessions after the EMA signal, the stock rose 11.9%. Here the EMA earned its keep, but only by one session.
The June 2026 top shows the other side. Between May 27 and June 22 the close crossed the 20-day EMA nine times in 18 sessions while the stock drifted from $212 to $208. Each "signal" was followed by the opposite one within days.
How traders use the EMA
Trend direction and pullbacks. Short-term traders often use the 9-, 10- or 20-period EMA as the line that a healthy trend keeps respecting. In a strong uptrend, pullbacks to the 20-day EMA that hold are a common entry idea.
Two-EMA crossovers. A fast EMA crossing a slow one (for example 12 over 26) is a smoother trigger than price crossing a single line. The distance between those two EMAs is exactly what the MACD plots.
Ribbons. Daryl Guppy's Multiple Moving Average lays twelve EMAs on one chart: six short ones (3 to 15 periods) for traders and six long ones (30 to 60 periods) for investors. When the two groups separate and fan out, a trend is strong; when they compress and tangle, the market is undecided. Finabase ships it as a ready-made chart template.
Building block. MACD is the difference of two EMAs; TRIX is the rate of change of a triple EMA; DEMA and TEMA combine EMAs to cancel lag; Keltner Channels put bands around an EMA. Understanding the EMA makes all of them easier to read.
One symbol at a time, daily closes, no trading costs. The lab starts each EMA from the first bars of the snapshot, so its earliest values differ slightly from a chart with more history. A few crossovers in one period show how the settings behave, not which setting is best.
A signal that worked and one that failed
The signal is a close above the 20-day EMA. Both charts are NVIDIA in 2026, two months apart. The shaded area is the 20 sessions after the signal.
In April the close crossed a falling line from below after three weeks under it, and the line itself turned up within days. In June price was moving sideways near its high, and the EMA was flat: the close crossed it nine times between May 27 and June 22. A line that reacts quickly also reacts to moves that lead nowhere. Its slope is the first thing to check before giving any weight to a crossing.
Pitfalls and limitations
Start-up sensitivity. Because an EMA never fully forgets, its value depends a little on where the calculation began. Charts that start at different dates can show EMAs that differ by a few cents for the first few dozen bars. Finabase computes from a longer history than the visible range, so the values you see are already settled.
More whipsaws. As the NVIDIA counts show, faster means more false crossings. Most practitioners add a filter: a minimum distance through the line, a second confirming close, or agreement with a longer average.
No information about strength. An EMA tells you direction. It does not tell you whether the trend is strong or weak. Pair it with a trend-strength measure such as ADX or with momentum such as the RSI.
Comparison with other moving averages
| Average | Reacts to a sudden change | Smoothness | Best for |
|---|---|---|---|
| SMA | Slowest | High | Consensus levels (50- and 200-day) |
| EMA | Faster | Medium | Trend following, building other tools |
| DEMA | Faster still | Lower | Short-term trend with less lag |
| TEMA | Fastest | Lowest | Very short-term timing |
How Finabase calculates and scores the EMA
Finabase calculates the EMA with TA-Lib's EMA function on closing prices, which seeds
the series with a simple average of the first n closes and then applies the
recursion above. A new EMA study defaults to 10 periods; you can choose any
period. The ready-made "Moving Average Crossover" template uses EMAs of 16, 32 and 64,
and the "Guppy Multiple Moving Average" template uses 3, 5, 8, 10, 12, 15, 30, 35, 40,
45, 50 and 60.
The technical gauge on the symbol page tests the close against EMAs of 5, 10, 20, 21, 25, 30, 50, 63, 75, 100, 125, 150 and 200 periods. A close at or above an EMA counts as Bullish, below it as Bearish. The Scanner lists stocks whose close has crossed any of those EMAs, with the signal date. As with every gauge reading, these describe position, not merit: a stock can be above its 5-day EMA and below its 200-day at the same time.
Frequently asked questions
What does EMA stand for in stocks?
Exponential moving average: an average of past prices in which each older price counts a little less than the one after it, by a constant factor.
Is the EMA better than the SMA?
Neither is better in general. The EMA responds faster to sudden changes and avoids drop-off jumps; the SMA is steadier and matches the widely watched 50- and 200-day lines. On a steady trend both lag by about the same amount.
What EMA periods do traders use most?
The 9 or 10, 12 and 26 (the MACD pair), 20, 50 and 200. The 9 and 20 are popular with short-term traders; the 50 and 200 mirror the classic SMA reference lines.
How do I calculate an EMA in a spreadsheet?
Put the closes in a column. Seed the first EMA with the average of the first n closes. In each later row, take the previous EMA plus 2 ÷ (n + 1) times the difference between that row's close and the previous EMA.
Summary
The EMA is a running estimate of price that moves a fixed share of the way toward each new close. It forgets gradually, turns sooner than an SMA after a shock, and anchors MACD, TRIX and many other tools. Its speed buys earlier signals and more false ones, so use it with a filter or a second, independent indicator, and treat any crossover rule as a hypothesis to test.
Check your understanding
4 questions on this lesson. Each answer comes with the reason, and nothing is scored.
Yesterday’s 20-day EMA was $100. Today’s close is $110. With a smoothing constant of 2 ÷ 21, about 0.095, what is today’s EMA?
- About $100.95
- About $105
- About $109.05
Show the answer
A. About $100.95 The EMA moves a fixed share of the way from yesterday’s value toward today’s close: 100 + 0.095 × (110 − 100) = 100.95. One close moves a 20-day EMA by less than a tenth of the gap.
A stock rises by the same amount every day for months. Which trails price by less, the 20-day EMA or the 20-day SMA?
- The EMA, always
- The SMA
- Neither: on a steady trend both trail by about the same amount
Show the answer
C. Neither: on a steady trend both trail by about the same amount On a straight-line trend both sit about 9.5 bars behind price. The EMA’s advantage appears after a sudden change, when its heavier weight on the newest closes makes it start turning sooner.
A 20-day SMA can jump on a quiet day. A 20-day EMA cannot. Why?
- The EMA ignores large moves
- In an SMA a big move from 20 days ago leaves the window all at once; in an EMA old closes fade gradually
- The EMA uses the high and low as well as the close
Show the answer
B. In an SMA a big move from 20 days ago leaves the window all at once; in an EMA old closes fade gradually An SMA gives each of its 20 closes 5% and the 21st nothing, so the day a large move drops out, the average shifts. An EMA’s weights shrink smoothly and never reach zero, so no single day removes an old price.
In the lab above, keep NVIDIA and switch from 20 / 50 to 12 / 26. What changes?
- Fewer crossovers
- More crossovers: 16 in place of 10
- The same crossovers, each one day earlier
Show the answer
B. More crossovers: 16 in place of 10 The 12- and 26-day EMAs crossed 16 times in NVIDIA’s year, the 20- and 50-day 10 times. In this one year 6 of the 8 faster up signals were followed by a higher close 20 sessions later, against 3 of 5. Eight signals in a rising stock are too few to call the faster pair better; what the lab does show reliably is that it trades more often.
Exercise
One task to do in Finabase. Nothing is graded or saved.
Open the NVIDIA chart with EMA (20) and SMA (20). Find the sharpest turn in price in the past year, up or down. Which of the two lines bent toward the new direction first, and by about how many sessions? Then find a stretch where the price moved steadily one way for several weeks. How far apart are the two lines there?
Open the NVDA chart with EMA (20) and SMA (20)What you should find
After a sudden change the EMA turns first, often by only a session or a few, because the newest closes weigh more. In a steady trend the two lines sit close together, since both lag by about the same amount. The price of that speed shows in sideways stretches, where the close crosses the EMA more often.
Sources and further reading
- Robert G. Brown, Smoothing, Forecasting and Prediction of Discrete Time Series (Prentice-Hall, 1963) — exponential smoothing
- Perry J. Kaufman, Trading Systems and Methods, 6th ed. (Wiley, 2019) — exponential smoothing and smoothing constants
- Daryl Guppy, Trend Trading (Wrightbooks, 1996) — the Guppy Multiple Moving Average
- TA-Lib — EMA function reference
- Finabase chart data — NVDA daily bars, 2025-10-30 to 2026-10-29, EMA and SMA computed by Finabase
