Learn › Strategies › Golden Cross (SMA 50/200) › XLK

Golden Cross (SMA 50/200) 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: golden cross on XLK turned $10,000 into $22,684 (126.8% total, 15.3% CAGR): it trailed buy-and-hold by 6.7% per year, with a maximum drawdown 13.4 points shallower than holding (19.6% vs 33.0%).

The golden cross holds a fund while its 50-day simple average sits above its 200-day average and moves to cash when the 50-day falls below. On XLK, the technology sector fund, it turned $10,000 into $22,684 between 2021-01-04 and 2026-10-02. That is a total return of 126.84% and a CAGR of 15.33%, with a maximum drawdown of 19.6% and a Sharpe ratio of 0.87.

Buy-and-hold on XLK did more: a CAGR of 22.07%, an ending balance of $31,425 and a Sharpe of 0.95. Its maximum drawdown was 32.96%. The rule gave up a large part of the return and cut the worst drawdown by a good margin, and it did that with two completed trades. One lost 4.61% and the other made 51.24%. A third trade is still open.

Two round trips is a very small sample. Everything on this page is a description of what happened in those trades, and a rule with this few decisions cannot be tested statistically on one fund. The golden cross is among the slowest templates in the library, with a median of 3 round trips on the funds tested, and XLK, with 2, is at the quiet end of that.

The rule ranks 4th of 12 templates on XLK and XLK ranks 4th of 59 funds for the golden cross. That is a better position than the template holds across the whole library, where its median CAGR on the 59 funds is 2.05%. XLK is a fund that rose a lot, and the rule rode most of it. The window is 5.74 years, the headline run has no fees or slippage, and the decisions are daily.

15.3%CAGR
22.1%buy & hold CAGR
−19.6%max drawdown
0.87Sharpe ratio
2round trips
50%win rate
■ golden cross   ■ buy & hold, $10,000 invested 2021-01-04

Year by year

Yeargolden crossbuy & hold
202110.4%36.1%
2022−13.5%−27.2%
202339.5%54.6%
202421.2%21.3%
20251.4%24.3%
202638.6%38.9%

Year by year

The first year is the one that stands out. XLK returned 36.1% with buy-and-hold in 2021, and the rule returned 10.4%. The monthly table shows 0% for every month from January to September 2021, meaning no position. The rule's first entry was 2021-10-19. The 200-day average needs about 200 sessions of price history before it can exist, and the window opens on 2021-01-04, so the first signal arrives roughly 200 sessions in. That timing is consistent with the entry date. The rule sat in cash for the first nine months of a strong year, and the 25.7 percentage point shortfall in 2021 is mostly that.

October, November and December 2021 returned 2.5%, 4.34% and 3.21%. Then the 2022 decline began. January 2022 lost 6.72%, February 4.81% and March 2.58%, and the 50-day average fell below the 200-day on the 2022-03-17 exit. The year finished at -13.5% for the rule against -27.2% for buy-and-hold, a gap of 13.7 percentage points in the rule's favor. The rule was in cash from April through December 2022, so the months from April to October, when buy-and-hold fell into its 2022-10-12 trough, cost the rule nothing.

2023 was the recovery. The rule returned 39.5% against 54.6% for holding. It re-entered on 2023-02-21 at an adjusted price of 67.33, which was after the rebound had started, and it missed January 2023. The rule's loss against the fund in 2023 was 15.1 percentage points. From there it held for 770 days.

2024 is the year where the two lines were almost the same: 21.2% for the rule and 21.3% for the fund. The rule was fully invested all year.

2025 is the year of the largest shortfall after 2021. The rule returned 1.4% and buy-and-hold returned 24.3%, a gap of 22.9 percentage points. The exit came on 2025-04-01, at an adjusted 101.83, one week before the fund's 2025-04-08 low. That sounds like good timing, and the rule did avoid part of the decline. It also stayed out through the rebound, and the re-entry was on 2025-06-27 at 125.08. The rule held cash while the fund rose from its April low, and the best single day of the window, 13.37% on 2025-04-09, came during the gap.

2026 is a partial year ending 2026-10-02. The rule returned 38.6% and the fund 38.9%, so they ended almost level. The rule's open position was bought at 125.08 and is up 59.78% on that entry at the end of the window.

The pattern across the six years is simple. The rule beat holding in 2022 only, tied it in 2024 and 2026, and trailed in 2021, 2023 and 2025. The three years where it trailed are the three where it was in cash at some point while the fund rose, and the cost was between 15.1 and 25.7 points in each.

Month by month

