Learn › Strategies › SMA 10/50 Trend › XLP

SMA 10/50 Trend on XLP

Consumer Staples Select Sector SPDR Fund: defensive consumer staples, a common risk-off equity sector. Backtest 2021-01-04 to 2026-10-02, $10,000 starting capital, computed by the same engine that runs live DeployQuant strategies.

Result: SMA 10/50 trend on XLP turned $10,000 into $10,714 (7.1% total, 1.2% CAGR): it trailed buy-and-hold by 4.6% per year, with a maximum drawdown 0.4 points shallower than holding (15.6% vs 16.0%).

The SMA 10/50 trend rule holds a fund while its 10-day simple average sits above the 50-day average and goes to cash when the 10-day drops below. XLP, the Consumer Staples Select Sector SPDR Fund, is a defensive consumer staples sector fund, often used as a risk-off equity holding. From a $10,000 start on 2021-01-04 the account reached $10,714 by 2026-10-02, a total return of 7.14% and a CAGR of 1.21%. The maximum drawdown was 15.63% and the Sharpe ratio was 0.17.

Holding XLP did better, finishing at $13,819 with a CAGR of 5.8%, a drawdown of 15.99% and a Sharpe ratio of 0.51. The rule trailed holding by 4.59 CAGR points and finished $3,105 behind. It did not beat holding in any calendar year, and its drawdown was only 0.36 points shallower.

Seven of 19 round trips won, which is 37%. Winners averaged 5.17% and losers averaged -2.28%, a profit factor of 1.24. The average hold was 66.5 days and the account was invested on 59.9% of trading days. A trend rule needs a fund that moves in long swings, and XLP in this window mostly drifted. Fees are not charged in the headline run, and the test is a single window.

1.2%CAGR
5.8%buy & hold CAGR
−15.6%max drawdown
0.17Sharpe ratio
19round trips
37%win rate
■ SMA 10/50 trend   ■ buy & hold, $10,000 invested 2021-01-04

Year by year

YearSMA 10/50 trendbuy & hold
202114.5%18.1%
2022−4.7%−0.7%
2023−3.8%−0.9%
20247.6%12.0%
2025−8.3%1.5%
20263.5%5.6%

What each year did to the rule

The fund's calendar returns were 18.47% in 2021, then -0.75% and -0.89% in 2022 and 2023, 12.23% in 2024, 1.53% in 2025 and 5.68% in 2026 so far. The buy-and-hold column the strategy is compared with reads 18.1%, -0.7%, -0.9%, 12%, 1.5% and 5.6%.

The rule returned 14.5% in 2021, -4.7% in 2022, -3.8% in 2023, 7.6% in 2024, -8.3% in 2025 and 3.5% in 2026. It trailed holding in every year. The gaps were -3.6 points in 2021, -4 in 2022, -2.9 in 2023, -4.4 in 2024, -9.8 in 2025 and -2.1 in 2026.

The two flat years, 2022 and 2023, are the ones where a trend rule is supposed to help. XLP ended each of them close to where it started, and holding lost less than 1% in both. The rule lost 4.7% and 3.8%. In a fund that swings up and down inside a range, the crossover enters after the swing up has started and exits after the swing down has started, so it pays for both halves of every swing.

2025 was the worst gap, 9.8 points. XLP rose 1.53% and the rule lost 8.3%. Five round trips closed in 2025 and one won. This is the busiest year in the record, and it produced the biggest shortfall. One of the losers was a 5-day trade from 2025-04-03 to 2025-04-08 that lost 4.32%.

The rule's best year was 2024 at 7.6%, with two of three closed trades winning. XLP rose 12.23% that year. The rule captured part of it, held through the spring and summer, and gave up the lead in December. 2021 was close behind at 14.5%, with one of two closed trades winning.

The pattern by year is consistent. The rule makes money in years when XLP rises through a long run and loses money in years of reversals, and in neither type of year did it finish ahead of holding.

Month by month

YearJanFebMarAprMayJunJulAugSepOctNovDec
20210.0%0.0%3.5%1.9%1.7%−1.7%0.5%1.1%−1.9%0.2%−1.4%10.3%
2022−1.4%−0.1%−0.4%2.4%−8.4%0.0%1.9%−1.8%−0.2%0.0%6.6%−2.6%
2023−2.8%0.0%1.1%3.6%−5.6%0.0%0.3%−3.8%0.0%0.0%1.1%2.6%
20241.2%2.0%3.2%−4.1%2.3%−0.2%1.6%5.8%1.2%−1.1%0.0%−4.2%
20250.0%3.7%−3.9%−3.1%1.2%−2.1%−1.3%−2.0%−0.1%0.0%0.0%−0.8%
20267.3%7.6%−7.9%0.0%−1.2%−1.9%2.3%−0.1%−1.8%0.0%––

