EMA (Exponential Moving Average)
An exponential moving average, or EMA, is a moving average that gives more weight to recent closing prices and less to old ones. Each new bar pulls the line toward the latest close by a fixed fraction, and the influence of older closes fades step by step instead of dropping out of a window all at once. A simple moving average of the same length treats every close in its window equally and then forgets the oldest one overnight. Because the EMA leans on recent prices, it turns sooner when the market turns. The cost is that it also reacts sooner to moves that reverse, so it produces more false signals in choppy markets.
The most common EMA pair is 12 and 26. The gap between the 12-day and the 26-day EMA is the core of the MACD indicator, covered in the MACD entry. Traded as a position switch, the pair says to hold a fund while the 12-day line sits above the 26-day line and to hold cash when it sits below. That rule is the EMA 12/26 trend template on this site. On the first open after the 12-day average moves above the 26-day, it buys with 98% of the sleeve. On the first open after the 12-day average drops below the 26-day, it sells the whole position.
This entry uses that template to show what an EMA rule did on real data. The window is 2021-01-04 to 2026-10-02, which is 5.74 years, with $10,000 starting cash, daily decisions, no margin, and no fees or slippage in the headline runs. The template was run on 59 ETFs. The median CAGR was 2.76%, the median maximum drawdown was 22.87%, and the median Sharpe ratio was 0.42. The median fund had 22 round trips and was invested 59.3% of the time. The rule had a positive CAGR on 41 of 59 funds and a shallower drawdown than buy-and-hold on 54 of 59. It beat buy-and-hold CAGR on 22 of 59.
Those four counts describe the EMA trade in one line. It cut the depth of losses on nearly every fund and gave up return on most of them.
EMA 12/26 Trend across 59 ETFs
Median CAGR 2.8%, median max drawdown −22.9%, ahead of buy-and-hold on 22 of 59 (2021-01-04 to 2026-10-02).
| ETF | CAGR | Buy & hold | Max DD | Round trips |
|---|---|---|---|---|
| SOXL | 26.2% | 33.3% | −65.4% | 22 |
| TECL | 19.8% | 38.2% | −53.5% | 26 |
| SPUU | 19.1% | 22.5% | −22.9% | 21 |
| SOXX | 18.0% | 31.1% | −34.0% | 22 |
| ROM | 17.9% | 30.2% | −42.5% | 23 |
| REW | −18.5% | −36.1% | −71.7% | 22 |
| SQQQ | −24.3% | −42.3% | −82.8% | 21 |
| TECS | −29.4% | −46.7% | −87.8% | 21 |
| UVXY | −39.0% | −48.7% | −96.0% | 19 |
| SOXS | −48.4% | −48.3% | −97.8% | 28 |
The five strongest and five weakest results. All 59.
The table above lists the five strongest and five weakest funds for the template, and the numbers beside it carry most of the story. The strongest fund by CAGR was SOXL at 26.2%, against 33.3% for buy-and-hold, with a maximum drawdown of 65.4% and 22 round trips. TECL returned 19.8% against 38.2% for buy-and-hold. SPUU returned 19.1% against 22.5%, and its drawdown was 22.9%, far shallower than the other leveraged funds near the top. SOXX returned 18.0% against 31.1%, ROM 17.9% against 30.2%, and SSO 17.3% against 21.9%.
Every one of the top six funds trailed its own buy-and-hold CAGR. The EMA rule did not find a fund where it beat holding during a strong uptrend. It found funds where a long uptrend was strong enough that even a rule that sat out part of the time still earned a high return.
The bottom of the table is inverse and volatility funds, where the rule lost less than holding did. UVXY returned minus 39.0% a year with the rule against minus 48.7% for buy-and-hold, and its drawdown was 96.0%. SQQQ returned minus 24.3% against minus 42.3%. TECS returned minus 29.4% against minus 46.7%. REW returned minus 18.5% against minus 36.1%. SOXS was the exception: the rule returned minus 48.4% against minus 48.3% for buy-and-hold, a gap of about nothing, with 28 round trips and a win rate of 7%.
A fund can lose less with the rule than with holding and still be a bad result. The rule's job on a decaying fund is to be out of it most of the time, and the exposure figures show that happening: 19.6% for UVXY, 26.5% for TECS, 27.1% for SQQQ and 29.6% for REW. The remaining time in the market was enough to lose a large share of the account.
How the EMA differs from the SMA
Both averages smooth a price series, and both lag it. The difference is in the weights. An SMA gives each of its last N closes the same weight and ignores everything older. An EMA gives every past close some weight, with the most recent close counting most and each earlier close counting a little less than the one after it. The weight never reaches zero, so a spike from a long time ago keeps a small influence on the line.
For a trading rule the practical result is timing. When a fund turns up after a decline, a 12-day EMA starts rising sooner than a 12-day SMA would, because the new closes carry more weight than the old low closes that an SMA would still be holding. A crossover of two EMAs therefore tends to fire earlier than a crossover of two SMAs of the same lengths. The earlier signal can be a gain when the turn is real. It is a loss when the turn is a one-week bounce inside a downtrend, because the exit signal also fires earlier and the strategy pays the spread between the two prices.
The site tests an SMA pair that is close to the EMA pair in speed. The SMA 10/50 trend template holds while the 10-day SMA is above the 50-day. Across the same 59 funds its median CAGR was 2.12%, its median maximum drawdown was 23.02%, and it made a median of 17 round trips. The EMA 12/26 template had a median CAGR of 2.76%, a median drawdown of 22.87% and 22 round trips. The pairs differ in length as well as in type, so the comparison does not isolate the weighting. It does show that the faster EMA pair traded more often and had a slightly higher median CAGR in this window.
The slowest SMA template, the golden cross, holds while the 50-day average is above the 200-day. Its median was 3 round trips, with a median CAGR of 2.05% and a median maximum drawdown of 21.84%. The 200-day regime filter had a median of 18 round trips and a median CAGR of 1.84%. Ordering the trend templates by trade count gives the golden cross at 3, the SMA 10/50 at 17, the 200-day filter at 18 and the EMA 12/26 at 22. The median CAGR does not rise or fall in a straight line with that ordering, which fits the idea that trade frequency is a property of the rule and does not by itself buy return.
What the year-by-year medians show
The facts for this page include the median result of the EMA 12/26 template for each calendar year, next to the median for buy-and-hold across the same funds. The medians are taken across all 59 funds.
In 2021 the template's median return was 0%, against 4.1% for buy-and-hold, and 28 funds finished the year positive. The rule starts with no position, so it spent the first weeks of the window waiting for the 12-day line to cross above the 26-day. In 2022, the bear market year, the template's median return was minus 8.3% against minus 12.7% for buy-and-hold, and only 15 funds finished positive. That is the year where the rule did its intended work. It lost less than holding, though it still lost.
In 2023 the template returned a median of 7.0% against 8.9% for buy-and-hold, with 44 funds positive. In 2024 the gap widened: the template returned 1.7% against 9.7%, with 33 funds positive. In 2025 the template returned 5.8% against 11.1%, with 39 funds positive. In 2026, a partial year in the data, the template returned 2.8% against 3.7%, with 36 funds positive.
The pattern across the six rows is consistent. The rule beat holding in the one year when most funds fell, and trailed holding in the four full years when most funds rose. A median EMA 12/26 trader in this window would have preferred the rule in 2022 and buy-and-hold in 2023, 2024 and 2025. The test cannot say whether that split would repeat, since it covers one bear market. The pattern is the standard shape of a trend rule: it buys after a rise has started and sells after a fall has started, so it gives up the first part of every move in both directions.
The SPY and QQQ profiles on this site show how large the 2022 episode was for broad index funds. SPY fell 24.51% from its peak on 2022-01-03 to its trough on 2022-10-12, and its calendar-year return for 2022 was minus 18.16%. It did not recover its peak until 2023-12-13. QQQ fell 35% from 2021-11-19 to 2022-11-03 and recovered on 2023-12-12. A trend switch that exits during a drop of that length has a chance to reduce the damage. The trend rule only helps if the exit comes early enough in the decline, which is a question of the lag in the average.
Results by fund category
The facts group the 59 funds into nine categories and give the median for each, which shows where the EMA switch fit and where it did not.
Broad index ETFs, 12 funds, had a median CAGR of 7.85% for the rule against 14.42% for buy-and-hold, and a median maximum drawdown of 16.81%. The rule beat buy-and-hold on none of the 12. Sector ETFs, 6 funds, had a median of 5.80% against 12.58%, with a median drawdown of 23.98%, and the rule beat holding on none. Alternative-strategy ETFs, 6 funds, had 4.27% against 7.61% and a median drawdown of 16.15%, again none ahead of holding. The single commodity ETF returned 12.50% against 13.66% with a drawdown of 14.97%.
Leveraged ETFs, 10 funds, had a median CAGR of 17.30% against 23.55% for buy-and-hold, and a median drawdown of 49.92%. The rule beat holding on 2 of the 10. Large positive returns with large drawdowns are the usual pattern for leveraged funds, and the EMA switch kept the shape without adding return.
The categories where the rule did well relative to holding were the ones with falling prices. Inverse ETFs, 11 funds, had a median CAGR of minus 12.74% for the rule against minus 21.57% for buy-and-hold, with a median drawdown of 56.94%, and the rule beat holding on 9 of 11. Volatility products, 3 funds, had minus 12.95% against minus 16.06% and a median drawdown of 58.55%, with the rule ahead on all 3. Bond ETFs, 7 funds, had a median CAGR of 1.02% against minus 0.78% and a very shallow median drawdown of 4.96%, with the rule ahead on 6 of 7. Currency ETFs, 3 funds, had 1.32% against minus 0.90% and a median drawdown of 9.91%, with the rule ahead on 2 of 3.
The table of categories splits cleanly. The rule trailed holding on every category where holding earned a solid positive return, and led holding on the categories where holding lost money or earned very little. This is what a switch that spends part of its time in cash is expected to do, and the numbers show its size. The rule's median result across bond funds was positive while the same funds lost money on a buy-and-hold basis, but a median of 1.02% a year is a small return.
Faster and slower EMA pairs
The facts include three variants of the template, each run on all 59 funds, which show what changed when the pair was moved. The base pair is 12/26.
- EMA 8/21: median CAGR 2.87%, median maximum drawdown 22.57%, median round trips 31.
- EMA 12/50: median CAGR 2.10%, median maximum drawdown 23.56%, median round trips 16.
- EMA 20/50: median CAGR 1.17%, median maximum drawdown 25.29%, median round trips 12.
The base 12/26 pair had a median CAGR of 2.76%, a median drawdown of 22.87% and a median of 22 round trips. The fastest pair, 8/21, made more trades than any other variant and had the highest median CAGR and the shallowest median drawdown of the four. The slowest pair, 20/50, made the fewest trades and had the lowest median CAGR and the deepest median drawdown.
Over this window, then, speed was rewarded. Each step toward a slower average cost some return and added some drawdown, since the slower line takes longer to confirm a fall. The step from 12/26 to 12/50 changes only the slow line, and the median CAGR fell from 2.76% to 2.10% while round trips fell from 22 to 16. That shows the slow line matters as much as the fast one.
One caution applies. Differences of under one percentage point in a median across 59 funds, from one window of 5.74 years, are small relative to the spread between funds. The best fund in the table returned 26.2% and the worst returned minus 48.4%. The variants are useful for seeing the direction of the effect and not for picking a winner. A pair chosen because it had the highest median in this window has been selected on the same data it is judged on.
What an EMA does on different kinds of fund
The market profiles on this site show why an EMA crossover works differently from one fund to the next. The quantity that matters most is how often a fund trends and how often it reverses within a few weeks.
SPY was above its 200-day average on 77.99% of sessions and crossed that average 30 times in the window. Its CAGR was 15.20% with annualized volatility of 16.41%. QQQ was above its 200-day average on 75.18% of sessions and crossed it 20 times, with a CAGR of 17.39% and volatility of 22.39%. A fund that spends three quarters of the window above a long average is a fund where an EMA switch is mostly in the market, and the loss against holding comes from the exits that were followed by recoveries.
TLT is the opposite case. It was above its 200-day average on only 35.18% of sessions and crossed it 95 times. Its CAGR was minus 8.64%, its total return was minus 40.49%, and its maximum drawdown was 44.06%, from the first day of the window to 2023-10-19. A fund that crosses a long average 95 times in under six years is a fund with many reversals, and the EMA 12/26 rule on the long-bond fund TMF, the leveraged cousin, returned minus 13.9% a year against minus 31.16% for holding, with a win rate of 27% and exposure of 35.3%.
IWM sat between the two. It was above its 200-day average on 63.29% of sessions with 34 crossings, a CAGR of 8.03%, and a maximum drawdown of 31.92% from 2021-11-08 to 2022-06-16 that did not recover until 2024-11-06. TQQQ had a CAGR of 26.86%, volatility of 67.11% and a maximum drawdown of 81.68%, and was above its 200-day average on 69.48% of sessions.
UVXY lost 99.94% over the window and was above its 200-day average on 4.18% of sessions. An EMA pair applied to it is rarely long, and when it is long, the fund is usually falling back. The template's exposure on UVXY was 19.6% and its win rate was 16%.
Daily noise is part of this too. The lag-1 autocorrelation of daily returns was minus 0.02 for SPY, minus 0.04 for QQQ and minus 0.05 for TLT. All three are close to zero and slightly negative, which means a down day was followed by a slightly better than even chance of an up day. Trend rules do not depend on daily autocorrelation, since they act on weeks of data. The small negative values do say that short-term noise did not push in the trend's favour.
Where the EMA rule fits among the other templates
The site tests twelve rule templates on the same 59 funds. Placing the EMA switch among them clarifies what kind of rule it is.
The median CAGR for the twelve was, in order from highest, 6.61% for the weekly 7% target, 5.46% for the monthly cycle, 4.74% for RSI(2) snapback, 2.98% for RSI mean reversion, 2.76% for the EMA 12/26, 2.61% for the trend with trailing stop, 2.12% for the SMA 10/50, 2.05% for the golden cross, 1.84% for the 200-day filter, 1.33% for the dip buyer, and 0% for both the momentum breakout and the 3-month momentum.
The EMA 12/26 sits in the middle of the group for CAGR and ahead of the other moving-average trend rules. On the count of funds that beat buy-and-hold it had 22 of 59, which is more than the 21 of the SMA 10/50 and fewer than the 27 of the golden cross and the 26 of the 200-day filter. The weekly 7% target and the RSI(2) snapback both beat holding on 34 funds. Those are the highest counts in the group.
The EMA rule also traded more than the other trend rules. Its median of 22 round trips sits next to the 166 for RSI(2) snapback and the 106 for the weekly target, which trade far more often with short holds. A trade count of 22 across 5.74 years is about one round trip every few months, and each round trip is a decision to leave and re-enter. When fees and slippage are added, rules with many trades pay more, so the 5 and 10 basis point cost runs on each strategy page are the place to see the effect for a specific fund.
Limits of this test
Every result on this page is a hypothetical backtest. The window runs from 2021-01-04 to 2026-10-02 and includes one bear market, in 2022, and a long recovery. The EMA rule was tested with daily decisions on adjusted prices, and fills were on minute bars at the open. The headline numbers include no fees or slippage. The rule invests 98% of the sleeve and uses no margin.
The window is short for a rule with a median of 22 round trips. A fund's result can depend heavily on one or two trades near a turning point, and the 59-fund medians smooth over that but do not remove it. The categories have between 1 and 12 funds each, and a median over 3 funds is a weak statement. The parameter variants and categories are described in what they showed. None of it forecasts what an EMA rule will do from here.
An EMA is a description of past prices. The 12/26 pair has no information about what comes next except that recent closes have been higher or lower than older ones. The tests above measure whether acting on that description would have helped in this window. They give a picture of cost and benefit for each type of fund and cannot say what the next window will be. The whipsaw entry covers the false-signal cost in more detail, and the moving average crossover entry explains the general form of the rule.
Frequently asked questions
What is an EMA in trading?
An EMA is an exponential moving average, a moving average that weights recent closes more heavily than old ones. It reacts faster than a simple moving average of the same length. On this site the EMA 12/26 pair is tested as a long or flat switch on 59 ETFs from 2021-01-04 to 2026-10-02.
What is the difference between an EMA and an SMA?
An SMA weights every close in its window equally and drops the oldest close when the window moves. An EMA gives all past closes some weight and counts the newest most, so it turns sooner. The EMA 12/26 template made a median of 22 round trips and the SMA 10/50 made 17.
What do the 12 and 26 in EMA 12/26 mean?
They are the lengths of the fast and slow averages, in days. The gap between them is the core of the MACD indicator. The template holds a fund while the 12-day EMA is above the 26-day EMA and sells the whole position when it falls below.
Did the EMA 12/26 rule beat buy-and-hold?
On 22 of the 59 funds it did, and on most of the rest it trailed. Its median CAGR was 2.76% and its median maximum drawdown was 22.87%. It had a shallower drawdown than buy-and-hold on 54 of 59 funds.
Is a faster EMA pair better?
In this window, yes, by a small margin. The 8/21 pair had a median CAGR of 2.87% against 2.76% for 12/26 and 1.17% for 20/50. The gaps are small next to the spread between funds, and they come from one window of 5.74 years.
Does an EMA crossover work on leveraged and inverse funds?
On leveraged ETFs the rule had a median CAGR of 17.30% against 23.55% for buy-and-hold and a median drawdown of 49.92%. On inverse ETFs it lost less than holding on 9 of 11 funds, though the median CAGR was still minus 12.74%.
Backtested on 59 ETFs over 5.7 years with real engine results and a buy-and-hold comparison on every page.
Related terms
Backtests are hypothetical, computed by DeployQuant's engine on minute-resolution consolidated US market data (2021-01-04 to 2026-10-02, $10,000 starting capital, no margin, no fees or slippage in the headline run; buy-and-hold puts 98% of the account in at the first open, as the templates do) and do not guarantee future results. Nothing on this page is investment advice. Live trading involves risk of loss.