A simple moving average treats the price from 20 days ago exactly the same as today’s price. That is a problem when the market changes direction, because the newest information gets the same vote as old news. The exponential moving average (EMA) fixes this by giving recent prices more weight, so it reacts faster when price turns.
The EMA is also a building block. MACD, Keltner Channels and many community scripts on TradingView use it inside their formulas. If you understand the EMA, a large part of technical analysis becomes easier to follow.
In this guide you will learn the EMA formula with a worked example, how to read an EMA on a chart, the best EMA settings for different trading styles, three rule-based strategies including the EMA crossover, and where the EMA indicator lets you down.
Exponential Moving Average Quick Facts
| Feature | Detail |
|---|---|
| Full name | Exponential Moving Average (EMA) |
| Origin | Exponential smoothing from 1950s forecasting research (no single inventor in trading) |
| Indicator type | Trend, lagging, plotted on the price chart |
| TradingView default | Length 9, source close |
| Popular lengths | 9, 20, 50, 100, 200 |
| Best markets | Any liquid market: stocks, indices, forex, crypto, commodities |
| Best timeframes | All timeframes; longer lengths for higher timeframes |
Origin and History
The idea behind the EMA comes from exponential smoothing, a forecasting method from operations research. Robert G. Brown began working on it as an analyst for the US Navy during the Second World War and later used it to forecast demand for spare parts. He presented the method in 1956 and published it in his book Statistical Forecasting for Inventory Control (1959). Working independently, Charles C. Holt described a similar method, including versions for trends and seasons, in a 1957 memorandum for the Office of Naval Research.
The goal was practical: a forecast that adjusts quickly to new data without storing a long list of old numbers. In the 1950s, saving that data storage was a real advantage over simple moving averages.
Traders later borrowed the same idea for price charts. Unlike RSI (J. Welles Wilder) or MACD (Gerald Appel), the EMA does not have one famous inventor in trading. It became a standard tool simply because it is easy to calculate and reacts faster than a simple average.
The EMA Formula
The EMA needs only two things: the new closing price and yesterday’s EMA.
α (smoothing factor) = 2 ÷ (n + 1)
EMA today = EMA yesterday + α × (Close today − EMA yesterday)
Where:
– n = the EMA length (for example 10, 20 or 200)
– α (alpha) = how much weight the newest close gets
– Close today − EMA yesterday = how far the new price is from the average
In plain words: each day, the EMA moves a fixed part (α) of the way toward the new price. With n = 10, α = 2 ÷ 11 = 0.1818, so the EMA moves about 18% of the gap every bar.
How the first EMA value is found
The formula needs “yesterday’s EMA”, but on the very first bar there isn’t one. A common method is to start with a simple average of the first n closes and then switch to the EMA formula. Some platforms start from the first close instead. This is one reason why the same EMA can show slightly different values on two platforms, especially when only a short history is loaded.
Worked example: a 10-period EMA
Here are 12 closing prices:
| Bar | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Close | 100.00 | 101.20 | 100.80 | 102.00 | 103.10 | 102.60 | 103.80 | 104.50 | 104.00 | 105.00 | 106.20 | 107.50 |
Step 1: Starting value (bar 10). Add the first 10 closes and divide by 10.
– Sum = 1,027.00
– Starting EMA = 1,027.00 ÷ 10 = 102.70
Step 2: Smoothing factor.
– α = 2 ÷ (10 + 1) = 0.1818
Step 3: Bar 11 (close 106.20).
– Gap = 106.20 − 102.70 = 3.50
– α × gap = 0.1818 × 3.50 = 0.64
– EMA = 102.70 + 0.64 = 103.34
Step 4: Bar 12 (close 107.50).
– Gap = 107.50 − 103.34 = 4.16
– α × gap = 0.1818 × 4.16 = 0.76
– EMA = 103.34 + 0.76 = 104.10
For comparison, the 10-period simple moving average at bar 12 is (sum of bars 3–12) ÷ 10 = 103.95. The EMA (104.10) is closer to the latest price because it gives the newest bars more weight.