The months that mattered

The best month was December 2021 at +10.33%, against +10.36% for holding in the same month. The rule was invested for that jump. November 2022 added 6.56%, January 2026 added 7.32% and February 2026 added 7.64%. August 2024 added 5.82%.

The worst month was May 2022 at -8.43%, the month of XLP's worst day. Holding had its worst month later, March 2026 at -8.31%, when the rule lost 7.92%. May 2023 lost 5.59%, December 2024 lost 4.24% and April 2024 lost 4.07%. March 2025 lost 3.92% and April 2025 lost 3.09%.

The month-by-month table shows zero entries when the rule was out. They appear in the first two months of 2021, in June and October 2022, in four months of 2023 and in a scattering of later months. In those months the crossover signal had the account in cash while the fund kept drifting.

Two losses stand out by timing. The rule lost 8.43% in May 2022 and then 5.59% in May 2023, and both came in the same calendar month a year apart. XLP's own seasonal data show May averaging -1.08% over the window and September averaging -3.79%, the weakest month of the year. November averaged +3.33%, the strongest. Each of those averages rests on five or six observations, enough to hint at a seasonal pattern and not enough to rely on one.

Every trade

SMA 10/50 trend on XLP made 19 closed round trips, an average hold of 67 days, an average winner of 5.17%, an average loser of −2.28%, a profit factor of 1.24, a longest losing streak of 3. It held a position at the close on 59.9% of trading days.

EntryEntry priceExitExit priceReturnDays held
2021-03-18$56.992021-06-23$60.145.5%97
2021-07-16$61.872021-09-23$61.69−0.3%69
2021-10-28$62.272022-02-18$66.947.5%113
2022-03-31$67.412022-05-19$62.85−6.8%49
2022-07-18$65.232022-09-08$65.12−0.2%52
2022-11-02$64.992023-01-19$65.580.9%78
2023-03-29$67.172023-05-30$66.38−1.2%62
2023-07-21$69.152023-08-21$66.63−3.6%31
2023-11-16$64.392024-04-16$68.576.5%152
2024-04-30$70.802024-10-16$77.849.9%169
2024-12-02$78.742024-12-24$75.31−4.4%22
2025-02-12$76.382025-03-25$76.09−0.4%41
2025-04-03$78.872025-04-08$75.46−4.3%5
2025-04-24$77.622025-06-23$77.820.3%60
2025-07-07$79.342025-07-21$78.26−1.4%14
2025-08-12$79.732025-09-04$78.04−2.1%23
2025-12-03$76.892026-03-19$81.185.6%106
2026-05-07$82.802026-06-09$81.96−1.0%33
2026-06-15$84.362026-09-10$82.84−1.8%87

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 trades that made and lost money

Of 19 closed trades, 7 won and 12 lost. The median trade lost 0.38% and lasted 60 days. The longest hold was 169 days and the shortest was 5. Two wins in a row was the best streak, and three losses in a row was the worst.

The first trade bought on 2021-03-18 at an adjusted price of 56.99 and sold on 2021-06-23 at 60.14 for +5.53% over 97 days. The last trade bought on 2026-06-15 at 84.36 and sold on 2026-09-10 at 82.84 for -1.8% over 87 days.

The best trade ran from 2024-04-30 at 70.8 to 2024-10-16 at 77.84, a gain of 9.94% over 169 days. It is also the longest hold. The second best gained 7.5% from 2021-10-28 at 62.27 to 2022-02-18 at 66.94, over 113 days. The third gained 6.49% from 2023-11-16 to 2024-04-16 over 152 days, the fourth gained 5.58% from 2025-12-03 to 2026-03-19 and the fifth gained 5.53% in the first trade of the window.

The best trades are all long holds of 97 to 169 days. A trend rule earns its money in a few holds that run through a steady rise, and XLP produced five of them in nearly six years.

The worst trade bought on 2022-03-31 at 67.41 and sold on 2022-05-19 at 62.85 for -6.76% over 49 days. The next worst lost 4.36% from 2024-12-02 to 2024-12-24 in 22 days. Then came -4.32% from 2025-04-03 to 2025-04-08 in 5 days, -3.64% from 2023-07-21 to 2023-08-21 and -2.12% from 2025-08-12 to 2025-09-04.

The 2022-03-31 loss ties to the May 2022 month. XLP's worst day in the data, -6.45% on 2022-05-18, fell inside that trade, and the exit on 2022-05-19 came the day after. The rule sold after the fall had happened, which is how a moving-average exit behaves.

