Home / Glossary / What is the exponential moving average (EMA)?

What is the exponential moving average (EMA)?

The exponential moving average, or EMA, is a moving average that gives more weight to recent prices than to old ones, so it follows price faster than a simple moving average of the same length. Each new value is the latest close times a smoothing factor plus the previous EMA times one minus that factor.

Ten sample closes rising from 10 to 16 and back to 15, with the 5 period EMA and SMA lines from the fifth close. The EMA reacts faster: it is above the SMA while price climbs to 16 and below it after the fall to 15, reading 14.48 against 14.6 at the tenth close.

Across five markets and six holding periods, which is 30 cases of the 9 and 21 period EMA crossover on hourly bars from October 2016 to October 2026, with between 308 and 2,641 non overlapping cases each, 9 averaged above zero after costs, 0 were beyond what chance alone produces in the winning direction, and 0 in the losing direction. The EMA crossover showed no reliable edge on these five markets (signal matrix v1). Past results, not a forecast.

Last updated 26 Nov 2026. Reviewed by the Custom Trading Platform education desk. Worked figures are sample arithmetic, shown in full. Test figures are results from our own tests on past data, with their cases, period and cost.

The short answer in four lines

  • The EMA is an average that fades old prices gradually instead of dropping them at a fixed cutoff.
  • A 9 period EMA reacts faster than a 21 period EMA, and both react faster than a simple average of the same length.
  • Traders read price above a rising EMA as an uptrend and an EMA crossing another as a possible change. Those are readings, not signals.
  • In our tests the 9 and 21 EMA crossover showed no reliable edge.

The formula

  • The smoothing factor, alpha, equals 2 divided by (period plus 1). For a 5 period EMA, alpha is 2 divided by 6, which is 0.3333.
  • Start the first EMA at the simple average of the first period closes.
  • Each later EMA equals (the close times alpha) plus (the previous EMA times (1 minus alpha)).
  • The weight of a close falls by the factor (1 minus alpha) each step back, so the weights are alpha, alpha times (1 minus alpha), and so on, and they add to 1.

Worked example against the simple moving average (sample numbers)

Ten closes: 10, 11, 12, 11, 13, 14, 13, 15, 16 and 15, period 5, so alpha is 0.3333. The first EMA is the average of the first five closes: (10 + 11 + 12 + 11 + 13) divided by 5, which is 11.4.

Close numberCloseEMA 5WorkingSMA 5
51311.4(10 + 11 + 12 + 11 + 13) / 511.4
61412.2714 x 0.3333 + 11.4 x 0.666712.2
71312.5113 x 0.3333 + 12.2667 x 0.666712.6
81513.3415 x 0.3333 + 12.5111 x 0.666713.2
91614.2316 x 0.3333 + 13.3407 x 0.666714.2
101514.4815 x 0.3333 + 14.2272 x 0.666714.6

The weights on the latest five closes in the EMA are 0.3333, 0.2222, 0.1481, 0.0988 and 0.0658, which add to 0.8683. The remaining 0.1317 sits on all older closes, so the EMA still remembers them. The simple average gives each of its five closes a weight of 0.2 and forgets everything older. At the sixth close the EMA moves up by 0.87 and the SMA by 0.8, because the new close of 14 is above the average and carries more weight in the EMA.

EMA against SMA

EMASMA
WeightsFalling with age, never reaching zeroEqual inside the window, zero outside
ReactionFasterSlower
Whipsaws in a rangeMoreFewer
Needs a starting valueYes, usually the first SMANo
Common lengths9, 12, 21, 26, 50, 20020, 50, 100, 200

What we tested: the 9 and 21 EMA crossover

Engine: signal matrix v1 (what happened after the textbook rule, over all history). The rule buys at the next open when the 9 period EMA crosses above the 21 period EMA and sells when it crosses below, on closed hourly bars, and measures the move 4, 12, 24, 50, 72 and 168 bars later. Events are counted only when they do not overlap. The unseen data check is the last 730 days against the earlier years, and the luck check is the beyond chance column. These are results from past data on the markets and dates shown. They describe what happened. They do not predict what will happen and are not advice or a signal.