Why old prices never fully disappear
In a 10-period simple average, a close is either inside the window (10% weight) or gone. In a 10-period EMA, the newest bar gets about 18.2%, the bar before about 14.9%, then 12.2%, 10.0% and so on. Each older bar counts a little less, but no bar ever drops to exactly zero. That is why the EMA moves smoothly instead of jumping when an old, extreme price leaves the window.
EMA vs SMA in Short
| EMA | SMA | |
|---|---|---|
| Weighting | Recent prices count more | Every price in the window counts the same |
| Reaction to turns | Faster | Slower |
| Noise | More whipsaws | Smoother |
| Typical use | Short-term trend, entries, building block of MACD | Long-term trend, support zones |
Neither is “better”. The EMA reacts sooner and pays for it with more false signals. See both on the same data in our EMA vs SMA comparison.
How to Read the EMA Indicator
1. Price above or below the EMA. Closes above a rising EMA suggest an uptrend; closes below a falling EMA suggest a downtrend. Price crossing back and forth means there is no clear trend.
2. The slope. A steep EMA shows a strong trend. A flat EMA shows a range, even if price is still crossing above and below it.
3. Distance from the EMA. When price runs far above the EMA, the move is stretched and pullbacks become more likely. This is a warning, not a sell signal.
4. Moving support and resistance. In a steady trend, price often pulls back toward a 20 or 50 EMA and then continues. This is a tendency, not a rule: price can just as easily slice straight through.