The average win was 5.17% against an average loss of -2.28%, so a winner was larger than a loser. With only 37% of trades winning, the product of the two gave a profit factor of 1.24, and the account still made less than holding.

Larger winners, fewer of them

The rule won 37% of its 19 trades. The average winner returned 5.17% and the average loser returned -2.28%, which gives the profit factor of 1.24. The winners were bigger than the losers, as a trend rule intends, and they were too few. Exposure was 59.9%, and the account earned nothing in cash while XLP kept its 5.8% buy-and-hold CAGR.

Winning trades per exit year were 1 of 2 in 2021, 1 of 3 in 2022, 1 of 3 in 2023, 2 of 3 in 2024, 1 of 5 in 2025 and 1 of 3 in 2026. The 2025 count of 5 closed trades is the highest of any year, and only one won. All five of the worst trades fall in 2022 to 2025: the 6.76% loss from 2022-03-31 to 2022-05-19, 4.36% from 2024-12-02 to 2024-12-24, 4.32% from 2025-04-03 to 2025-04-08 3.64% from 2023-07-21 to 2023-08-21 and 2.12% from 2025-08-12 to 2025-09-04.

The 2025-04-08 exit came one session before XLP's best day of the window, a rise of 3.81% on 2025-04-09. The rule had bought on 2025-04-03 at $78.87 and sold at $75.46 after five days, and it was in cash for the rebound day. The best recent trade ran from 2025-12-03 at $76.89 to 2026-03-19 at $81.18 for 5.58%, and it caught the 7.32% January 2026 and 7.64% February 2026 months.

Largest drawdowns

PeakLow pointDepthDays to lowRecoveredDays to recover
2022-04-202023-11-20−15.6%5792024-09-09294
2024-09-162026-01-07−15.1%478not yet–
2021-06-042021-12-01−4.5%1802021-12-109

Buy-and-hold's deepest drawdown ran from 2022-04-20 to 2022-10-07 and reached −16.0%.

The two drawdowns

The deepest drawdown, 15.63%, began at a 2022-04-20 peak and bottomed on 2023-11-20, 579 days later. The account recovered on 2024-09-09, 294 days after the low. A second decline of 15.09% ran from 2024-09-16 to 2026-01-07, 478 days, with no recovery by the end of the data. A third, 4.5%, ran from 2021-06-04 to 2021-12-01 and was made up by 2021-12-10.

The two long drawdowns together cover most of the window after April 2022. The account regained its old peak on 2024-09-09 and began falling again a week later. The new peak came right before the losing trades of late 2024 and 2025.

Holding XLP had a drawdown of 15.99% from 2022-04-20 to 2022-10-07, recovered on 2024-03-28 after 538 days. It had a later drawdown of 9.52% from 2026-02-27 and one of 8.37% from 2025-08-20 to 2025-11-06. The fund's own recorded drawdown was 16.27% over 486 sessions.

The rule's drawdown was almost the same depth as holding's, and it lasted 579 days to the low against 170 for holding. Holding reached its bottom in October 2022 and recovered in March 2024. The rule's low came more than a year after holding's, in November 2023, because the whipsaws of 2023 kept subtracting from equity while the fund moved sideways. The rule gave the account no shelter in the one major decline in the data.

The Sharpe ratio was 0.17 for the rule and 0.51 for holding.

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)1.2%−15.6%$10,7140.17
5 basis points0.9%−16.1%$10,5160.14
10 basis points0.5%−16.5%$10,3160.10

What costs did to a low-turnover rule

With nothing charged, CAGR is 1.21%. Charging 5 basis points on each fill takes it to 0.88%, the drawdown from 15.63% to 16.08% and the ending equity from $10,714 to $10,516. At 10 basis points the CAGR was 0.54%, the drawdown was 16.53% and the ending equity was $10,316. The Sharpe ratio fell from 0.17 to 0.138 and then to 0.105.

The rule made 38 fills in nearly six years. Each charge falls on a fill and the average trade lasted 66.5 days, so the rule pays less than a fast mean-reversion rule on the same fund. Each cost run lowered the CAGR, and the rule stayed positive in both.

XLP is liquid. Daily dollar volume averaged $854,044,173 in the data, and the median minute traded 17,592 shares. The flat charges do not change the ranking against holding.

Changing the parameters

VersionCAGRMax drawdownRound tripsWin rateFinal value
Published rules1.2%−15.6%1937%$10,714
SMA 5/50−0.1%−20.2%2540%$9,927
SMA 20/50−0.3%−19.7%1839%$9,858
SMA 10/100−0.7%−22.6%1631%$9,624

