Exponential moving average (EMA).
An exponential moving average (EMA) is an average of past prices that gives the latest close the most weight. Each period it moves part of the way toward the new price, by a share set by k = 2 ÷ (N + 1). It turns sooner than a simple moving average, but it still lags and gives false signals in sideways markets.
Konten ini baru tersedia dalam bahasa Inggris.

A 20-day simple moving average gives the close from four weeks ago the same say as yesterday's close. An exponential moving average changes that balance: the newest price counts most, and older prices fade out a little at a time.
The result is a line that stays closer to price and turns sooner. That speed has a cost, and the worked example below shows both the gain and the price paid for it.
What makes an EMA different from an SMA?
The simple moving average adds the last N closes and divides by N. Every close inside the window counts equally, and the moment a close leaves the window it counts for nothing.
An exponential moving average (EMA) is an average that weights the latest close most and each older close a fixed fraction less. Old closes never drop out in one step. Their weight keeps shrinking toward zero.
Both lines are a kind of moving average, built only from past prices. The difference is how much say the last few bars get.
How do you calculate an EMA?
Every EMA uses two numbers: the period you choose, called N, and the EMA value from the previous bar. Each new close then updates the line with one short sum.
k = 2 ÷ (N + 1)
New EMA = previous EMA + k × (close minus previous EMA)
The number k is the smoothing factor, the share of the gap between price and the line that the EMA closes each bar. For a 5-period EMA, k = 2 ÷ 6 = 1/3.
For a 20-period EMA, k = 2 ÷ 21, about 0.095. A longer period means a smaller step each bar, so the line moves more slowly.
The first value needs a starting point. A common choice is the SMA of the first N closes. Platforms do not all start the same way, so early values can differ slightly until enough bars have passed.
A 5-period EMA on EUR/USD, step by step
Take five daily closes of EUR/USD, with round illustrative prices: 1.10000, 1.10200, 1.10100, 1.10300 and 1.10400. Their sum is 5.51000, and 5.51000 ÷ 5 = 1.10200.
That SMA is the starting EMA on day 5. With k = 1/3, each new day the line closes one third of the gap to the latest close.
On day 6 the close is 1.10800. The gap is 1.10800 minus 1.10200 = 0.00600, or 60 pips. One third of it is 0.00200, so the new EMA is 1.10200 + 0.00200 = 1.10400.
The next three days use the same rule:
- Day 7 closes at 1.11000. The gap is 1.11000 minus 1.10400 = 0.00600, one third is 0.00200, and the EMA becomes 1.10600.
- Day 8 closes at 1.10900. The gap is 1.10900 minus 1.10600 = 0.00300, one third is 0.00100, and the EMA becomes 1.10700.
- Day 9 closes at 1.10400. The gap is 1.10400 minus 1.10700 = minus 0.00300, one third is minus 0.00100, and the EMA falls to 1.10600.
The table puts a 5-period SMA beside it. Each SMA value is the plain average of the latest five closes, so day 6 uses days 2 to 6.
| Day | Close | 5-period EMA | 5-period SMA |
|---|---|---|---|
| 5 | 1.10400 | 1.10200 | 1.10200 |
| 6 | 1.10800 | 1.10400 | 1.10360 |
| 7 | 1.11000 | 1.10600 | 1.10520 |
| 8 | 1.10900 | 1.10700 | 1.10680 |
| 9 | 1.10400 | 1.10600 | 1.10700 |
On day 7 price closed at 1.11000. The EMA was 40 pips below it and the SMA 48 pips below, so the EMA tracked the rise more closely.
Why did the EMA turn down first on day 9?
Day 9 is where the two lines split. Price fell 50 pips to 1.10400. The EMA dropped from 1.10700 to 1.10600, while the SMA rose from 1.10680 to 1.10700.
The SMA rose because the close leaving its window, 1.10300 from day 4, was lower than the new close of 1.10400. An SMA moves on two prices each day: the one coming in and the one dropping out.
The EMA has no drop-out effect. Its change depends only on the new close and its own previous value, so it falls whenever price closes below it and rises whenever price closes above it.
The EMA still lags. On day 9 it sat 20 pips above price, because two thirds of each new value is the previous line.
How much weight does each close get?
Unroll the formula and each close's share appears. With k = 1/3, the latest close gets one third of the weight, and each older close gets two thirds of the share of the close after it.
In a line that has run for many bars, the latest close gets 33.3%. The closes one to five bars back get 22.2%, 14.8%, 9.9%, 6.6% and 4.4%.
Together the five latest closes carry about 86.8% of the weight, and all older closes share the other 13.2%. A 5-period SMA gives each of its five closes exactly 20% and older closes nothing.
The period sets how fast the weights fall. A 20-period EMA gives the latest close about 9.5%, against 5% in a 20-period SMA. A 200-period EMA gives it about 1%, so a single close barely moves it.
What does the extra speed cost?
Reacting sooner means reacting to noise as well. In a sideways market a short EMA bends with every small swing, and price crosses it back and forth.
Each crossing can look like a signal. In a ranging market, many of them reverse within a few bars, so the faster line tends to give more false signals along with its earlier real ones.
A longer period cuts the noise and brings the lag back. No setting avoids that trade-off, and switching from an SMA to an EMA does not by itself give a trading edge.
Any edge has to come from the rules you build around the line, tested over many trades. The SMA or EMA lesson compares the two averages side by side.
Which EMA periods appear on charts?
You will often see 9, 12, 20, 26, 50 and 200-period EMAs. These are conventions with no special power of their own. The same setting also covers different time on different charts: 20 periods on an hourly chart is 20 hours.
The 12 and 26 have a fixed use. The MACD indicator is built, in its default settings, from the gap between a 12-period and a 26-period EMA of closing prices.
Shorter EMAs follow swings inside a move, and longer ones show the broad direction. Price reacting to an EMA is the idea behind dynamic support and resistance, and two EMAs crossing is the basis of moving average crossovers.
In MetaTrader, add the Moving Average indicator and set its method to Exponential. Check the price field as well: close is the usual default, and open, high, low and median are among the other options.
Pertanyaan
What is the formula for an EMA?
New EMA = previous EMA + k × (close minus previous EMA), where k = 2 ÷ (N + 1). For a 10-period EMA, k = 2 ÷ 11, about 0.18.
Is an EMA better than an SMA?
Neither is better in general. The EMA turns sooner and tends to give more false signals in sideways markets, while the SMA is smoother and slower to react.
Why does my EMA differ from the one on another platform?
Platforms can start the line from different values, apply it to different prices, or use candles that close at different times. Early values differ most, and the gap shrinks as more bars pass.
Does an EMA ever forget old prices?
Not completely, but their weight becomes very small. In a 5-period EMA, all closes older than the latest ten together carry about 1.7% of the weight.
What does the 200 EMA show?
It is an EMA over 200 bars of whatever timeframe you use, with about 1% weight on the latest close. It changes slowly, so it describes the long-run direction and reacts late to turns.
Lanjut belajar
Bab 4What is a moving average?A moving average is the average closing price over a set number of recent candles, recalculated every time a new candle closes. Plotted as a line, it smooths out small price swings so the direction of the trend is easier to see. Because it is built from past prices, it always lags behind the market.
Bab 4Simple moving average (SMA).A simple moving average (SMA) adds the closing prices of the last N candles and divides by N. Each new candle adds one price and drops the oldest, so the line rolls forward. Every price carries equal weight, so one unusually large close lifts the average and moves it again when it drops out.
Bab 4SMA or EMA: which should you use?An SMA gives every price in its window the same weight, so it is smooth but slow to turn. An EMA gives the newest prices more weight, so it turns sooner but reacts more to noise. Neither is better in general: choose by the job and test it on your own charts.
Bab 4Using moving averages to read the trend.A moving average gives two trend readings. Price above the line means the latest close is higher than the average, and price below means lower. The line's slope shows whether the average itself is rising or falling. When both point the same way, the trend reading is clear; when they disagree, it is mixed.
Bab 4Moving average crossovers.A moving average crossover is the moment a fast moving average crosses a slow one. A cross above is read as a buy signal and a cross below as a sell signal. Because both lines are built from past prices, the signal always comes after the turn, and sideways markets produce repeated false crosses.
Bab 4Moving averages as dynamic support and resistance.Dynamic support is a moving average that sits below price in an uptrend and keeps rising with it, so pullbacks sometimes pause near the line. Dynamic resistance is the same idea above price in a downtrend. Treat the line as a rough zone. It is most useful in clear trends and often fails in ranges.
Bab 4Moving averages cheat sheet.A moving average is the average of recent closing prices, recalculated on every new bar. The SMA weights the last N closes equally, and the EMA weights recent closes more, so it reacts faster. Traders use the slope for trend, fast and slow crossovers as signals and the line as moving support or resistance, and every version lags price.