What Is a Simple Moving Average (SMA)? Formula and How to Use It

By Forex & Brokers DeskUpdated Nov 10, 2026

Simple Moving Average (SMA)
Illustration · Fintrev

Definition

A simple moving average (SMA) is the arithmetic mean of an asset's price, usually the close, over a fixed number of recent periods, recalculated each period to smooth noise and show trend direction.

Key takeaways

  • Each new close pushes the oldest price out, so a spike leaving the window can turn the SMA on its own.
  • Short SMAs such as 10 or 20 periods turn quickly, while 100 to 200 period SMAs are smooth and slow.
  • A golden cross is the 50-day SMA crossing above the 200-day, and a death cross is the reverse.
  • An n-period SMA is centered (n − 1) / 2 bars back, so a 20-period SMA reflects price about 9.5 bars ago.

A simple moving average (SMA) is the arithmetic mean of an asset’s price over a fixed number of recent periods, recalculated each period as the newest price enters the window and the oldest one leaves. Closing prices are the usual input. Plotted as a line on a chart, the SMA smooths out bar-to-bar noise so the underlying direction of price is easier to see. In trading shorthand, “SMA” is followed by its period: a 20 SMA averages the last 20 bars, a 200 SMA the last 200.

How a Simple Moving Average Works

The formula

SMA = (P₁ + P₂ + … + Pₙ) / n

where:

  • P is the price for each period (normally the close)
  • n is the number of periods in the average

A “period” is one bar on whatever chart timeframe you use. On a daily chart, a 50-period SMA covers 50 trading days. On a one-hour chart, the same setting covers 50 hours. Because forex trades around the clock on weekdays, an hourly or four-hour SMA on a currency pair covers continuous trading time. A stock’s daily SMA skips weekends and holidays because no bars print on those days.

Closing prices are the default because the close is the settled price of each period. Most charting platforms also let you base the SMA on the open, high, low, or a blend such as (high + low + close) / 3. The choice changes the line slightly, so two traders quoting “the 20 SMA” should be using the same input.

Worked example (hypothetical prices)

Take a 5-period SMA and these hypothetical closing prices:

Period Close Prices in window 5-period SMA
1 20 n/a n/a
2 22 n/a n/a
3 24 n/a n/a
4 25 n/a n/a
5 23 20, 22, 24, 25, 23 114 / 5 = 22.8
6 26 22, 24, 25, 23, 26 120 / 5 = 24.0
7 28 24, 25, 23, 26, 28 126 / 5 = 25.2

The first value appears only once five prices exist. From then on, each new close pushes the oldest one out. That gives a shortcut for updating the average:

New SMA = previous SMA + (newest price − price dropping out) / n

At period 6: 22.8 + (26 − 20) / 5 = 24.0. At period 7: 24.0 + (28 − 22) / 5 = 25.2.

The shortcut shows something the plain formula hides. How much the SMA moves depends as much on the price leaving the window as on the price entering it. If a sharp spike sits at the back of the window, the SMA can turn when that spike drops out, even if today’s price barely moved. This is often called the drop-off effect.

Short versus long periods

The period you choose decides what the line is useful for:

  • Short SMAs (for example 5, 9, 10, 20 periods) track price closely and turn quickly. They suit short-term trend reading but produce more false turns in choppy markets.
  • Medium SMAs (around 50 periods) filter out more noise and are often used to describe the intermediate trend.
  • Long SMAs (100 to 200 periods) are smooth and slow. The 200-day SMA is a widely watched gauge of the long-term trend in stocks and indexes. Its popularity can work against it: when many participants act on the same line, reactions around it may partly reflect that crowd attention rather than anything in the data.

No period is “correct” in general. The right choice depends on the timeframe you trade and how much lag you can accept in exchange for fewer false signals.

How to Read SMA Lines in Trading

Slope

A rising SMA means the average price over the window is increasing, which describes an uptrend over that span. A falling SMA describes a downtrend. A flat or tangled SMA suggests price is moving sideways, and that is the condition in which moving averages are least informative.

Price above or below the SMA

When price trades above its SMA, the latest price is higher than the average of the window, and the reverse holds below. Traders often use this as a simple filter. One example rule: consider long trades only while price is above the 50 SMA. A close back through the line is read as a possible change in short-term direction. Some traders also treat a rising SMA as a moving support zone in an uptrend, or a falling SMA as resistance in a downtrend. That is a way of framing pullbacks, not a level price is obliged to respect.