Other moving-average pairs

We reran the rule with three alternatives to the 10/50 pair.

The published 10/50 pair did better than all three, with a CAGR of 1.21%. Each alternative lost money and had a deeper drawdown, between 19.73% and 22.6%. The faster 5/50 pair made the most trades and had the best win count. The slowest pair, 10/100, made the fewest trades and had the deepest drawdown.

The published pair is the template's default and was not tuned to XLP, and it happens to land ahead of its neighbours here. A pair chosen because it ranks first on this window would only describe these years. The consistent finding is that none of the four combinations matched holding, whose CAGR was 5.8%.

How XLP behaved

MeasureXLP
Data in this test2021-01-04 to 2026-10-02 (1444 sessions)
Total return, buy and hold40.3%
Annualized volatility13.3%
Deepest drawdown−16.3% (2022-04-20 to 2022-10-07)
Up days51.6%
Average daily range1.12%
Average overnight gap0.29%
Correlation to SPY0.47
Correlation to QQQ0.30
Correlation to TLT0.13
Sessions above the 200-day average75.1%
Crossings of the 200-day average73
Falls of 10% or more from a 20-day high1

How XLP behaved

The fund's total return over the window was 40.33%, a CAGR of 6.08%, at an annualized volatility of 13.28%. Its deepest drawdown was 16.27%, from 2022-04-20 to 2022-10-07, and it recovered on 2024-03-28. Calendar returns were small in 2022, 2023 and 2025 and large in 2021 and 2024.

Up days made 51.63% of sessions, with an average gain of 0.64% against an average loss of 0.63% on down days. The average intraday range was 1.12% and the average overnight gap was 0.29%. About 72.64% of the log return came during the trading session and 27.36% came overnight. Its best day was +3.81% on 2025-04-09 and its worst was -6.45% on 2022-05-18.

Against SPY the correlation was 0.47 and the beta 0.38, and against QQQ they were 0.3 and 0.18. The fund is a low-beta equity sector. XLP closed above its 200-day average on 75.1% of sessions, crossing that line 73 times. A fund above its long average three quarters of the time, with 73 crossings, is trending upward with many dips. The rule's 10/50 signal reacts to the dips and drops out of positions that the longer average still holds.

A fall of 10% from a 20-day high happened once, lasting 3 days in all. A trend rule's gains depend on swings, and XLP seldom produced a big one.

RSI(2) went under 10 on 156 sessions. Twenty days on, the median return was +1.09% where any day gave +0.73%. RSI(14) dipped below 30 on 37 sessions and the median 20-day return after them was +2.44%. Returns after oversold readings were above the baseline, which fits the mean-reversion templates doing better here than the trend rules.

XLP by month of year and by RSI reading

Averaged by calendar month, XLP did best in November at 3.33%, April at 1.68%, February and July at 1.67% each, and January at 1.33%. It lost 3.79% in September on average and 1.08% in May. Each month has five or six observations, so a single year can drive any of them. The rule's May record fits the weak May average: it lost 8.43% in May 2022 and 5.59% in May 2023, and made 2.32% in May 2024 and 1.22% in May 2025.

The oscillator readings were mild. The 14-day RSI closed below 30 on 37 sessions and above 70 on 73. After a sub-30 close the median 20-day forward return was 2.44%, against a baseline of 0.73%, and the 5-day median was 0.59% against 0.18%. The 2-day RSI closed below 10 on 156 sessions, with medians of 0.26% and 1.09%. That matches the two RSI templates ranking above the trend template on this fund.

XLP spent 75.1% of sessions above its 200-day average but crossed it 73 times, so it often slipped back below a line it had just cleared. A 10/50 crossover meets the same chop. Weekday averages ranged from -0.04% on Wednesday to 0.13% on Friday, and the fund fell 10% or more from a 20-day high once in the window, over 3 sessions.

The rules

A faster moving-average crossover: hold while the 10-day average is above the 50-day.

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

A faster version of the golden cross. The 10- and 50-day averages catch intermediate trends measured in weeks rather than years. It enters recoveries earlier and exits breakdowns earlier, with more whipsaw trades in sideways markets. Useful for seeing how signal speed changes a strategy's results.

Good for: trending assets with multi-week swings, such as leveraged index ETFs.
Watch out: several false signals a year is normal; each whipsaw costs a small loss and they add up in flat markets.

The other templates on XLP

Eighth of 12 templates is where the SMA 10/50 trend landed on XLP, and 36th among 59 funds for this rule. The RSI(2) snapback led at 8.22% with a drawdown of 11.06%, and RSI mean reversion followed at 6.51% with 9.64%. The monthly cycle returned 5.46% and the weekly 7% target returned 2.37% with a 23.83% drawdown.