YearJanFebMarAprMayJunJulAugSepOctNovDec
20210.0%0.0%0.0%0.0%0.0%0.0%0.0%0.0%0.0%2.5%4.3%3.2%
2022−6.7%−4.8%−2.6%0.0%0.0%0.0%0.0%0.0%0.0%0.0%0.0%0.0%
20230.0%−1.1%10.6%−0.1%8.7%5.9%2.5%−1.5%−6.3%0.1%12.6%4.1%
20242.6%4.6%0.8%−5.7%7.0%7.6%−3.2%0.7%2.6%−1.5%5.1%−0.3%
2025−0.7%−2.2%−8.2%−0.6%0.0%0.5%3.6%0.0%7.4%6.5%−4.7%0.7%
2026−0.1%−3.5%−4.0%19.6%19.5%−0.2%−7.8%6.3%5.0%2.1%––

The months

Most of the months are zero. The rule held no position in the first nine months of the window, none from April to December 2022, none in January 2023, and none in May 2025. That is why the table looks sparse, and why a monthly win rate means little for this rule.

The best month was April 2026 at 19.55%, followed by May 2026 at 19.53%. These two months together drove much of the 2026 return, and both sit inside the open trade. Buy-and-hold had its own best month in April 2026 at 19.71%, so the rule was invested for the whole of it. The worst month for the rule was March 2025 at -8.17%, just before the exit. Buy-and-hold's worst month was September 2022 at -11.65%, a month the rule sat out.

Other notable months were November 2023 at 12.58% and March 2023 at 10.57%, both inside the long trade, and July 2026 at -7.84%, the worst of the open trade so far. September 2023 lost 6.31% and April 2024 lost 5.68%. Those two months fall in the middle of the 770-day hold, and the rule did not react to them because the 50-day average stayed above the 200-day. A pullback of that size is within what a slow trend rule tolerates, and the signal exists to ignore it.

Over the six calendar years, XLK's average May return was 7.38% and its average September was -1.48%, from only 5 or 6 observations each. Those averages are too thin to say anything about seasonality, and the rule does not use dates.

Every trade

golden cross on XLK made 2 closed round trips and one position still open at the end of the test, an average hold of 460 days, an average winner of 51.24%, an average loser of −4.61%, a profit factor of 10.54, a longest losing streak of 1. It held a position at the close on 65.9% of trading days.

EntryEntry priceExitExit priceReturnDays held
2021-10-19$75.902022-03-17$72.40−4.6%149
2023-02-21$67.332025-04-01$101.8351.2%770
2025-06-27$125.08open–59.8%–

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.

The three trades

There are only three trades to describe.

The first was entered on 2021-10-19 at an adjusted 75.9 and sold on 2022-03-17 at 72.4, a loss of 4.61% after 149 days. This is the shortest hold in the sample. It was a purchase made ahead of the fund's 2021-12-27 peak, and the death cross came after the decline that followed. The loss was small compared with the fund's drawdown over the same stretch, and that is the job the rule is built for: a modest loss and then cash.

The second was entered on 2023-02-21 at 67.33 and sold on 2025-04-01 at 101.83, a gain of 51.24% over 770 days. This is the longest hold and the best trade. It carried the rule through the 2024 pullback of 16.7% between 2024-07-10 and 2024-08-07, and the 2025 decline until the exit signal fired. A trade of this length makes the average win and the best trade the same number, 51.24%, and the profit factor of 10.54 is the ratio of that one win to that one loss.

The third was entered on 2025-06-27 at 125.08 and remains open, up 59.78% at the end of the window. It is not counted in the 2 round trips, the 50% win rate or the profit factor. Its return is unrealized, and it will change.

The average hold of the two completed trades was 459.5 days. Exposure over the window was 65.9%, which fits: about a third of the time the rule was in cash. The five fills in the report are two buys, two sells and the open position's purchase.

The 50% win rate and the profit factor come from two data points. With one win and one loss, the win rate could just as easily be 100% or 0% with a different start date. The lesson in the trade list is the asymmetry. A loss of 4.61% and a gain of 51.24% show the shape the rule is designed to have, but the result depends on a single long trend in XLK.

Largest drawdowns

PeakLow pointDepthDays to lowRecoveredDays to recover
2021-12-272022-03-14−19.6%772023-05-26438
2024-07-102024-08-07−16.7%282024-11-0792
2025-10-292026-03-30−15.7%1522026-04-1617

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

The drawdowns

The rule's deepest drawdown was 19.6% from 2021-12-27 to 2022-03-14, a trough reached after 77 days. The recovery took until 2023-05-26, 438 days after the trough. That long recovery is a feature of the rule: it exited on 2022-03-17, three days after the trough, held cash through the rest of the year, and re-entered on 2023-02-21, so the equity curve could only climb back as the new position grew.

