Learn › Strategies › EMA 12/26 Trend › XLK

EMA 12/26 Trend on XLK

Technology Select Sector SPDR Fund: S&P 500 technology stocks, the sector behind most recent bull runs. Backtest 2021-01-04 to 2026-10-02, $10,000 starting capital, computed by the same engine that runs live DeployQuant strategies.

Result: EMA 12/26 trend on XLK turned $10,000 into $17,136 (71.4% total, 9.8% CAGR): it trailed buy-and-hold by 12.2% per year, with a maximum drawdown 7.4 points shallower than holding (25.6% vs 33.0%).
9.8%CAGR
22.1%buy & hold CAGR
−25.6%max drawdown
0.64Sharpe ratio
23round trips
35%win rate
■ EMA 12/26 trend   ■ buy & hold, $10,000 invested 2021-01-04

Year by year

YearEMA 12/26 trendbuy & hold
20218.6%36.1%
2022−22.1%−27.2%
202329.5%54.6%
20248.0%21.3%
202517.1%24.3%
202623.7%38.9%

Month by month

YearJanFebMarAprMayJunJulAugSepOctNovDec
20210.0%−4.7%−2.1%2.4%−4.5%6.2%3.8%3.5%−4.6%1.6%4.3%3.2%
2022−4.8%0.0%0.4%−6.9%0.0%0.0%5.2%−6.1%−0.9%0.0%−4.0%−6.7%
20233.0%0.4%10.6%−0.1%8.7%6.0%2.5%−4.9%−4.4%−4.7%6.5%4.1%
20242.6%4.6%0.8%−3.0%1.6%7.6%−4.5%−1.8%−2.6%−1.5%5.0%−0.3%
2025−4.4%−0.2%0.0%0.0%7.0%9.6%3.6%0.0%7.4%6.5%−7.0%−5.1%
20260.4%−4.6%0.0%11.6%19.4%−0.2%−8.7%−0.8%5.0%2.1%––

Every trade

EMA 12/26 trend on XLK made 23 closed round trips and one position still open at the end of the test, an average hold of 57 days, an average winner of 15.30%, an average loser of −4.03%, a profit factor of 1.95, a longest losing streak of 4. It held a position at the close on 65.7% of trading days.

EntryEntry priceExitExit priceReturnDays held
2021-02-10$65.752021-03-05$61.29−6.8%23
2021-04-05$65.462021-05-12$63.97−2.3%37
2021-06-01$66.762021-09-22$73.7810.5%113
2021-09-27$74.942021-09-28$73.93−1.4%1
2021-10-20$76.602022-01-11$79.834.2%83
2022-03-25$76.582022-04-13$71.42−6.7%19
2022-07-21$66.422022-09-01$64.95−2.2%42
2022-11-01$62.932022-11-03$58.60−6.9%2
2022-11-14$64.192022-12-21$61.59−4.0%37
2023-01-18$64.332023-08-10$82.9328.9%204
2023-09-01$86.542023-09-19$82.65−4.5%18
2023-10-13$84.212023-10-23$80.15−4.8%10
2023-11-07$85.132024-04-16$99.4116.8%161
2024-05-13$101.952024-07-25$106.504.5%73
2024-08-21$110.742024-09-05$102.81−7.2%15
2024-09-18$108.382025-01-10$114.285.4%114
2025-01-24$119.932025-01-29$115.33−3.8%5
2025-02-12$115.272025-02-27$115.06−0.2%15
2025-05-02$106.852025-11-19$138.8930.0%201
2025-12-08$147.142025-12-18$141.29−4.0%10
2025-12-24$145.292026-01-22$145.02−0.2%29
2026-01-26$144.402026-02-05$136.56−5.4%10
2026-04-13$142.082026-07-17$173.4222.1%95
2026-08-07$187.67open–6.5%–

Prices are adjusted for splits and dividends, so they sit below the quotes printed at the time. An open position is marked at the last close.

Largest drawdowns

PeakLow pointDepthDays to lowRecoveredDays to recover
2021-12-272023-01-19−25.6%3882023-06-15147
2025-10-292026-02-05−16.5%992026-05-0892
2024-07-102024-09-18−16.3%702025-06-30285

Buy-and-hold's deepest drawdown ran from 2021-12-27 to 2022-10-12 and reached −33.0%.

With trading costs

The headline run fills at the bar price. These runs charge slippage on every fill.

Slippage per fillCAGRMax drawdownFinal valueSharpe
None (headline)9.8%−25.6%$17,1360.64
5 basis points9.4%−25.9%$16,7480.62
10 basis points9.0%−26.3%$16,3910.59

Changing the parameters

VersionCAGRMax drawdownRound tripsWin rateFinal value
Published rules9.8%−25.6%2335%$17,136
EMA 8/2114.0%−20.7%3047%$21,256
EMA 20/508.7%−29.5%1338%$16,117
EMA 12/509.5%−23.1%1850%$16,803

How XLK behaved

MeasureXLK
Data in this test2021-01-04 to 2026-10-02 (1444 sessions)
Total return, buy and hold226.1%
Annualized volatility25.1%
Deepest drawdown−33.6% (2021-12-27 to 2022-10-12)
Up days55.2%
Average daily range1.77%
Average overnight gap0.69%
Correlation to SPY0.91
Correlation to QQQ0.97
Correlation to TLT0.07
Sessions above the 200-day average76.5%
Crossings of the 200-day average22
Falls of 10% or more from a 20-day high30

The rules

Hold while the 12-day exponential average is above the 26-day, the core of the MACD used as a position switch.

  1. WHEN the market opens · IF not invested AND EMA(12) > EMA(26) · THEN buy with 98% of the sleeve
  2. 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.

Run EMA 12/26 trend on XLK yourself, free →

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.

Frequently asked questions

Did EMA 12/26 trend beat buy-and-hold on XLK?

Over 2021-01-04 to 2026-10-02, EMA 12/26 trend on XLK returned 9.8% annualized vs 22.1% for buy-and-hold: it trailed buy-and-hold by 12.2% per year, with a maximum drawdown 7.4 points shallower than holding (25.6% vs 33.0%).

How many trades did it make?

23 completed round trips over 5.7 years (47 fills), with 35% of round trips closing profitably.

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.

Related

EMA 12/26 Trend on all 59 ETFsfull results table All strategies on XLK12 templates compared RSI(14) Mean Reversion on XLKsame ETF, different rulesRSI(2) Dip Snapback on XLKsame ETF, different rules

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.