EMA 12/26 Trend
Hold while the 12-day exponential average is above the 26-day, the core of the MACD used as a position switch.
EMA 12/26 Trend is a long/flat switch. It buys with 98% of the sleeve when the 12-day exponential average closes above the 26-day, and it sells the whole position when the 12-day falls below the 26-day. Both checks happen at the market open. There are no stops, no targets and no position sizing beyond the single 98% order.
The test ran the same two rules on 59 ETFs from 2021-01-04 to 2026-10-02, a window of 5.7 years, starting each with $10,000. The headline run charges no fees or slippage. Across the 59 funds the median CAGR was 2.76% and the median max drawdown was 22.87%. The rules beat buy-and-hold of the same fund in 22 of 59 cases. The median fund spent 59.3% of the window invested and made 22 round trips.
Those medians hide a split that matters more than the average. On broad index ETFs and sector ETFs the switch finished behind holding every time. On inverse ETFs, bond ETFs and volatility products it finished ahead most of the time, mostly because the fund it was applied to lost money while held. The full list of strategies has the other eleven templates run on the same universe.
The rules
- WHEN the market opens · IF not invested AND EMA(12) > EMA(26) · THEN buy with 98% of the sleeve
- WHEN the market opens · IF invested AND EMA(12) < EMA(26) · THEN sell the whole position
The 12/26 exponential moving average pair is the core of the MACD indicator. Exponential averages weight recent days more than simple averages, so this crossover reacts faster than an SMA pair of the same length. Used as a long/flat switch, it gives you a position you can hold and measure.
Good for: traders who like MACD logic but want it expressed as a simple, testable long/flat rule.
Watch out: faster reaction means more trades and more whipsaws than a 50/200 cross; check the trade count on each backtest page.
What the two rules do to a position
The exponential average gives more weight to recent closes than a simple average of the same length. The 12-day line therefore turns quickly after a change of direction, and the 26-day line turns a little later. The rule trades the sign of the gap between them, which is the line the MACD indicator draws before it adds a signal line. A fund that rises for a few weeks puts the 12-day above the 26-day. A fund that stalls and drifts lower pulls the 12-day back under.
The reaction speed is the main property of this template. The golden cross waits for a 50-day average to cross a 200-day average and so trades rarely. The 200-day regime filter compares price with one long average. The EMA pair is much faster than either, and the trade count shows it: the median fund made 22 round trips in 5.7 years, and the busiest funds made 31 (VIXM), 30 (RINF) and 29 (VXZ). SGOV made the fewest at 17.
A fast crossover has two failure modes. In a sideways market the two lines cross repeatedly, and each cross is a small loss from selling lower than the previous buy. In a sharp reversal the signal arrives after part of the move has already happened, so the exit is late and the re-entry is later still. The win rate column in the results table shows the first problem. The median fund won a minority of its round trips on funds that chop, such as IEF at 19%, and a majority on funds that trended cleanly, such as VOO and SPY at 58% and VTV at 67%.
The rule is long only and unlevered. It never shorts. When the signal is off the sleeve sits in cash and earns nothing in this test. That choice affects the bond and currency results, covered under fund types below.
Build it from blocks (or type it in English), backtest it on 5.7 years of minute data in seconds, tweak any parameter, then paper trade it on live data. No card, no broker needed to start.
Results on every ETF
| ETF | CAGR | buy & hold | max DD | Sharpe | trades | win rate |
|---|---|---|---|---|---|---|
| SOXL | 26.2% | 33.3% | −65.4% | 0.69 | 22 | 36% (+1 open) |
| TECL | 19.8% | 38.2% | −53.5% | 0.62 | 26 | 38% (+1 open) |
| SPUU | 19.1% | 22.5% | −22.9% | 0.95 | 21 | 48% (+1 open) |
| SOXX | 18.0% | 31.1% | −34.0% | 0.77 | 22 | 50% (+1 open) |
| ROM | 17.9% | 30.2% | −42.5% | 0.66 | 23 | 39% (+1 open) |
| SSO | 17.3% | 21.9% | −22.9% | 0.87 | 21 | 43% (+1 open) |
| TQQQ | 15.3% | 25.4% | −49.9% | 0.55 | 25 | 36% (+1 open) |
| CLSE | 14.0% | 19.5% | −10.2% | 1.29 | 21 | 48% (+1 open) |
| IAU | 12.5% | 13.7% | −15.0% | 0.89 | 23 | 48% |
| IOO | 10.9% | 16.7% | −15.8% | 0.99 | 22 | 45% (+1 open) |
| QLD | 10.8% | 23.6% | −38.1% | 0.51 | 24 | 38% (+1 open) |
| VOO | 10.3% | 14.4% | −11.8% | 0.99 | 19 | 58% (+1 open) |
| SPY | 10.2% | 14.6% | −11.8% | 0.98 | 19 | 58% (+1 open) |
| VV | 9.8% | 14.3% | −13.4% | 0.94 | 20 | 55% (+1 open) |
| XLK | 9.8% | 22.1% | −25.6% | 0.64 | 23 | 35% (+1 open) |
| VOOG | 8.9% | 15.7% | −16.8% | 0.73 | 24 | 38% (+1 open) |
| FAS | 8.7% | 18.3% | −59.8% | 0.42 | 22 | 36% |
| QQQ | 7.8% | 16.7% | −23.9% | 0.61 | 22 | 41% (+1 open) |
| QQQM | 7.8% | 16.7% | −24.1% | 0.60 | 22 | 41% (+1 open) |
| VOOV | 7.7% | 12.6% | −15.5% | 0.83 | 21 | 52% |
| TBF | 7.6% | 12.2% | −18.0% | 0.68 | 25 | 48% (+1 open) |
| VTV | 7.3% | 13.4% | −16.5% | 0.81 | 21 | 67% |
| VOX | 5.8% | 9.1% | −19.4% | 0.50 | 24 | 46% (+1 open) |
| XLF | 5.6% | 12.6% | −24.0% | 0.52 | 25 | 56% |
| KMLM | 5.1% | 7.1% | −22.0% | 0.52 | 20 | 40% (+1 open) |
| ALTY | 4.3% | 7.6% | −14.4% | 0.66 | 20 | 45% |
| SGOV | 3.2% | 3.2% | −0.1% | 13.86 | 17 | 47% (+1 open) |
| USDU | 3.2% | 5.2% | −4.3% | 0.69 | 23 | 52% (+1 open) |
| CTA | 3.1% | 8.9% | −19.1% | 0.28 | 19 | 32% (+1 open) |
| QAI | 2.8% | 3.9% | −7.3% | 0.64 | 20 | 45% |
| XLY | 2.4% | 6.3% | −21.3% | 0.23 | 28 | 36% |
| IGIB | 2.4% | 0.2% | −5.3% | 0.58 | 20 | 35% |
| QQQE | 1.9% | 9.8% | −20.1% | 0.21 | 25 | 36% (+1 open) |
| FXE | 1.3% | −0.9% | −11.6% | 0.29 | 21 | 29% |
| XLP | 1.2% | 5.8% | −22.8% | 0.17 | 27 | 48% |
| AGG | 1.1% | −0.8% | −4.9% | 0.30 | 22 | 36% |
| BND | 1.0% | −0.8% | −5.0% | 0.29 | 22 | 36% |
| UDN | 1.0% | −1.1% | −9.9% | 0.23 | 22 | 23% |
| IEI | 0.9% | −0.4% | −4.2% | 0.30 | 20 | 35% |
| EEM | 0.3% | 6.6% | −31.8% | 0.09 | 25 | 32% (+1 open) |
| IWM | 0.2% | 7.5% | −34.0% | 0.09 | 25 | 36% |
| RINF | −0.2% | 6.6% | −16.1% | 0.02 | 30 | 40% (+1 open) |
| IEF | −0.4% | −2.3% | −10.6% | -0.06 | 26 | 19% |
| TLT | −0.7% | −8.2% | −15.9% | -0.03 | 21 | 29% |
| UST | −2.5% | −8.5% | −23.3% | -0.23 | 26 | 27% |
| SPDN | −3.8% | −9.7% | −25.5% | -0.26 | 21 | 24% (+1 open) |
| SH | −3.9% | −10.0% | −24.6% | -0.28 | 20 | 25% (+1 open) |
| PSQ | −6.7% | −13.8% | −39.8% | -0.34 | 21 | 14% |
| SDS | −6.9% | −21.6% | −39.4% | -0.19 | 20 | 25% |
| VXZ | −11.3% | −15.1% | −53.7% | -0.46 | 29 | 17% |
| EEV | −12.7% | −16.1% | −56.9% | -0.37 | 23 | 26% |
| VIXM | −12.9% | −16.1% | −58.5% | -0.49 | 31 | 10% |
| QID | −13.6% | −29.5% | −61.6% | -0.30 | 24 | 17% |
| TMF | −13.9% | −31.2% | −65.1% | -0.47 | 26 | 27% |
| REW | −18.5% | −36.1% | −71.7% | -0.38 | 22 | 18% |
| SQQQ | −24.3% | −42.3% | −82.8% | -0.35 | 21 | 14% |
| TECS | −29.4% | −46.7% | −87.8% | -0.45 | 21 | 14% |
| UVXY | −39.0% | −48.7% | −96.0% | -0.41 | 19 | 16% |
| SOXS | −48.4% | −48.3% | −97.8% | -0.65 | 28 | 7% |
Where the switch finished ahead and where it finished behind
The 59-fund table is sorted by CAGR. At the top is SOXL at 26.2%, followed by TECL at 19.8%, SPUU at 19.1% and SOXX at 18.0%. None of these beat holding the fund. SOXL held would have returned 33.3% a year over the window, TECL 38.2%, SPUU 22.5% and SOXX 31.1%. The switch earned a smaller share of a very large number.
The pattern repeats across the trend-friendly funds. SPY returned 10.2% a year under the rules against 14.6% for buy-and-hold, with a max drawdown of 11.8%. VOO returned 10.3% against 14.4%. The SPY page for this strategy lists every trade. The drawdown figures are the trade: the rules gave up some return and carried a shallower drawdown on most of these funds, but in a window where the market mostly rose the exposure of 71.2% on SPY meant sitting out about a quarter of the days.
The summary counts show the same thing. The rules had a shallower drawdown than buy-and-hold in 54 of 59 funds and a positive CAGR in 41 of 59. They beat buy-and-hold on CAGR in 22 of 59. A fund where holding produced a loss gave the switch an easy comparison, and the 22 wins came almost entirely from that group.
The weakest results were on the funds that fall most. SOXS lost 48.38% a year, a little behind the 48.27% loss from holding it, and its win rate was 7% over 28 round trips with 25.5% exposure and a 97.76% drawdown. UVXY lost 39.04% a year with a 96.01% drawdown and 16% winning trades. TECS lost 29.40% and SQQQ 24.32%, both well ahead of holding at 46.67% and 42.33% losses, and both still deep in drawdown at 87.83% and 82.80%. TBF was the other fund behind its buy-and-hold figure, at 7.60% against 12.21%. Applying a trend rule to a fund that decays by design does not turn it into a good holding. It shortens the time spent in it.
Limits of the test
The window is 5.7 years, from 2021-01-04 to 2026-10-02. It contains one major bear market, in 2022, and one long recovery. A trend switch earns its keep in long, deep declines, and this window gives it one. A different window with more declines or fewer would change the ranking.
The headline run has no fees and no slippage. Orders fill on minute bars at the open check. The cost runs on the individual backtest pages add 5 and 10 basis points per trade. With about 22 round trips per fund the cost effect is modest on liquid ETFs, and larger on the thin ones.
Prices in trade lists are adjusted for splits and dividends, so they read lower than the quotes printed at the time. The strategy holds cash with no interest while flat, and the cash earned nothing here. The SGOV result shows what that omission is worth on a fund that tracks short rates: 3.21% a year against 3.22% for holding, the same, because that fund was invested 95% of the time.
Nothing here is a forecast. The tables describe what the rules did to these funds in this window, and the winners in one window are frequently different funds in the next.
Results by fund type
| Fund type | ETFs | Median CAGR | Median buy & hold | Median max DD | Beat holding |
|---|---|---|---|---|---|
| Broad index ETFs | 12 | 7.8% | 14.4% | −16.8% | 0 of 12 |
| Sector ETFs | 6 | 5.8% | 12.6% | −24.0% | 0 of 6 |
| Leveraged ETFs | 10 | 17.3% | 23.6% | −49.9% | 2 of 10 |
| Inverse ETFs | 11 | −12.7% | −21.6% | −56.9% | 9 of 11 |
| Bond ETFs | 7 | 1.0% | −0.8% | −5.0% | 6 of 7 |
| Commodity ETFs | 1 | 12.5% | 13.7% | −15.0% | 0 of 1 |
| Currency ETFs | 3 | 1.3% | −0.9% | −9.9% | 2 of 3 |
| Volatility products | 3 | −12.9% | −16.1% | −58.5% | 3 of 3 |
| Alternative-strategy ETFs | 6 | 4.3% | 7.6% | −16.1% | 0 of 6 |
Results by fund type
Broad index ETFs: 12 funds, median CAGR 7.85% against 14.42% for holding, median max drawdown 16.81%, and none of the 12 beat buy-and-hold. These funds rose in four of the six calendar years, and a switch that is out about a third of the time will miss part of every rally. The two Nasdaq-100 funds, QQQ and QQQM, returned 7.85% and 7.82% against 16.70% and 16.74% for holding. QQQE, the equal-weight version, did worst in the group at 1.87% against 9.83%.
Sector ETFs: 6 funds, median CAGR 5.80% against 12.58%, median max drawdown 23.98%, none beat holding. SOXX, the semiconductor fund, was the best of the six at 17.96% a year with a 33.96% drawdown. XLK came next at 9.84%. XLP, the staples fund, returned 1.19% and spent 61.2% of days invested while making 27 round trips, which is the cost of whipsaw in a fund that does not trend.
Leveraged ETFs: 10 funds, median CAGR 17.30% against 23.55%, median max drawdown 49.92%, and 2 of 10 beat holding. Those two were bond funds, TMF and UST, where holding lost money. On the equity side the drawdowns stay large even with the switch in place: SOXL fell 65.38%, FAS 59.83% and TQQQ 49.92% in the trade. The 2x funds SPUU and SSO had drawdowns near 22.9%, far shallower than the 3x funds, and made 21 round trips each.
Inverse ETFs: 11 funds, median CAGR a loss of 12.74% against a loss of 21.57% for holding, 9 of 11 ahead of holding. This group looks like a win in the table and is a loss in dollars. The best inverse result was TBF at 7.6% a year, which is a short Treasury fund that gained when rates rose. Every equity inverse fund lost money under the rules. SDS lost 6.89% a year against 21.57% for holding, SQQQ lost 24.32% and SOXS lost 48.38%. The median max drawdown in the group was 56.94%.
Bond ETFs: 7 funds, median CAGR 1.02% against a loss of 0.78% for holding, max drawdown near 5%, and 6 of 7 ahead of holding. The bond window includes the 2022 rate shock. Going to cash when the 12-day average dropped below the 26-day spared the strategy part of that loss. IEF, the 7 to 10 year Treasury fund, returned a loss of 0.39% a year against a loss of 2.29% for holding, with a 10.63% drawdown and a 19% win rate.
Volatility products: 3 funds, median CAGR a loss of 12.95% against a loss of 16.06%, median max drawdown 58.55%, and all 3 finished ahead of holding. VXZ lost 11.26% a year with a 53.71% drawdown and 29 round trips. The comparison flatters the rules because holding these funds is itself a steady loss.
Commodity ETFs, one fund, IAU: 12.50% against 13.66%, a 14.97% drawdown. Currency ETFs, three funds: median 1.32% against a loss of 0.90%, with FXE and UDN ahead of holding. Alternative-strategy ETFs, six funds: median 4.27% against 7.61%, none ahead.
Year by year, median across all ETFs
| Year | EMA 12/26 trend | Buy & hold | ETFs with a gain |
|---|---|---|---|
| 2021 | 0.0% | 4.1% | 28 of 59 |
| 2022 | −8.3% | −12.7% | 15 of 59 |
| 2023 | 7.0% | 8.9% | 44 of 59 |
| 2024 | 1.7% | 9.7% | 33 of 59 |
| 2025 | 5.8% | 11.1% | 39 of 59 |
| 2026 | 2.8% | 3.7% | 36 of 59 |
Calendar years, median across the 59 funds
The year table reports the median fund in each calendar year. The figures come from the facts file for the hub: in 2022 the median strategy result was a loss of 8.3% against a loss of 12.7% for holding, with 15 of 59 funds finishing the year with a gain. That was the best relative year for the switch. It was out of the market for part of the decline, and bond and inverse funds in particular held up better than holding them.
2021 was flat for the median fund under the rules, a result of 0%, while holding gained 4.1% by the same median measure and 28 of 59 funds were positive. The window starts on 2021-01-04, and the averages need history before they produce their first signal.
2023 was a strong year for risk assets. The median switch result was 7.0% against 8.9% for holding, and 44 of 59 funds had a gain, the most of any year. The gap between the two is smaller here than in other years, which suggests the 12/26 pair caught most of that recovery once it started.
2024 was the weakest year for the rules relative to holding: a median gain of 1.7% against 9.7%. The gap to holding was widest here, which is consistent with the switch selling during short pullbacks and buying back at higher prices. 33 of 59 funds finished the year positive.
2025 returned a median 5.8% against 11.1% for holding, with 39 of 59 funds up. The window for 2026 runs only to 2026-10-02. In that partial year the median was 2.8% against 3.7%, with 36 of 59 funds up.
Two things stand out when the years are read together. The switch never beat the median holding in a rising year. Its edge showed up in 2022 only, when holding lost money. A trend switch of this speed behaves like partial insurance that is paid for in every year the market goes up.
Changing the parameters
| Version | Median CAGR | Median max DD | Median round trips |
|---|---|---|---|
| Published rules | 2.8% | −22.9% | 22 |
| EMA 8/21 | 2.9% | −22.6% | 31 |
| EMA 20/50 | 1.2% | −25.3% | 12 |
| EMA 12/50 | 2.1% | −23.6% | 16 |
What changing the averages did
The parameter table runs three variants on all 59 funds and reports the median of each. The published 12/26 pair gave a median CAGR of 2.76%, a median max drawdown of 22.87% and 22 round trips.
EMA 8/21 is faster. It returned 2.87%, with a drawdown of 22.57% and 31 round trips. The extra trades bought almost nothing: the CAGR moved by a tenth of a point and the drawdown moved by a similar amount. A faster pair did not protect better, and it costs more to run if fees are charged.
EMA 20/50 is slower. Its median CAGR fell to 1.17% and its drawdown widened to 25.29%, with 12 round trips. The slower pair traded about half as often and did worse on both measures. It is the slowest of the three, and on this window slower did not help.
EMA 12/50 keeps the fast leg and slows the other. It gave 2.10%, a 23.56% drawdown and 16 round trips. This sits between the other two on every measure.
The ordering is monotone in the number of trades, and the CAGR is close across the faster variants. Across the whole range tested, no variant moved the median CAGR out of single digits, and no variant moved the median drawdown below 22.57%. The parameters change how often the strategy trades. They do not change what kind of result it produces. One caution on the test: three variants on one window is a narrow look, and the medians do not show how any single fund would respond to a different pair.
Comparison with the other templates
The other eleven templates ran on the same 59 funds in the same window. The median CAGRs are on the hub list. Weekly 7% target had 6.61%, monthly cycle 5.46% and RSI(2) snapback 4.74%. RSI mean reversion had 2.98%. EMA 12/26 Trend, at 2.76%, sits in the middle of the group.
The nearest trend rules are close. Trend plus trailing stop had a median of 2.61%, SMA 10/50 trend 2.12%, golden cross 2.05% and the 200-day regime filter 1.84%. The faster exponential pair did slightly better than the three slower or simpler trend rules, which fits the parameter table: speed helped a little up to the 12/26 and 8/21 pairs and then stopped helping. Head-to-head pages are linked from each name, for example EMA 12/26 trend vs SMA 10/50 trend and EMA 12/26 trend vs golden cross.
Momentum breakout and 3-month momentum both had a median of 0%. The dip buyer had 1.33%. The mean reversion templates did better than the trend templates over this window, which had several sharp drops that recovered within weeks. A rule that buys weakness was paid for that, and a rule that waits for confirmation was not.
The 3-month momentum template and the RSI mean reversion template are the two most different in style from this one, and the comparison pages show where each wins by fund.
Frequently asked questions
What is the EMA 12/26 trend strategy?
Hold while the 12-day exponential average is above the 26-day, the core of the MACD used as a position switch. The 12/26 exponential moving average pair is the core of the MACD indicator. Exponential averages weight recent days more than simple averages, so this crossover reacts faster than an SMA pair of the same length. Used as a long/flat switch, it gives you a position you can hold and measure.
Does EMA 12/26 trend beat buy-and-hold?
Across 59 ETFs backtested 2021-01-04 to 2026-10-02, it beat same-ETF buy-and-hold on 22 of 59 (37%). Median CAGR was 2.8% with a median max drawdown of 22.9%. Per-ETF results vary widely; the table lists every one.
Is this the same as trading MACD signals?
It uses the MACD's underlying trend component. Classic MACD trades the signal-line crossover of the 12/26 spread. This template trades the spread's sign directly, which is simpler and can be built fully in blocks.
What does the EMA 12/26 trend strategy do?
It buys with 98% of the sleeve when the 12-day exponential moving average is above the 26-day average, and sells everything when the 12-day drops below. Both checks run at the market open. It is long only and sits in cash when the signal is off.
Did EMA 12/26 trend beat buy-and-hold in the backtest?
It beat buy-and-hold of the same ETF in 22 of 59 cases between 2021-01-04 and 2026-10-02. The wins were concentrated in funds that lost money when held, such as inverse, bond and volatility funds. On the 12 broad index ETFs it beat holding in none of them.
What was the median return and drawdown?
The median CAGR across the 59 funds was 2.76%, and the median max drawdown was 22.87%. The median fund was invested 59.3% of the time and made 22 round trips. The headline run has no fees or slippage.
Is a faster or slower EMA pair better?
The test ran EMA 8/21, 20/50 and 12/50 against the published 12/26. The 8/21 pair gave 2.87% CAGR with 31 round trips, the 20/50 pair gave 1.17% with 12, and the 12/50 pair gave 2.10% with 16. The faster pair was only slightly ahead of 12/26 and traded more.
Which funds worked best with this strategy?
SOXL had the highest CAGR at 26.2%, followed by TECL at 19.8%, SPUU at 19.1% and SOXX at 18.0%. SPUU and SSO had drawdowns near 22.9% against 65.38% for SOXL and 53.47% for TECL.
Is this the same as trading MACD signals?
The strategy uses the MACD's underlying trend component. Classic MACD trades the signal-line crossover of the 12/26 spread. This template trades the sign of the spread directly, which is simpler to build and test in blocks.
Compare with other strategies
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.