The second drawdown was 16.7%, from 2024-07-10 to 2024-08-07, which took 28 days to reach the trough and 92 days to recover by 2024-11-07. This was a drawdown the rule held through. The third was 15.69%, from 2025-10-29 to 2026-03-30, 152 days down and 17 days to recover on 2026-04-16, and again it was a drawdown inside a trade.

Buy-and-hold had three drawdowns: 32.96% from 2021-12-27 to 2022-10-12, which recovered on 2023-06-15, then 25.29% from 2025-02-18 to 2025-04-08, and 16.74% over the same dates as the rule's second one. The rule's first drawdown shares its peak date with the fund's biggest decline. The rule stopped it at 19.6% and the fund continued to 32.96%, a difference of 13.36 percentage points in the maximum drawdown.

The two later drawdowns of the rule, 16.7% and 15.69%, are of ordinary depth for a fund with annualized volatility of 25.13%. The rule did not shield them, because the 50-day average stayed above the 200-day through both. It reduced the largest drawdown, and it left the moderate ones alone.

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)15.3%−19.6%$22,6840.87
5 basis points15.2%−19.6%$22,5810.87
10 basis points15.2%−19.6%$22,5530.87

Costs

With 5 basis points the CAGR was 15.24% and the ending balance $22,581. With 10 basis points the CAGR was 15.22% and the balance $22,553. The maximum drawdown went from 19.6% to 19.61% and then 19.62%. The Sharpe ratio stayed at 0.87 and then 0.868.

The cost effect is close to nothing because the rule made five fills in five and a half years. A rule that trades that rarely is insensitive to costs, and the shortfall against buy-and-hold has nothing to do with them.

XLK trades about $1,324,049,811 a day with a median minute volume of 20,984 shares, which is deep enough that a $10,000 sleeve has no practical effect on the fill price. The test does not model larger sizes.

Changing the parameters

VersionCAGRMax drawdownRound tripsWin rateFinal value
Published rules15.3%−19.6%250%$22,684
SMA 40/20014.0%−19.4%367%$21,225
SMA 50/15012.2%−19.1%367%$19,363
SMA 60/25011.4%−25.3%250%$18,637

Changing the parameters

Three variants were tested. SMA 40/200 returned 14.01% with a 19.35% drawdown and a Sharpe of 0.82, with 3 trades and 2 wins. SMA 50/150 returned 12.2% with a 19.12% drawdown and a Sharpe of 0.735, 3 trades and 2 wins. SMA 60/250 returned 11.45% with a 25.25% drawdown and a Sharpe of 0.658, with 2 trades and 1 win.

The standard 50/200 pair at 15.33% is the best of the four. That is the opposite of what an overfit result looks like, since a tuned setting would normally be a neighbor that does better than the default. Here every change lowered the CAGR. The slower 60/250 pair also made the drawdown deeper, 25.25% against 19.6%.

The spread between the variants, 11.45% to 15.33%, is large for settings that differ by a few days. It comes from the tiny number of trades. Each variant makes two or three decisions, and moving a crossing by a week changes the entry or exit price of a trade that lasts hundreds of days. The parameter table reads as sensitivity to timing in a small sample, and it does not identify a better pair.

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

How XLK behaved

XLK returned 22.86% a year with annualized volatility of 25.13%. It was above its 200-day average on 76.47% of sessions and crossed it 22 times. Beta to SPY was 1.39 and correlation to QQQ was 0.97. The maximum drawdown was 33.58% from 2021-12-27 to 2022-10-12, with recovery on 2023-06-15, and the longest drawdown lasted 368 sessions.

The calendar years were 36.99% in 2021, -27.73% in 2022, 56.01% in 2023, 21.64% in 2024, 24.61% in 2025 and 39.31% in 2026 so far. XLK was above its 200-day average for three quarters of the window, so a rule that holds whenever the 50-day is above the 200-day has good odds of being long most of the time. It was, at 65.9% exposure, below that 76.47% because of the lag at both ends of each regime, and the nine-month start.

The 22 crossings of the 200-day average are more than the golden cross made trades, since the 50/200 pair filters most of them. Whipsaws did not trouble the rule here: it made no round trip that lasted less than 149 days.

Daily returns had a lag-1 autocorrelation of -0.03 and the share of up days was 55.23%. The largest single-day moves were 13.37% up on 2025-04-09 and 6.76% down on 2025-04-03, The three worst days were -6.76% on 2025-04-03, -6.67% on 2026-06-05 and -6.57% on 2025-04-04. The rule was flat on the two April 2025 days and long on 2026-06-05.

