Moving Average (SMA vs EMA)

A moving average smooths price by averaging it over a set number of periods, updated with every new bar. It’s the building block of many other indicators and the most common way to see the direction of a trend.

20-period simple and exponential moving averages on a candlestick chart
The EMA (dashed) reacts faster to price changes than the SMA (solid).
Neutral explainer. This page explains how the indicator is calculated and read. Indicators are derived from past prices and don’t predict the future on their own.

Simple moving average (SMA)

SMA = (Sum of the last N closes) ÷ N

A 20-period SMA adds the last 20 closes and divides by 20. Every bar in the window has equal weight.

Exponential moving average (EMA)

Multiplier = 2 ÷ (N + 1)
EMA = (Close − Previous EMA) × Multiplier + Previous EMA

An EMA gives more weight to recent prices, so it reacts faster than an SMA of the same length. For a 20-period EMA the multiplier is 2 ÷ 21 = 0.0952, so the latest close gets about 9.5% of the weight. Other variations include the weighted (WMA) and smoothed (SMMA) moving averages.

Common periods

PeriodOften used for
9–21Short-term trend
50Medium-term trend
200Long-term trend, widely watched on daily charts

How traders use moving averages

The trade-off: lag

Because moving averages are built from past prices, they always lag. Shorter averages follow price closely but produce more false signals in choppy markets; longer ones are smoother but slower to turn.

On TradingView

Search Indicators for Moving Average (simple) or Moving Average Exponential. Moving averages also power MACD and Bollinger Bands. For a volume-weighted alternative, see VWAP.

Educational explanation only. ChartWatch is independent and doesn’t give trading or investment advice. Trading carries a risk of loss.

FAQ

What is the difference between SMA and EMA?
An SMA weights every bar in the period equally; an EMA gives more weight to recent prices, so it reacts faster to new moves.
What is the 200-day moving average?
The average closing price of the last 200 trading days, widely watched as a long-term trend indicator.
What is a golden cross?
When the 50-day moving average crosses above the 200-day moving average. The opposite is called a death cross.
How is an EMA calculated?
Each new EMA = (close − previous EMA) × 2 ÷ (N + 1) + previous EMA, usually starting from an SMA.

More free TradingView tools

TradingView — the fastest way to follow markets
Watchlist BuilderAll GuidesWatchlist GuideTradingView PlansIndicatorsShortcutsBar ReplayAlert BuilderPine ColorsWatchlist CleanerCalculatorsWorld Market HoursForex HoursStock Market HoursMarket HolidaysFed Meeting DatesCPI & NFP DatesPosition Size CalculatorCandlestick PatternsChart PatternsChart ColorsSymbol FormatAboutPrivacyTermsContact

ChartWatch is an independent tool and is not affiliated with, endorsed by, or officially connected to TradingView, Inc. “TradingView” is a trademark of its respective owner. Exchange, broker and platform names are trademarks of their respective owners.