EMA vs SMA: what is the difference?

A simple moving average (SMA) adds up the last N closes and divides by N, so every bar counts the same. An exponential moving average (EMA) gives the newest close the most weight and lets older closes fade out gradually. The weight on the latest close is 2 ÷ (length + 1): 20% for a 9 EMA, about 9.5% for a 20 EMA and about 1% for a 200 EMA. A 20 SMA gives each of its bars exactly 5%.

So the EMA turns sooner. Say a stock has closed at $50.00 for weeks, then one bar closes at $52.00. The 20 SMA moves to $50.10, the 20 EMA to about $50.19 and the 9 EMA to $50.40. You see a turn earlier, and you also get more false turns when price chops sideways. That speed is why short-term traders mostly use EMAs.

Turn your phone sideways to read the drawing. Tap to close.

Left, a hand-drawn bar chart of how much each of the last 20 closes counts in a 20 EMA: 9.5% for the newest, less and less for older closes, against a dashed line at 5% for every bar of a 20 SMA. Right, a stock that sat at $50.00 for weeks closes once at $52.00: the 9 EMA (20% weight on the newest close) moves to $50.40, the 20 EMA (9.5%) to $50.19 and the 20 SMA (5%) to $50.10.

What are the 9, 20, 50 and 200 EMA used for?

No length is magic. The popular ones are defaults that many traders watch, which is the main reason price sometimes reacts at them. Match the length to how long you hold:

The timeframe changes what a length means. A 20 EMA on a 5-minute chart mostly reflects the last 100 minutes; on a daily chart, about a month. A 200 EMA on a 5-minute chart covers about two and a half regular sessions, nothing like the 200-day line.

  • 9 EMA: a fast line for 5-minute and 15-minute charts, where pullbacks in strong trends often stop. It is TradingView's default EMA length.
  • 20 EMA (some use 21): the standard pullback line for day traders and swing traders.
  • 50 EMA: the medium trend, and a common direction filter on the 1-hour chart.
  • 200 EMA: the long-term trend, mostly read on the daily chart. Above a rising 200 EMA the big trend is up; below a falling one, it is down.

How to read the trend and dynamic support with EMAs

Three things tell you the trend: the slope of the EMAs, which side of them price is on, and their order. In a clean uptrend the 9 sits above the 20 and the 20 above the 50, all rising. In a downtrend the order flips. When the lines go flat and tangle while price keeps crossing them, the market is ranging and the EMAs have little to say.

In a trend, a rising EMA acts as dynamic support, a level that climbs with price, and a falling one acts as dynamic resistance. Give it some width, since price often pokes through by a few cents before turning, and wait for the candle to close. Many traders favor the first pullback to the 20 EMA after a breakout, since each later touch comes in an older trend.

How to trade a pullback to the EMA, with an example

In an uptrend, wait for price to pull back to the fast EMA, let a candle close back up off it, and buy at the next bar's open. The stop goes a little under the pullback low and the first target is the prior swing high; skip it if that high is less than about 1.5 times your risk away. Flip it for shorts, or stand aside if you don't short. The pullback trading strategy guide covers telling a healthy pullback from a reversal.

Example: on a 5-minute chart, a stock has climbed from $78 to a swing high of $82.00, with the 9 EMA above the 20 and both rising. It drifts back on lighter volume to $80.35, just under the 20 EMA at $80.45, and the next candle closes at $80.80 with a long lower wick. You buy at the next open, $80.80, with a stop at $80.20 below the pullback low: $0.60 of risk for a $1.20 move back to $82.00, or 2 to 1. At $60 of risk per trade, that is 100 shares.

Before taking it, check four things:

  • The higher timeframe agrees, for example price above a rising 50 EMA on the 1-hour chart.
  • The EMAs slope your way. Flat lines mean a range, so skip it.
  • Price is near the EMA at entry. A trigger candle far above it means a wide stop and a small reward.
  • It is not the first minutes after the 9:30 a.m. ET open. EMAs on a 5-minute chart still mostly reflect yesterday's prices then, so after a gap they sit far from price.