Best EMA Settings
What each popular length shows
| EMA length | What it shows | Common users |
|---|---|---|
| 9 EMA | Very short-term momentum | Scalpers, intraday traders |
| 20 EMA | Short-term trend; pullback level in strong trends | Intraday and swing traders |
| 50 EMA | Medium-term trend | Swing traders |
| 100 EMA | Slower medium-term trend | Swing and positional traders |
| 200 EMA | Long-term trend; widely watched “trend line” | Positional traders, investors |
Raising or lowering the length
| Change | Effect |
|---|---|
| Shorter length (e.g. 9) | Reacts faster, follows price closely, more whipsaws |
| Longer length (e.g. 200) | Smoother, fewer signals, turns much later |
Recommended values by trading style
| Style | Typical timeframe | Common EMA set |
|---|---|---|
| Scalping | 1–5 minutes | 9 and 21 |
| Intraday | 5–15 minutes | 9 and 20 (plus VWAP) |
| Swing | 1-hour to daily | 20 and 50 |
| Positional | Daily to weekly | 50 and 200 |
These are starting points, not magic numbers. The 200 EMA works partly because so many traders watch it, which can make it a self-fulfilling reference level.
Source: most traders use the close. Some use hl2 (the average of high and low) for a slightly smoother line. Whatever you choose, keep it the same across your charts.
EMA Strategies
These strategies are educational examples, not trading advice. Test them on your own market and timeframe before using real money.
Strategy 1: Trend pullback to the 20 EMA
Market conditions: a clear trend. The 20 EMA is above the 50 EMA, and both slope upward (reverse everything for a downtrend).
- Entry: wait for price to pull back to the 20 EMA. Enter when a candle closes back above it in the trend direction.
- Stop-loss: below the pullback’s swing low, or 1.5 × ATR below the entry. Our ATR guide explains ATR stops.
- Exit: when price closes below the 50 EMA, or with a trailing stop.
- When it fails: at the end of a trend. The last pullback looks exactly like the earlier ones.
On the Meta chart, the September–February uptrend gave several pullbacks toward the 20 and 50 EMA (late November and early January) before the trend continued.
Strategy 2: EMA crossover (20/50) with an ADX filter
Market conditions: a market that is starting to trend. An EMA crossover alone gives many false signals in ranges, so we add a filter.
- Entry: go long when the 20 EMA crosses above the 50 EMA and ADX is above 20. Go short on the opposite cross.
- Stop-loss: below the most recent swing low (or above the swing high for shorts).
- Exit: on the opposite crossover.
- When it fails: in sideways markets, and at sharp reversals, where the crossover comes late.
The Meta chart shows both sides. In June–August 2024, the 20 and 50 EMA crossed back and forth while price went nowhere. After the February 2025 top near 740, the bearish crossover only came in early March, around 655, well after the high.
Strategy 3: The 200 EMA as a trend filter
Market conditions: any. This is a filter, not an entry signal.
- Rule: only take long setups when price is above the 200 EMA, and only short setups when it is below.
- Entry and exit: use your normal entry signal (for example, Strategy 1, RSI or Supertrend).
- When it fails: when price chops around the 200 EMA. On the Meta chart, price fell below the 200 EMA in early April 2025 and was back above it in early May.
EMA Confluence: What to Combine It With
| Pairing | Why it works |
|---|---|
| ADX | The EMA shows direction; ADX shows whether the trend is strong enough to trade |
| RSI | RSI shows how deep a pullback is, which helps time entries near the EMA |
| ATR | ATR sets stop distances that match the market’s volatility |
| VWAP | For intraday traders, VWAP adds a volume-weighted reference beside the EMA |
Redundant pairings to avoid:
– EMA + MACD as your only two tools. MACD is built from two EMAs, so it mostly repeats the same information.
– Five or more EMAs on one chart. More lines don’t add new information; they make the chart harder to read.
– EMA + Keltner Channel middle line. The Keltner Channel middle line is an EMA already.
Limitations and Common Mistakes
- It lags. Every moving average is built from past prices, so it always turns after price. See Leading vs Lagging Indicators.
- Whipsaws in ranges. In sideways markets, price and crossovers flip back and forth.
- Searching for the “perfect” length. A length that fits last year’s chart perfectly often fails next year. Pick a standard length and focus on rules and risk.
- Treating the EMA as a wall. Price can and does move straight through an EMA.
- Different values on different platforms. Starting method, data feed and how much history is loaded can change the numbers slightly.
Frequently Asked Questions
What is an exponential moving average?
An exponential moving average is a moving average that gives more weight to recent prices. It moves a fixed part of the way toward each new close, so it reacts faster than a simple moving average.
Which EMA is best for day trading?
Many day traders use the 9 and 20 EMA on 5- to 15-minute charts, often together with VWAP. There is no single best EMA; consistency matters more than the exact number.
Is the EMA better than the SMA?
Not always. The EMA reacts faster but gives more false signals. The SMA is smoother but slower. Many traders use the EMA for entries and a long SMA or EMA for the overall trend.
What is an EMA crossover?
An EMA crossover happens when a shorter EMA crosses a longer one, for example the 20 EMA crossing above the 50 EMA. It is a trend-change signal, but it comes late and fails often in sideways markets.
Why is the 200 EMA important?
The 200 EMA shows the long-term trend, and many traders and funds watch it. Because so many people react to it, price often pauses or turns near it, though not every time.
Does the EMA indicator repaint?
No. Once a bar has closed, its EMA value does not change. The value on the bar that is still forming moves with price until the close. Learn more in What Is Repainting?
Keep Learning
- EMA vs SMA: the key differences with a worked example
- Trend Indicators: the EMA compared with ADX and Supertrend
- Supertrend Pullback Strategy: the 200 EMA as a trend filter, step by step
- MACD 200 EMA Strategy Check: the 200 EMA filter tested on real data
Get new guides first: free Repaint Checklist and newsletter.
How we checked this guide
- Method: Formula and worked example verified in code
- Chart: Real TradingView data, Meta Platforms (META) daily, at least 30 days old
- Repainting: Does not repaint on closed bars
Risk disclaimer: This article is for educational purposes only and is not investment advice. The strategies shown are examples, not recommendations. Trading in stocks, forex, commodities, derivatives and crypto involves a substantial risk of loss and is not suitable for everyone. Past chart examples do not guarantee future results. Consider speaking to a SEBI-registered investment adviser (or a licensed adviser in your country) before making trading decisions. See our full Disclaimer.