The category comparison is useful. In the sector group, SOXX returned 28.24% with 3 round trips and a drawdown of 28.82%. VOX returned 11.2%, XLF 3.6%, XLP 2.05% and XLY 1.35%. XLK's 15.33% is second among the six, and the category median of 11.2% is well above the rule's median across all 59 funds of 2.05%.

The rules

Hold while the 50-day average is above the 200-day; step aside when it crosses below (the death cross).

  1. WHEN the market opens · IF not invested AND SMA(50) > SMA(200) · THEN buy with 98% of the sleeve
  2. WHEN the market opens · IF invested AND SMA(50) < SMA(200) · THEN sell the whole position

A widely used trend filter. When the 50-day simple moving average is above the 200-day, the asset is in a long-term uptrend and the strategy holds. When it crosses below, the strategy moves to cash. It trades rarely, with a handful of signals per decade on an index. Its use is skipping the deepest bear markets, and it will lag some rallies.

Good for: long-horizon investors who want to hold trends but sidestep multi-year bear markets.
Watch out: crosses lag at turning points: the strategy gives back the first leg of a crash and misses the first leg of a recovery, and choppy sideways markets whipsaw it.

The rules against this fund

The rule has two conditions: when not invested and SMA(50) is above SMA(200), buy with 98% of the sleeve at the open; when invested and SMA(50) is below SMA(200), sell the whole position at the open. The template's own caveats say crosses lag at turning points, that it gives back the first leg of a crash and misses the first leg of a recovery, and that sideways markets whipsaw it.

XLK shows all three except the whipsaw. The first leg of the 2022 decline cost 4.61% on the trade and a drawdown of 19.6%. The first leg of the 2023 recovery was missed, because the re-entry was on 2023-02-21. The 2025 exit was early and the re-entry late.

On this fund, other templates did better: the monthly cycle returned 20.86%, the weekly 7% target 20.39% with a 20.67% drawdown, and the 200-day regime filter 16.81% with a 19.72% drawdown. The 200-day filter is a close cousin of the golden cross, and it earned more with a similar drawdown. The trend plus trailing stop returned 12.49% with a drawdown of 32.53%. At the other end, the 3-month momentum returned 6.06%.

The test stops at one fund, one window and one parameter pair.

Run golden cross 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 golden cross beat buy-and-hold on XLK?

Over 2021-01-04 to 2026-10-02, golden cross on XLK returned 15.3% annualized vs 22.1% for buy-and-hold: it trailed buy-and-hold by 6.7% per year, with a maximum drawdown 13.4 points shallower than holding (19.6% vs 33.0%).

How many trades did it make?

2 completed round trips over 5.7 years (5 fills), with 50% of round trips closing profitably.

How often does a golden cross happen?

On a broad index, roughly every couple of years. The backtest pages show the exact trade count for each ETF over the 2021 to 2026 window.

Golden cross vs buy and hold: which does better?

It depends on the asset and the window. Every backtest page here shows the same-window buy-and-hold comparison.

How did the golden cross perform on XLK?

From 2021-01-04 to 2026-10-02 it turned $10,000 into $22,684, a CAGR of 15.33% with a 19.6% maximum drawdown. Buy-and-hold on XLK returned 22.07% a year with a 32.96% drawdown. The rule made two completed round trips and has one position open.

Did the golden cross beat buy-and-hold on XLK?

Not on return. The rule's ending balance was $22,684 against $31,425 for holding. It beat holding in 2022 only, with -13.5% against -27.2%, and it had the shallower drawdown.

Why did the golden cross make so few trades on XLK?

A 50/200 average crossover changes direction rarely, and XLK was above its 200-day average on 76.47% of sessions. The rule's trades lasted 149 days and 770 days, and the third trade is still open. Two round trips is too few to judge the win rate of 50%.

Why was the golden cross in cash for most of 2021?

The first entry was on 2021-10-19. The 200-day average needs about 200 sessions of data, and the window starts on 2021-01-04. January to September 2021 therefore show no position, and the rule returned 10.4% against 36.1% for holding.

Does changing the moving average lengths improve the result on XLK?

Not in the tests. SMA 40/200 returned 14.01%, SMA 50/150 returned 12.2% and SMA 60/250 returned 11.45%, all below the standard pair's 15.33%. With two or three trades each, the differences reflect timing in a small sample.

How much do trading costs matter for the golden cross on XLK?

Very little. At 5 basis points the CAGR was 15.24% and at 10 basis points it was 15.22%, against 15.33% with no costs. The rule made five fills in the window.

Related

Golden Cross (SMA 50/200) 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.