A related measure is the price-to-SMA ratio (price divided by its SMA), sometimes expressed as a percentage distance. For example, price at 110 against a 100 SMA is 10% above the average. Traders use this to judge how stretched price is from its average. Because “stretched” means different things for different assets and volatility levels, the reading is only meaningful compared with that same market’s own history.

Crossovers: golden cross and death cross

Using two SMAs of different lengths turns the indicator into a signal system:

  • When a shorter SMA is above a longer one, recent prices are averaging higher than the longer history, which is consistent with an uptrend.
  • A golden cross occurs when a short-term SMA crosses above a long-term SMA, classically the 50-day crossing above the 200-day. It is read as a bullish signal, and some traders want rising trading volume to confirm it.
  • A death cross is the opposite: the 50-day SMA crossing below the 200-day, read as bearish.

When a short SMA falls below a long one, recent prices are averaging lower than the longer history, which traders read as weakening momentum and a possible downtrend. Crosses of long SMAs come late by construction, because both lines must catch up with a move that has already happened. A golden cross often appears well after the low, and a death cross well after the high.

An SMA “buy signal” is whatever rule a trader defines: a close above the SMA, the SMA turning upward, or a short SMA crossing above a long one. None is a guarantee. Each will be right in some conditions and whipsaw in others, so stop-losses and position sizing still decide what a wrong signal costs.

Volume SMA

An SMA can be applied to any data series, not just price. A volume SMA averages trading volume over n bars and is usually drawn over the volume histogram. If a day’s volume is above its 25-day volume SMA, that day traded more than the recent average, which traders use to judge whether a breakout or a cross has participation behind it. Spot forex has no centralized exchange volume, so volume on currency charts typically reflects a broker’s or data feed’s own activity (often tick volume).

Inside other indicators

The SMA is a building block of other tools. The middle line of Bollinger Bands is a 20-period SMA, with bands set a chosen number of standard deviations above and below it. Many oscillators smooth their raw readings with a moving average, and the MACD is built from the difference between two moving averages (exponential ones in its standard form).

SMA vs. EMA (and Other Moving Averages)

The SMA and the exponential moving average (EMA) are read the same way (slope, price position, crossovers). They differ in how they weight data:

Simple moving average Exponential moving average
Weighting Equal weight to every price in the window More weight to recent prices, decaying for older ones
Calculation Sum of n prices / n EMA = (price − previous EMA) × multiplier + previous EMA, with multiplier = 2 / (n + 1)
Response to new prices Slower Faster
Drop-off effect Yes, old prices leave the window abruptly Older prices fade gradually rather than vanishing
Typical use Long-term trend reading, widely watched levels such as the 50 and 200 day Shorter-term signals; 12 and 26 periods are standard in MACD

Because the EMA reacts sooner, many short-term traders prefer it. The trade-off is that faster response also means more reactions to noise. The SMA’s slower, evenly weighted line is easier to interpret when you want the broad trend and fewer false turns. A weighted moving average (WMA) sits in between: it assigns linearly increasing weights, so the newest price counts most and the oldest least.

Limitations of a Simple Moving Average

Lag is built in. With equal weights, an n-period SMA is centered (n − 1) / 2 periods in the past. A 20-period SMA effectively describes price about 9.5 bars ago, and a 200-period SMA about 99.5 bars ago. Turning points in the SMA therefore always follow turning points in price.

Equal weighting is a judgment call. The SMA treats the oldest price in the window as just as relevant as the newest. Traders who think recent data better reflects current conditions see this as a flaw. Others argue that favoring some periods over others introduces its own bias.

Sideways markets produce whipsaws. When price oscillates around a flat SMA, it crosses the line repeatedly, and crossover rules generate a string of losing signals. Pairing the SMA with a volatility measure such as the Average True Range or a momentum gauge such as the RSI is a common way to judge whether a trend is strong enough to trade.

It relies entirely on past prices. Under the efficient market hypothesis, past prices should say nothing reliable about future direction, though economists and practitioners disagree on how far that holds. The SMA describes what price has done; it does not forecast what it will do.

The Bottom Line

Traders who want a clear view of trend direction can use the SMA's slope, price position, and crossovers as simple filters. The line always lags price and produces whipsaws in sideways markets, so its signals are no guarantee. Pairing it with tools such as the ATR or RSI, and relying on stop-losses and position sizing, keeps the cost of a wrong signal under control.

About this page

Written by Forex & Brokers Desk

The Forex & Brokers Desk covers forex and CFD broker reviews, regulation checks, trading guides and the forex glossary.

Published
Last updated

Spotted an error? Tell the editors. This page is general information, not financial advice.