Skip to Main Content

Technical Analysis

Simple Moving Average (SMA)

A simple moving average (SMA) is the arithmetic mean of the most recent n prices, recalculated each period so that every price in the window has equal weight.
Also Called
  • SMA
  • Arithmetic Moving Average
  • Simple MA
By InsiderFinance TeamUpdated Sources & Methodology

A 5-Day and 20-Day SMA on the Same Closes

A 5-Day and 20-Day SMA on the Same ClosesLine chart of 40 points with 2 overlays (sma), 3 trade markers.$45$50$55$60$65$70$7512310203040
A 5-Day and 20-Day SMA on the Same ClosesLine chart of 40 points with 2 overlays (sma), 3 trade markers.$45$50$55$60$65$70$75123510152025303540
Close5-Day SMA20-Day SMA
  1. 15-Day SMA $51.20
  2. 2Price High $74.00
  3. 3Fast Crosses Under at $67.20
The 5-day SMA reaches $50.00 on bar 5 and $51.20 on bar 6. Price peaks at bar 22; the 5-day SMA peaks across bars 23 and 24, then crosses below the 20-day SMA on bar 30.
On This Page
  1. What is a simple moving average (SMA)?
  2. How to calculate an SMA: five-period example
  3. SMA slope, position, distance and lag
  4. How traders use the SMA
  5. Limitations of the simple moving average
  6. Bottom line
  7. FAQ

Key Takeaways

  • An n-period SMA adds the most recent n prices and divides the total by n.
  • Every observation inside the lookback receives equal weight, and the oldest observation drops out when a new one enters.
  • The newest observation receives weight 1 / n. Increasing n reduces that weight and increases the average age of the prices in the window.
  • Read slope, price position and crossovers to define the trend conditions for your setup.
  • Name the timeframe and input price: a 20-day close-based SMA and a 20-bar intraday SMA are different lines.

What is a simple moving average (SMA)?

A simple moving average (SMA) is the arithmetic mean of the latest n prices, recalculated on each new bar as the newest observation enters the window and the oldest leaves. Every observation in the window receives the same weight. Traders read its slope, price’s position relative to it and crossovers between two SMAs to define trend conditions.

A 20-day SMA averages 20 daily observations. A 20-period SMA on a five-minute chart averages 20 five-minute bars. The period follows the chart interval, and the input selects the values being averaged.

Formula

SMA(n) = (P1 + P2 + ... + Pn) / n
  • n is the number of bars or periods in the window.
  • P is the chosen price for each period, commonly the closing price.

How to calculate an SMA: five-period example

A five-period SMA uses closing prices of $48, $50, $49, $52, and $51, followed by a new close of $54.

  • ($48 + $50 + $49 + $52 + $51) / 5 = $50.00 initial SMA
  • Remove $48 and add $54 for the next window
  • ($50 + $49 + $52 + $51 + $54) / 5 = $51.20 new SMA

Replacing $48 with $54 raises the five-period SMA by ($54 − $48) / 5 = $1.20, from $50.00 to $51.20.

Start with closes of $48, $50, $49, $52 and $51. Their sum is $250, so the SMA is $50.00.

The next close is $54. Remove $48 and add $54. The new sum is $256 and the SMA is $51.20.

The update has a compact form: new SMA = previous SMA + (incoming price − outgoing price) / n. Here, ($54 − $48) / 5 adds $1.20.

This equation explains the drop-off effect. A large old observation leaving the window changes the average alongside the new observation entering it.

SMA slope, position, distance and lag

Slope measures whether the rolling average is rising or falling. Price position compares the current market with that reference. Distance measures the separation, in price units or as a percentage of a nonzero SMA.

A short SMA assigns more weight to each observation. The 5-day SMA gives the newest close 20%; the 20-day SMA gives it 5%. Their average observation ages are two and 9.5 bars.

On the example chart, price peaks at $74 on bar 22. The 5-day SMA reaches $72 on bars 23 and 24. The 20-day SMA reaches $67.85 on bar 32. The shorter average crosses below the longer average on bar 30.

How traders use the SMA

Choose the conditions that qualify a trade. A trend filter, for example, requires price above a rising 200-day SMA and the 20-day SMA above that longer baseline, and a separate pullback or breakout rule supplies the entry.

For crossovers, specify the two periods and the decision bar. A 50-day SMA crossing above a 200-day SMA is a golden cross. The reverse is a death cross.

Match the input, interval, session and split adjustment before you compare two charts, because each one changes the line.

On a golden or death cross, Options Flow shows whether longer-dated calls or puts are being bought at the ask, and the Options Profit Calculator prices each structure with an expiration long enough for the trend the crossover signals.

Limitations of the simple moving average

  • Read an SMA turn as confirmation of a price turn. Its average observation age is (n − 1) / 2 bars, and on the example chart price peaks on bar 22 while the 5-day SMA tops out on bars 23 and 24 and the crossover arrives on bar 30.
  • Check the outgoing price before reading a jump. When a large old price leaves the window, the line moves even if the newest price is unremarkable.
  • In a sideways market price crosses the average back and forth and crossovers reverse quickly, so wait for a trending slope before you trade them.
  • The period and interval change every reading. A 5-day and a 200-day SMA point in different directions whenever a short pullback interrupts a long trend, so pick the period for your holding horizon.
  • Match the settings before you compare charts. Inputs, sessions and split adjustments change the series, so line them up before you read one chart’s 200-day SMA against another’s.

Bottom line

A simple moving average is an equal-weight rolling baseline that smooths price and shows the direction of the trend over its window. Match the period to the chart interval and holding horizon, read slope and price position together, and pair any crossover or filter with a separate entry rule, since the average always trails price.

Clear answers

Frequently Asked Questions

Sources and Further Reading

  1. Fidelity: Simple Moving Average
  2. Fidelity: What Is Technical Analysis?

How entries are sourced, calculated and updated: editorial methodology.

Compare

Simple Moving Average (SMA) vs related concepts

Continue learning