What Is the Exponential Moving Average (EMA)? Formula and How to Use It
By Forex & Brokers DeskUpdated Nov 10, 2026

Definition
The exponential moving average (EMA) is a moving average that weights recent prices more heavily than older ones, so it reacts to new price changes faster than a simple moving average.
Key takeaways
- An EMA is a weighted moving average in which the weight of each past price shrinks by a constant factor with every bar, so recent data dominates the result.
- The standard formula is EMA today = Price today × k + EMA yesterday × (1 − k), where k = 2 ÷ (N + 1) and N is the number of periods.
- A 10-period EMA puts 18.18% of its weight on the latest price; a 20-period EMA puts 9.52% on it. A simple moving average of the same lengths would give the latest price 10% and 5%.
- Commonly quoted periods include 8, 9, 12 and 26 for short-term analysis, 20 for swing trading, and 50 and 200 for long-term trend analysis. The 12 and 26 EMAs are the building blocks of MACD and the percentage price oscillator (PPO).
- Like every moving average, the EMA is a lagging indicator. It works best in trending markets and produces false signals when price moves sideways.
The exponential moving average (EMA) is a moving average that gives more weight to recent prices and progressively less to older ones. Each new EMA value is a blend of the latest price and the previous EMA. That makes the line react to fresh price changes faster than a simple moving average (SMA) of the same length. In trading, the EMA serves as a trend indicator: its slope shows the direction of the trend, and the distance between price and the line shows how far the market has moved away from its recent average.
The EMA is used on stocks, forex pairs, futures, crypto and indexes, on any timeframe from one-minute charts to weekly charts. The math is the same everywhere. The only inputs are a price series and a period length.
What the EMA Measures
A moving average turns a jagged price series into a smoother line so the underlying direction is easier to see. The question every moving average has to answer is how much each past price should count.
A simple moving average gives every price in the window equal weight and drops the oldest price completely when a new one arrives. A 20-day SMA treats the close from 19 days ago exactly like yesterday’s close, then forgets it entirely on the next day.
The EMA handles this differently. It never drops old prices outright. Each price enters the average with a large weight, and that weight shrinks by the same proportion every period afterward. The decline is geometric (exponential), which is where the name comes from. As a result, the EMA tracks the current price more closely and changes direction sooner than an SMA of the same period.
“EMA” stands for exponential moving average. In some charting software the same indicator appears as “Moving Average Exponential” or as “EMA(20)”, “EMA 50” and so on, where the number is the period. The period counts bars, not calendar days: a 20 EMA on a daily chart covers about 20 trading days, while a 20 EMA on a one-hour chart covers about 20 hours of trading.
The EMA Formula
The EMA is calculated recursively, meaning each value depends on the one before it:
EMA(today) = Price(today) × k + EMA(yesterday) × (1 − k)
The multiplier, also called the smoothing constant or weighting factor, is:
k = Smoothing ÷ (1 + N)
where N is the number of periods in the EMA.
The smoothing value is almost always set to 2, which gives the familiar multiplier k = 2 ÷ (N + 1). Other smoothing values are possible. Raising the smoothing value raises k, which gives the newest price more influence and makes the line more responsive. Lowering it does the opposite. Unless a platform states otherwise, an “EMA” on a chart uses a smoothing value of 2.
The same formula can be rearranged into a form that shows what the EMA actually does on each bar:
EMA(today) = EMA(yesterday) + k × (Price(today) − EMA(yesterday))
In words, the EMA moves a fixed fraction k of the distance between where it was and where price is now. If price closes above the EMA, the EMA rises. If price closes below it, the EMA falls. The bigger the gap, the bigger the move.
Multipliers for common EMA periods
With smoothing set to 2, these are the multipliers for frequently used periods. The multiplier is also the weight the newest price receives.
| EMA period (N) | Multiplier k = 2 ÷ (N + 1) | Weight on latest price | SMA weight on latest price (1 ÷ N) |
|---|---|---|---|
| 5 | 0.3333 | 33.33% | 20.00% |
| 8 | 0.2222 | 22.22% | 12.50% |
| 9 | 0.2000 | 20.00% | 11.11% |
| 10 | 0.1818 | 18.18% | 10.00% |
| 12 | 0.1538 | 15.38% | 8.33% |
| 20 | 0.0952 | 9.52% | 5.00% |
| 26 | 0.0741 | 7.41% | 3.85% |
| 50 | 0.0392 | 3.92% | 2.00% |
| 200 | 0.0100 | 1.00% (0.995%) | 0.50% |
Two patterns stand out. Shorter EMAs weight the newest price more heavily than longer EMAs, and at every length the EMA gives the newest price close to twice the weight an SMA of the same period would give it.
How to Calculate the EMA Step by Step
Because each EMA value needs a previous EMA value, the calculation needs a starting point. The usual method is to seed it with a simple moving average.
- Choose the period (N). For example, 20 periods.
- Calculate the SMA for the first N bars. Add up the closing prices of the first 20 bars and divide by 20. This SMA is treated as the first EMA value.
- Calculate the multiplier. For N = 20, k = 2 ÷ 21 = 0.0952.
- Apply the formula on the next bar. On bar 21, EMA = Close × 0.0952 + Previous EMA × 0.9048.
- Repeat for every new bar, always using the EMA from the bar before.
This is why an EMA needs one more observation than an SMA before it produces a true recursive value: with a 20-day EMA, the 20th day gives you the seed SMA, and the 21st day gives you the first EMA built with the multiplier.
The calculation normally uses closing prices, but the same method works with the open, high, low, median price ((high + low) ÷ 2) or typical price. Some traders build an EMA of highs and an EMA of lows to form a channel around price.
Worked example: a 5-period EMA
The following prices are a hypothetical example chosen to show the mechanics. A short 5-period EMA keeps the arithmetic readable.
- Period: N = 5
- Multiplier: k = 2 ÷ (5 + 1) = 0.3333
- Closing prices for days 1 to 5: 100, 102, 101, 103, 104
Step 1, seed value. The 5-day SMA on day 5 is (100 + 102 + 101 + 103 + 104) ÷ 5 = 510 ÷ 5 = 102.00. This becomes the starting EMA.
Step 2, apply the formula on each new day.
| Day | Close | EMA calculation | 5-period EMA | 5-period SMA |
|---|---|---|---|---|
| 5 | 104 | Seed (SMA) | 102.00 | 102.00 |
| 6 | 106 | 106 × 0.3333 + 102.00 × 0.6667 | 103.33 | 103.20 |
| 7 | 105 | 105 × 0.3333 + 103.33 × 0.6667 | 103.89 | 103.80 |
| 8 | 101 | 101 × 0.3333 + 103.89 × 0.6667 | 102.93 | 103.80 |
| 9 | 99 | 99 × 0.3333 + 102.93 × 0.6667 | 101.62 | 103.00 |
| 10 | 102 | 102 × 0.3333 + 101.62 × 0.6667 | 101.75 | 102.60 |
Day 8 shows the difference between the two averages. Price dropped from 105 to 101. The EMA fell by almost a full point, from 103.89 to 102.93, because the new low close carried a third of the weight. The SMA did not move at all: it gained the 101 close but dropped the 101 close from day 3, so its value stayed at 103.80. By day 9 the EMA sat about 1.4 points below the SMA, reflecting the recent weakness that the SMA was still averaging out.
The shortcut form gives the same result. On day 6, the EMA moves one third of the way from 102.00 toward the close of 106: 102.00 + 0.3333 × 4 = 103.33.
Why the Weights Are “Exponential”
If you expand the recursive formula, every past price turns out to be in the EMA, each with its own weight:
- Today’s price: k
- 1 bar ago: k × (1 − k)
- 2 bars ago: k × (1 − k)²
- n bars ago: k × (1 − k)ⁿ
Each weight is the previous one multiplied by (1 − k). For a 20 EMA, the newest price gets 9.52%, the price one bar earlier gets about 8.62%, the price two bars earlier about 7.80%, and so on, shrinking without ever reaching zero.
This has a few consequences that are not obvious from a chart.
The EMA has a long memory. With k = 2 ÷ (N + 1), roughly 86% of the total weight falls on the most recent N bars and about 14% on everything older. A 20 EMA, in other words, still carries some influence from prices more than 20 bars back, while a 20 SMA carries none.
The average age of the data matches the SMA. The 2 ÷ (N + 1) multiplier is chosen so that the weighted average age of the prices inside an N-period EMA equals that of an N-period SMA, (N − 1) ÷ 2 bars. The EMA’s faster response comes from how the weight is distributed: it concentrates more weight on the newest bars and spreads the rest thinly over a long tail, instead of spreading it evenly and cutting it off.
The starting value lingers. The seed SMA’s influence shrinks by a factor of (1 − k) every bar but never disappears completely. For a 200 EMA, about 13.5% of the seed’s influence remains after 200 bars, and it takes roughly 460 bars to fall to about 1%. Two platforms that start their calculation at different points in history, or seed with the first price instead of an SMA, can show slightly different values for the same long EMA. Daily candles add another source of difference in forex, because brokers close the daily bar at different times of day, so the closes feeding the EMA are not identical.
How to Read an Exponential Moving Average
The EMA line itself carries several pieces of information.
Direction of the slope. A rising EMA means recent prices are, on balance, above the earlier average; a falling EMA means they are below it. In a strong, sustained uptrend the EMA slopes upward, and in a downtrend it slopes downward. A flat EMA suggests a market without a clear direction.
Rate of change of the slope. Steepness matters as much as direction. If an uptrend’s EMA begins to flatten from one bar to the next, upward momentum is fading even though the line is still rising. That flattening often comes before price breaks below the line.
Price position relative to the EMA. Price holding above a rising EMA is the classic picture of an uptrend. Price holding below a falling EMA is the picture of a downtrend. Price crossing back and forth repeatedly suggests a range.
Dynamic support and resistance. Many traders treat a rising EMA as support and a falling EMA as resistance. Under that reading, a pullback toward a rising EMA in an uptrend is a potential buying area, and a rally toward a falling EMA in a downtrend is a potential selling area. The level moves with every bar, unlike a horizontal support line.
Distance from the EMA. When price stretches far above or below its EMA, the move has been fast relative to the recent average. Some traders read a large gap as overextension, but a stretched market can stay stretched, so distance alone is not a reversal signal.
Because the EMA is built only from past prices, these readings confirm what price has already done. They describe the trend and its strength; they do not forecast the next move.
Common EMA Periods and What They Are Used For
There is no single correct EMA period. The choice depends on the timeframe you trade and how much noise you are willing to accept in exchange for speed. The periods below appear most often in charting and trading literature.
8 and 9 EMA
Very short EMAs that hug price closely. The 9 EMA is also the standard signal line in MACD (a 9-period EMA of the MACD line). On a price chart, short-term and intraday traders use 8 or 9 EMAs to track immediate momentum. They react to almost every swing, which makes them responsive and noisy at the same time.
12 and 26 EMA
Often the most quoted short-term EMAs because they form the basis of two widely used indicators. MACD is the 12-period EMA minus the 26-period EMA. The percentage price oscillator (PPO) expresses the same difference as a percentage of the 26 EMA, which makes readings comparable across assets with different price levels.
20 EMA
A common choice for swing traders, sitting between short-term noise and long-term trend. Short-term traders often pair the 8 EMA with the 20 EMA.
50 and 200 EMA
The standard long-term trend references, used more by position traders and longer-term investors. Price crossing its 200-period moving average is widely read as a sign that the long-term trend may be changing. The 50 crossing above or below the 200 is the setup known as a golden cross (bullish) or death cross (bearish); it is often discussed with SMAs but applied to EMAs as well.
The 5, 20, 50 and 200 set
Some traders plot several EMAs at once, for example 5, 20, 50 and 200, to see short-, medium- and long-term direction together. When the lines are stacked in order (5 above 20 above 50 above 200) and fanning apart, the trend is aligned across horizons. When they are tangled and crossing each other, the market lacks a clear trend.
EMA Trading Strategies
The EMA is rarely used as a standalone system. It is more often a filter, a trigger or a reference level inside a broader plan.
Trend filter or trading bias
A higher-timeframe EMA can set the direction you are allowed to trade. For example, if the daily chart shows price above a rising 50 or 200 EMA, an intraday trader might take only long setups on the lower timeframe and ignore short signals. This does not create entries by itself, but it removes trades against the larger trend.
EMA crossovers
A crossover strategy uses two EMAs of different lengths. When the faster EMA crosses above the slower one, the short-term average has moved above the longer-term average, which is read as a bullish signal. A cross below is read as bearish. Common pairs include 9 and 21, 12 and 26, 20 and 50, and 50 and 200. Shorter pairs give earlier signals and more false ones. Longer pairs give fewer, later signals.
A crossover between price and a single EMA works the same way, with price acting as the “fastest” average. It reacts sooner and whipsaws more.
Pullback entries
In an established trend, some traders wait for price to pull back to a rising EMA (in an uptrend) and look for signs that buyers are stepping back in, such as a bullish candle closing back above the line. The EMA marks the area to watch; the entry still needs a trigger and a defined stop-loss.
Combining the EMA with other indicators
Because the EMA measures direction, traders often pair it with tools that measure something else:
- Momentum oscillators such as the Relative Strength Index (RSI) can help judge whether a move toward the EMA is losing or gaining strength.
- Volatility measures such as the Average True Range (ATR) help size stop-losses relative to how much price typically moves, instead of placing stops an arbitrary distance from the EMA.
- Volume-based references such as VWAP add a volume-weighted price level that intraday traders often watch alongside a short EMA.
Whichever signal you use, the position size determines how much a false signal costs. A position size calculator converts a stop distance and risk percentage into lot size, so a stop placed beyond the EMA translates into a defined dollar risk.
EMA vs. SMA (and Other Moving Averages)
The EMA and SMA are read the same way: slope, price position, crossovers and support or resistance all work identically. The difference is how each weights the data, which changes how quickly the line responds.
| Feature | Simple moving average (SMA) | Exponential moving average (EMA) | Weighted moving average (WMA) |
|---|---|---|---|
| Weighting | Equal weight for each price in the window | Weights decline geometrically with age | Weights decline linearly with age |
| Old data | Dropped completely after N bars | Never fully dropped; influence fades | Dropped completely after N bars |
| Weight on newest price (N = 20) | 5.00% | 9.52% | 9.52% (20 ÷ 210) |
| Response to new price changes | Slowest | Faster | Faster |
| Sensitivity to the price leaving the window | Yes, can jump when an old extreme drops out | Minimal | Yes, but the dropped price carries the smallest weight |
| Calculation | Sum ÷ N | Recursive with multiplier | Weighted sum ÷ sum of weights |
The SMA has one quirk worth knowing: because it drops the oldest price abruptly, a large move from N bars ago can shift the SMA today even though nothing happened today. The worked example above shows a related effect in reverse, where the SMA stayed flat on day 8 despite a sharp drop, because the price leaving the window matched the price entering it. The EMA responds only to the relationship between today’s price and its own previous value.
Neither average is better in all conditions. The EMA’s faster response helps you see a turn sooner and is often preferred for intraday and fast-moving markets. The same responsiveness makes it more prone to false signals in choppy conditions. The SMA’s smoother line filters more noise and is often used for long-term levels such as the 200-day average, at the cost of reacting later.
Other relatives of the EMA
- Wilder’s smoothing (also called the smoothed moving average or RMA) uses a multiplier of 1 ÷ N instead of 2 ÷ (N + 1). It is the averaging method inside the RSI and ATR as originally defined. A Wilder average of N periods behaves like an EMA of 2N − 1 periods, so a 14-period Wilder average is equivalent to a 27-period EMA.
- Double and triple EMAs (DEMA, TEMA) combine EMAs of EMAs to reduce lag further. They react faster than a plain EMA and are correspondingly noisier.
- The MACD is not a moving average but is built entirely from EMAs, which makes it the most widely used EMA-derived indicator.
Limitations of the Exponential Moving Average
It lags. Every moving average is built from past prices, so it confirms a trend after it has started. By the time an EMA turns or a crossover triggers, a good part of the move may be over. The EMA reduces this lag compared with an SMA of the same period, but it does not remove it.
It whipsaws in ranges. Moving averages are designed for trending markets. When price moves sideways, it crosses the EMA repeatedly, and crossover systems generate a string of small losing trades. Short EMAs suffer most from this.
The recency weighting is a trade-off. Some traders argue that new data better reflects the current state of the market. Others argue that overweighting the latest bars builds in a bias toward recent noise and leads to more false alarms. Both views describe the same mechanism; which matters more depends on the market and timeframe.
Period choice is arbitrary. There is no objectively correct EMA length. Testing many periods on historical data until one looks profitable risks fitting the indicator to past noise, which may not carry forward. Popular periods are popular largely by convention.
It uses only price. The standard EMA ignores volume, volatility and fundamentals. A move on thin trading counts the same as a move on heavy trading.
Historical data and efficient markets. The EMA relies entirely on past prices. Many economists hold that markets are efficient, meaning current prices already reflect available information. If that holds, past price patterns, and averages built from them, carry no reliable information about future direction. Technical traders dispute how strictly the theory applies, but the debate is a reason to treat EMA signals as conditions to evaluate within a risk-controlled plan, not as predictions.
Values can differ between platforms. As covered above, the seed method, the length of loaded history and the daily candle close time all affect the result, especially for long EMAs. A level that one chart shows exactly at 1.0850 may sit a few pips away on another.
Choosing an EMA Setting
A practical way to choose is to match the EMA to the holding period of your trades:
- Intraday and scalping: 8, 9 or 20 EMA on lower timeframes, often with a higher-timeframe EMA as a trend filter.
- Swing trading: 20 and 50 EMA on four-hour or daily charts.
- Position trading and long-term investing: 50 and 200 EMA on daily or weekly charts.
Shorter settings respond faster and produce more signals, more of them false. Longer settings respond slower and produce fewer, later signals. Running the same setting through past charts, or through a paper trading simulator, shows how it behaves on the specific market you trade before real money is involved, including how often it whipsaws during ranges.
FAQs
What is a good EMA for day trading?
Short EMAs such as the 8, 9 and 20 are common choices for day trading because they track intraday momentum closely. Many day traders pair one of them with a longer EMA, such as the 50 or 200 on the same chart or a daily-chart EMA, to keep trades in the direction of the larger trend.
Why does my EMA value differ from another chart's?
The difference usually comes from the calculation inputs, not the formula. Platforms may seed the EMA differently (with an SMA or with the first price), load different amounts of history, or build daily candles with different closing times. These differences matter most for long EMAs such as the 200, where the starting value takes hundreds of bars to fade.
Can an EMA be used on any market and timeframe?
Yes. The formula works on any price series, so it applies to forex, stocks, crypto, commodities and indexes, and to any bar interval. The period always counts bars, so the same EMA setting covers very different spans of time on a five-minute chart and on a weekly chart.
The Bottom Line
The EMA suits traders who want a trend line that responds quickly, from intraday scalpers to long-term position traders. It confirms trends rather than predicting them, lags after turns and whipsaws in sideways markets. Match the period to your holding time, use it as a filter or reference level within a plan with defined stops and position size, and test a setting on past charts before trading it.