MarketHorizon (bars)Cases (n)Average move before costsCostAverage move after costsShare ending ahead after costsEarlier years, after costsLast 730 days, after costsBeyond chance?
AUDUSD hourly42,3640.31.17minus 0.8746.9minus 0.87minus 0.91no (t 0.79)
AUDUSD hourly121,807minus 0.031.17minus 1.246.9minus 1.14minus 1.42no (t minus 0.04)
AUDUSD hourly241,334minus 0.181.17minus 1.3548.5minus 0.93minus 2.96no (t minus 0.16)
AUDUSD hourly508631.591.170.4250.30.161.88no (t 0.78)
AUDUSD hourly72656minus 4.731.17minus 5.948minus 6.16minus 4.87no (t minus 1.66)
AUDUSD hourly1683314.751.173.5850.5minus 2.2315.56no (t 0.77)
EURUSD hourly42,318minus 0.261.119minus 1.3845.4minus 1.54minus 0.74no (t minus 0.55)
EURUSD hourly121,764minus 0.881.119minus 247.3minus 2.14minus 1.47no (t minus 1.04)
EURUSD hourly241,320minus 1.591.119minus 2.7146.9minus 2.35minus 4.1no (t minus 1.16)
EURUSD hourly508511.231.1190.1150.10.19minus 0.19no (t 0.49)
EURUSD hourly72653minus 0.441.119minus 1.5650.5minus 1.21minus 2.94no (t minus 0.13)
EURUSD hourly1683252.141.1191.0251.71.8713.53no (t 0.31)
GBPUSD hourly42,285minus 0.631.241minus 1.8845.7minus 2.05minus 1.2no (t minus 1.03)
GBPUSD hourly121,7641.851.2410.6149.30.431.34no (t 1.65)
GBPUSD hourly241,318minus 11.241minus 2.2448.4minus 2.880.39no (t minus 0.56)
GBPUSD hourly508521.141.241minus 0.149.4minus 1.535.41no (t 0.34)
GBPUSD hourly72653minus 4.881.241minus 6.1247minus 6.19minus 4.45no (t minus 1.09)
GBPUSD hourly1683296.181.2414.94486.08minus 0.19no (t 0.61)
XAUUSD hourly42,2322.231.7730.4647.4minus 0.624.77no (t 0.86)
XAUUSD hourly121,6916.21.7734.4347.42.4112.65no (t 1.28)
XAUUSD hourly241,2507.351.7735.5749.51.5321.6no (t 0.81)
XAUUSD hourly50807minus 3.631.773minus 5.449.1minus 8.88.45no (t minus 0.2)
XAUUSD hourly72626minus 7.981.773minus 9.7549.5minus 11.810.04no (t minus 0.39)
XAUUSD hourly1683081.441.773minus 0.3348.1minus 8.9minus 32.17no (t 0.04)
BTCUSD hourly42,641minus 0.021minus 1.0240.2minus 1.17minus 0.58no (t minus 0.08)
BTCUSD hourly121,992minus 0.741minus 1.7443.2minus 1.82minus 1.51no (t minus 1.31)
BTCUSD hourly241,503minus 0.811minus 1.8148minus 2.450.13no (t minus 0.84)
BTCUSD hourly509540.481minus 0.5249.2minus 1.832.92no (t 0.27)
BTCUSD hourly727360.051minus 0.9549.3minus 2.072.02no (t 0.02)
BTCUSD hourly168367minus 5.211minus 6.2149.6minus 10.981.86no (t minus 1)

How to read the table. A pip is 0.0001 for AUDUSD, EURUSD and GBPUSD, 0.1 dollar for XAUUSD and 0.1 of one percent of the price for BTCUSD, so move sizes are not comparable across markets, only the sign and the share ending ahead are. Cost per round trip, in the same pips: AUDUSD 1.17, EURUSD 1.119, GBPUSD 1.241 (measured average spread plus 0.4 slippage plus 0.7 commission), XAUUSD 1.773 and BTCUSD 1.0 (assumptions, and a tick level spread read would refine them). Swap is not included. Data runs from October 2016 for the currency pairs and gold, and from August 2017 for BTCUSD, to October 2026. A row is beyond chance when its t statistic is larger than the 95th percentile of the best result found by shuffling event dates (AUDUSD 3.74, EURUSD 3.98, GBPUSD 3.75, XAUUSD 4.09, BTCUSD 3.85), because each market tested 528 signal and horizon cells and some look good by chance. These tests were run with a flat cost per market and have not been checked independently by a second person.

What it cannot tell you

An EMA lags price, because it is built from past closes, and a crossover is only seen after the move has begun. In a sideways market the 9 and 21 EMAs cross again and again, and each crossing carries the cost of a trade. A longer or shorter pair of lengths gives different crossings, and we tested only 9 and 21.

Sources and method

Worked figures are sample arithmetic, shown in full, as of 26 Nov 2026, and each EMA row was recomputed by a second method before it was kept. The test figures come from the signal matrix v1 run of 26 Nov 2026 in a copy of our engine, with a manifest, on hourly bars to October 2026. How we check numbers is on the methodology page, the people behind the site are on the about page, and corrections go through contact.

How we will test it

We will recompute every EMA row in a second spreadsheet, repeat with a period of 9 and 21 on a second set of sample closes, recalculate the crossover table from the manifest, and repeat after the next data update. Last tested: not yet, results pending.

Questions people type

What is the exponential moving average? An average of recent closes in which each older close counts a little less than the one after it.

How do you calculate the EMA? Multiply the latest close by alpha, which is 2 divided by (period plus 1), and add the previous EMA times (1 minus alpha), starting from a simple average.

What is the difference between EMA and SMA? The EMA weights recent prices more and reacts faster. The SMA weights every close in the window equally.

What is the best EMA setting? There is no best setting. Common lengths are 9, 12, 21, 26, 50 and 200, and the 9 and 21 crossover showed no reliable edge in our tests.

What does the 200 EMA show? The slow trend over about 200 periods. See the 200 day moving average test.

Is the EMA crossover a good strategy? In our tests on five markets the 9 and 21 crossover did not show a reliable edge, and each crossing costs the spread.

Does the EMA predict price? No. It summarises past closes.

Related

Glossary, moving average crossover test, golden cross test, 200 day moving average test, MACD indicator test, RSI guide, volatility calculator, position size calculator, disclaimer.

Start free: create a free account to get the weekly note on tools and tests.

Education only. Nothing here is financial advice or a signal.

More: all indicator guides, glossary.