Why EMA crossovers alone lag and whipsaw

A crossover is the fast EMA crossing the slow one: 9 over 20 to buy, 9 under 20 to sell. On daily charts, the 50 crossing above or below the 200 is called a golden cross or death cross, usually with simple averages. Crossovers lag, because both lines average past prices. And they whipsaw in ranges, where the EMAs flatten and wind around each other.

Say a stock chops between $48 and $50 for three days on a 15-minute chart. The 9 crosses above the 20 at $49.60, near the top of the range, so you buy, and the cross back down comes at $48.80: $0.80 lost. The next cross up is at $49.40 and the next one down at $48.90, another $0.50 gone. When the real breakout comes, the cross fires at $50.70, after much of the move from $48 is done.

Treat a cross as a hint that the short-term trend may be changing. Enter later on a pullback, once the slow EMA slopes the same way, and ignore crosses while it is flat.

Turn your phone sideways to read the drawing. Tap to close.

A hand-drawn 15-minute chart chopping between $48 and $50 for three days, with a green 9 EMA and a dashed grey 20 EMA winding around each other. Each cross is marked on the price line: buy at $49.60, sell at $48.80 (−$0.80), buy at $49.40, sell at $48.90 (−$0.50). When the real breakout comes, the cross fires only at $50.70.

How to use a higher-timeframe EMA as a trend filter

The simplest upgrade is letting a slower chart choose the direction. If you day trade a 5-minute chart, check a 50 EMA on the 1-hour. Above a rising one, take longs only. Below a falling one, shorts only or nothing. Flat and tangled with price, sit out. Swing traders use the daily 200 EMA the same way. Under a falling 1-hour 50 EMA, the pattern in the example above is just a bounce inside a downtrend.

To plot it on your own chart, set the EMA's Timeframe to 1 hour and keep Wait for timeframe closes ticked. The line then updates only when each hourly bar closes, so it never changes after the fact. The multi-timeframe analysis guide covers which frames to pair.

How to add EMAs on TradingView

The built-in indicator is Moving Average Exponential, free on every plan. The free Basic plan allows two indicators per chart at the time of writing, so the built-in Moving Average Ribbon helps there: it draws up to four averages, each settable to EMA, as one indicator. For other free tools that pair well, see the best TradingView indicators.

  1. Click Indicators in the top toolbar (or press /), search for Moving Average Exponential and click it. It loads with a length of 9.
  2. Open its settings with the gear icon next to its name. Set Length, keep Source on Close, and leave Offset at 0, since it only shifts the line sideways by a number of bars.
  3. Leave Smoothing at None. Under Calculation, keep Timeframe on Chart, or choose a higher one with Wait for timeframe closes ticked.
  4. In the Style tab, use a thin line for fast EMAs and a thicker one for slow ones. Add the indicator again for each extra length.
  5. To reuse your settings on new charts, choose Defaults, then Save as default, at the bottom of the settings window.

How UpTickFlow uses a higher-timeframe EMA

UpTickFlow is our invite-only TradingView indicator, and it uses EMAs in two places. It reads three higher timeframes automatically (on a 5-minute chart, the 15-minute, 30-minute and 1-hour) and judges each one's trend from its EMAs and their slope, which feeds the trend part of each setup's score, 25 of 100 points. The higher-timeframe slow EMA also counts as a level: a setup that forms near it scores higher, and it can be the level that caps the target. It does not trade EMA crosses or pullbacks to an EMA.

Higher-timeframe values come from closed bars only, so signals don't repaint, and each comes with an entry, stop and target on the chart. It doesn't predict price; it filters setups and gives you a plan. Everything above also works with the free EMA. The indicator costs $19 every 30 days (pricing).