The golden cross returned 2.05%, the trend plus trailing stop returned 1.82% and the dip buyer returned 1.32% with only 8.03% drawdown. The SMA 10/50 followed at 1.21%. EMA 12/26 trend returned 1.19%, the 200-day regime filter returned -0.81%, the 3-month momentum rule returned -1.67% and the momentum breakout returned -1.87%.

The top two rules both buy weakness, and the bottom four all follow trends. XLP's low volatility and its slow, rising path favoured entries on dips over entries on strength. The golden cross, the slower relative of this rule, finished ahead of it at 2.05% with a shallower drawdown of 14.3%.

Among sector ETFs the rule did best on XLK at 9.47% and on SOXX at 7.65%. VOX returned 6.06% and XLF returned 4.02%. XLP returned 1.21% and XLY returned 0.35%. The rule's median CAGR across the sector group was 6.06%, and across all 59 funds it was 2.12%. XLP fell below both medians. The faster, more volatile sector funds suited the rule better, which matches the template's own note that it suits assets with multi-week swings.

The funds most correlated with XLP were VTV at 0.64, VOOV at 0.63, XLF at 0.48, FAS at 0.48 and SSO at 0.47. The least correlated were SDS, SH and SPDN at -0.47, VIXM at -0.33 and UVXY at -0.32.

The same crossover on other sector funds

The SMA 10/50 rule made between 17 and 22 round trips on the sector funds, so the spread in results comes from the funds. XLK returned 9.47% with a 25.64% drawdown, SOXX returned 7.65% with 40.32%, VOX returned 6.06% with 19.61% and XLF returned 4.02% with 27.24%. XLP at 1.21% and XLY at 0.35% were the two lowest.

The category median was 6.06% and the median across all 59 funds was 2.12%. XLP sat below both. Its 15.63% drawdown was shallower than any other fund in that list, and the average hold was 66.5 days.

Limits of the test

Nineteen trades over 5.74 years leave each statistic on a small count. A stretch in which XLP trended strongly would test the rule differently. The scope is one fund, one rule and one window.

The headline run charges no fees or slippage, and the cost runs apply a flat 5 or 10 basis points to every fill. Trade prices are adjusted for splits and dividends, decisions come once a day, and fills happen on minute bars. Everything here is hypothetical.

Run SMA 10/50 trend on XLP 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 SMA 10/50 trend beat buy-and-hold on XLP?

Over 2021-01-04 to 2026-10-02, SMA 10/50 trend on XLP returned 1.2% annualized vs 5.8% for buy-and-hold: it trailed buy-and-hold by 4.6% per year, with a maximum drawdown 0.4 points shallower than holding (15.6% vs 16.0%).

How many trades did it make?

19 completed round trips over 5.7 years (38 fills), with 37% of round trips closing profitably.

Why 10 and 50 days?

A common intermediate-trend pairing. It reacts within weeks and ignores single bad days. Both windows are editable parameters in DeployQuant.

How did the SMA 10/50 trend rule do on XLP?

The $10,000 account ended at $10,714 on 2026-10-02, a CAGR of 1.21% with a maximum drawdown of 15.63%. Of 19 round trips, 7 won. Holding XLP reached $13,819.

Did the rule beat buy-and-hold on XLP?

No. Holding returned 5.8% a year against 1.21% for the rule, and the rule trailed in every calendar year. Its drawdown was 15.63% against 15.99%, almost the same.

Why did a trend rule do poorly on XLP?

XLP moved sideways in 2022 and 2023 and drifted up with dips in other years. Only 37% of trades won, and the average winner was 5.17% against an average loser of -2.28%. The crossover entered after swings began and exited after they reversed.

Would a different moving-average pair work better?

We tested 5/50, 20/50 and 10/100. They returned -0.13%, -0.25% and -0.67%, all below the published 1.21%. None came close to holding at 5.8%.

How much do trading costs matter here?

Only slightly. Charging 5 basis points gave 0.88% and 10 basis points gave 0.54%, where the free run gave 1.21%. There were 38 fills.

What is XLP?

XLP is the Consumer Staples Select Sector SPDR Fund, a defensive sector fund. It returned 40.33% over the window with annualized volatility of 13.28%.

Is this advice to trade XLP?

No. The page reports hypothetical results from a single window.

Related

SMA 10/50 Trend on all 59 ETFsfull results table All strategies on XLP12 templates compared RSI(14) Mean Reversion on XLPsame ETF, different rulesRSI(2) Dip Snapback on XLPsame 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.