Browse the library

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
  1. How the EMA weights prices
  2. The formula
  3. EMA versus SMA: what faster really means
  4. How traders use the EMA
  5. Pitfalls and limitations
  6. Comparison with other moving averages
  7. How Finabase calculates and scores the EMA
  8. Frequently asked questions
  9. Summary

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.

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.

NVIDIA (NVDA) daily with EMA (20) and SMA (20) · 2025-10-30 to 2026-10-29 $175 $200 $225 Low $164.27 · Mar 30 Close above EMA (20) · Apr 2 Price EMA (20) SMA (20) Nov Dec Jan 2026 Feb Mar Apr May Jun Jul Aug Sep Oct
NVIDIA (NVDA), one year of daily bars with EMA (20) and SMA (20) as computed by Finabase.

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.

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.

Sources and further reading

  1. Robert G. Brown, Smoothing, Forecasting and Prediction of Discrete Time Series (Prentice-Hall, 1963) — exponential smoothing
  2. Perry J. Kaufman, Trading Systems and Methods, 6th ed. (Wiley, 2019) — exponential smoothing and smoothing constants
  3. Daryl Guppy, Trend Trading (Wrightbooks, 1996) — the Guppy Multiple Moving Average
  4. TA-Lib — EMA function reference
  5. Finabase chart data — NVDA daily bars, 2025-10-30 to 2026-10-29, EMA and SMA computed by Finabase