Skip to main content
All posts

What is the Simple Moving Average (SMA)? Definition, Formula, and Example

A simple moving average (SMA) is the arithmetic mean of a security's closing prices over a fixed number of periods, used to smooth price action and define trend direction.

What is the Simple Moving Average (SMA)?

A simple moving average (SMA) is the arithmetic mean of a security's price, usually the closing price, over a fixed number of periods. A 20-day SMA adds up the last 20 closing prices and divides by 20. Each new session drops the oldest price and adds the newest, so the line "moves" forward through time. The SMA is the most widely used trend filter in technical analysis: price above a rising SMA defines an uptrend, price below a falling SMA defines a downtrend. It is the baseline against which every other moving average variant, including the exponential moving average, is measured.

How the SMA is Calculated

The formula is a plain arithmetic mean:

SMA = (P1 + P2 + ... + Pn) / n

Where P is the closing price of each period and n is the lookback window. For a 10-day SMA with closes of 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, the SMA is (1,045) / 10 = 104.5.

Every data point carries equal weight, which is the defining difference from the EMA, where recent prices are weighted more heavily. Common institutional windows are the 20-day (one trading month), the 50-day moving average (one quarter), and the 200-day moving average (one trading year). Crossovers between these windows generate widely watched signals such as the golden cross and the death cross.

Worked Example: AAPL 20-Day SMA

Suppose AAPL closes the last 20 sessions with an average price of $228.40, and today's close prints $234.10. The 20-day SMA sits at $228.40 and price trades 2.5% above it. A swing trader reading this chart classifies the short-term trend as up and treats pullbacks toward $228 as potential entries rather than reasons to sell. If the next session closes at $235 and the oldest price in the window was $226, the SMA ticks up to (previous sum minus $226 plus $235) / 20, rising by $0.45 to $228.85. That rising slope confirms trend health. When price later closes at $226, below the SMA, the filter flips and the same trader stops buying dips.

When Traders Use the SMA

Traders use the SMA for three jobs. First, trend definition: only take longs above the 200-day SMA, only take shorts below it. Second, dynamic support and resistance: institutions defend the 50-day and 200-day lines, so price frequently bounces off them on the first or second test. Third, signal generation: the 50-day crossing above the 200-day is the golden cross, a momentum trigger followed by systematic funds. SMAs also feed other tools, forming the midline of Bollinger Bands and the baseline in MACD components. You can screen for stocks crossing above or below key SMAs right now on the live scanner.

Limitations and Common Misconceptions

The SMA is a lagging indicator by construction. It confirms trends after they start and exits after they end, so it loses money in sideways, choppy ranges where price whipsaws across the line repeatedly. Equal weighting is a second weakness: a single 20-day-old outlier dropping out of the window moves the SMA even if nothing changed today, an artifact called the "drop-off effect." A common misconception is that a specific window, like the 200-day, has predictive power on its own. It works because enough market participants watch it and react, not because the number itself contains information. Finally, SMAs say nothing about volatility or volume; pair them with average true range for position sizing.