SMA 10/50 Trend on XLY
Consumer Discretionary Select Sector SPDR Fund: consumer discretionary stocks, a cyclical read on the US consumer. Backtest 2021-01-04 to 2026-10-02, $10,000 starting capital, computed by the same engine that runs live DeployQuant strategies.
XLY is the Consumer Discretionary Select Sector SPDR Fund, a basket of cyclical US consumer stocks. The SMA 10/50 trend rule is run on it here: buy at the open when the 10-day simple average is above the 50-day, sell at the open when it falls below. The window is 2021-01-04 to 2026-10-02 with $10,000 to start, no margin, and no fees or slippage in the headline run.
The rule ended at $10,202, a CAGR of 0.35%, with a maximum drawdown of 27.48% and a Sharpe ratio of 0.1. It made 22 round trips and 9 of them won, a win rate of 41%. The average winner returned 6.83% and the average loser returned -4.14%, and the profit factor was 1.04.
XLY did much better on its own. Buy and hold compounded at 6.27% a year, ended at $14,177, and had a drawdown of 39.06% with a Sharpe ratio of 0.39. The rule beat the fund in only two calendar years, 2022 and 2025. It gave up a large part of the return and took a drawdown that was shallower than the fund's but still large.
The pattern is a familiar one for a fast crossover on a volatile sector fund. The rule avoided part of the 2022 bear market and then missed the first leg of the 2023 and 2024 rallies, because the averages only crossed after the fund had already moved. Three long winning trades carried the account, and a string of short losing ones took most of it back.
Year by year
| Year | SMA 10/50 trend | buy & hold |
|---|---|---|
| 2021 | −0.2% | 28.5% |
| 2022 | −20.1% | −35.7% |
| 2023 | 11.8% | 38.7% |
| 2024 | 9.1% | 26.0% |
| 2025 | 15.3% | 7.3% |
| 2026 | −9.0% | −7.2% |
Year by year against the fund
The rule returned -0.2% in 2021, -20.1% in 2022, 11.8% in 2023, 9.1% in 2024, 15.3% in 2025 and -9% in 2026 so far. Buy and hold returned 28.5%, -35.7%, 38.7%, 26%, 7.3% and -7.2%.
The two years the rule won were 2022 and 2025. In 2022 it lost 20.1% while the fund lost 35.7%, a gap of 15.6 points in the rule's favour. In 2025 it returned 15.3% against 7.3%, a gap of 8 points. In the other four periods it trailed. The gap was 28.7 points in 2021, 26.9 points in 2023, 16.9 points in 2024 and 1.8 points in 2026.
2021 shows what a crossover costs in a strong year. The fund returned 28.5% and the rule lost 0.2%. The first entry, on 2021-03-24 at an adjusted 79.57, was sold two days later at 78.98 for a loss of 0.74%. A second position from 2021-04-06 to 2021-05-19 lost 4.01%. The one good trade of the year ran from 2021-10-15 to 2021-12-21 and gained 3.86%. The fund had risen for months before the rule caught up with it.
2022 was the year the rule was meant for, and it still lost 20.1%. It closed 4 round trips that exited in 2022 and none of them won. The worst was 2022-03-29 to 2022-04-28 at -10.96% over 30 days, which is the worst trade of the whole run. The fund's own calendar return was -36.28%, so the rule saved a lot, yet mostly by being in cash during stretches when the 10-day average sat under the 50-day. A fast crossover bought several sharp rallies inside the bear market and sold after they had turned.
2023 returned 11.8% against 38.7% for the fund. The rule made 3 round trips that exited that year and 2 won. The best of them started on 2023-04-12 at 71.31 and ended on 2023-08-21 at 79.69 for 11.75% over 131 days. The entry came after the fund's low on 2022-12-28 and months into the recovery, and the account missed most of the early move.
2024 returned 9.1% against 26%. Two of the four exits won. The rule closed the year with the best trade of the window open, which carried through to February 2025. 2025 returned 15.3%, ahead of the fund by 8 points, because the same trade finished with a gain and a second long position ran through the summer rally.
Month by month
| Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2021 | 0.0% | 0.0% | −0.7% | 3.2% | −6.9% | 0.0% | 1.0% | 0.3% | −2.4% | 9.2% | 1.6% | −4.7% |
| 2022 | −3.3% | 0.0% | −3.2% | −7.7% | 0.0% | 0.0% | 6.3% | −4.4% | −4.5% | 0.0% | 0.0% | −4.8% |
| 2023 | 6.2% | −2.1% | −3.4% | 0.7% | 2.5% | 12.0% | 2.3% | −5.7% | −7.3% | 0.0% | 1.5% | 6.0% |
| 2024 | −3.7% | 3.4% | −0.1% | −3.0% | −1.6% | 1.2% | 2.7% | −7.7% | 7.2% | −1.7% | 12.6% | 1.1% |
| 2025 | 3.4% | −2.9% | 0.0% | 0.0% | 6.1% | 1.8% | 1.9% | 4.6% | 3.5% | −1.1% | −4.1% | 1.7% |
| 2026 | 1.4% | −2.6% | 0.0% | −1.5% | 2.1% | −3.4% | 0.0% | −2.2% | −3.1% | 0.0% | – | – |
The months behind the numbers
The best month for the strategy was November 2024 at +12.59%, and the worst was August 2024 at -7.72%. They sit three months apart inside one year. The August loss came from the position bought on 2024-06-13 at 88.43 and sold on 2024-08-06 at 84.27 for -4.7%, in a month when the fund fell sharply. The trade that began on 2024-08-27 then caught the autumn rally, including the November gain.
Buy and hold had its best month in July 2022 at +17.99% and its worst in April 2022 at -11.72%. The rule held the fund in July 2022 after the entry on 2022-07-21 and got +6.35% for the month, a fraction of the fund's move. In April 2022 the rule lost 7.66%, which came from the trade it opened on 2022-03-29 and closed on 2022-04-28.
June 2023 returned 11.99%, the second best month of the run, and September 2023 returned -7.31%. The September loss came from a short position, 2023-09-14 to 2023-09-25, which lost 7.51% in 11 days. That trade is a clean example of a whipsaw: the fast average had crossed up in mid-September and the fund reversed within days.
The months with a 0 mark the time in cash. The account was invested 57.9% of the time, and 22 round trips over 5.74 years is about one trade every three months. The longest hold was 170 days and the shortest was 2. The median hold was 53 days and the average was 55.4 days.
Cash months and the fund's worst days
The rule's cash months in 2022 sat on top of some of the fund's worst sessions. May and June 2022 both read 0 in the monthly table, and May 2022 holds two of the five worst days in the window, -6.54% on 2022-05-18 and -5.49% on 2022-05-05. The rule had sold on 2022-04-28 at $81.95 and bought nothing until 2022-07-21. The -5.12% day of 2022-04-26 fell inside that last losing trade, so the rule took part of the April damage and missed the May damage.
March and April 2025 were also cash, and the rule avoided the -5.97% day of 2025-04-03. The re-entry came on 2025-05-08 at $99.45, four days before the 5.07% day of 2025-05-12, and the position ran 166 days to $117.44. The months that followed were 6.08% in May, 1.82% in June, 1.85% in July, 4.59% in August and 3.48% in September, five gains in a row, which is the longest unbroken run in the monthly table.
On the calendar, the fund averaged 5.12% in November and 4.24% in July over the six Julys, against -1.9% in September and -1.56% in February. The rule's Julys were 1.04% in 2021, 6.35% in 2022, 2.25% in 2023, 2.73% in 2024 and 1.85% in 2025, with 0 in 2026. Its Septembers were mostly bad: -2.35%, -4.55%, -7.31%, 7.15%, 3.48% and -3.09%. November 2024 at 12.59% is the rule's best month.
Every trade
SMA 10/50 trend on XLY made 22 closed round trips, an average hold of 55 days, an average winner of 6.83%, an average loser of −4.14%, a profit factor of 1.04, a longest losing streak of 4. It held a position at the close on 57.9% of trading days.
| Entry | Entry price | Exit | Exit price | Return | Days held |
|---|---|---|---|---|---|
| 2021-03-24 | $79.57 | 2021-03-26 | $78.98 | −0.7% | 2 |
| 2021-04-06 | $82.76 | 2021-05-19 | $79.44 | −4.0% | 43 |
| 2021-06-25 | $85.48 | 2021-08-25 | $86.68 | 1.4% | 61 |
| 2021-09-02 | $88.21 | 2021-10-12 | $87.76 | −0.5% | 40 |
| 2021-10-15 | $89.84 | 2021-12-21 | $93.31 | 3.9% | 67 |
| 2022-01-05 | $100.26 | 2022-01-12 | $96.92 | −3.3% | 7 |
| 2022-03-29 | $92.04 | 2022-04-28 | $81.95 | −11.0% | 30 |
| 2022-07-21 | $73.69 | 2022-09-23 | $71.47 | −3.0% | 64 |
| 2022-12-05 | $69.53 | 2022-12-15 | $66.14 | −4.9% | 10 |
| 2023-01-24 | $67.72 | 2023-03-14 | $68.07 | 0.5% | 49 |
| 2023-04-12 | $71.31 | 2023-08-21 | $79.69 | 11.8% | 131 |
| 2023-09-14 | $84.44 | 2023-09-25 | $78.10 | −7.5% | 11 |
| 2023-11-16 | $81.08 | 2024-01-29 | $84.06 | 3.7% | 74 |
| 2024-02-09 | $87.07 | 2024-04-15 | $87.23 | 0.2% | 66 |
| 2024-05-17 | $86.98 | 2024-05-24 | $85.55 | −1.6% | 7 |
| 2024-06-13 | $88.43 | 2024-08-06 | $84.27 | −4.7% | 54 |
| 2024-08-27 | $91.32 | 2025-02-13 | $110.93 | 21.5% | 170 |
| 2025-05-08 | $99.45 | 2025-10-21 | $117.44 | 18.1% | 166 |
| 2025-10-27 | $118.98 | 2025-11-17 | $114.03 | −4.2% | 21 |
| 2025-12-09 | $116.60 | 2026-02-10 | $117.25 | 0.6% | 63 |
| 2026-04-20 | $119.69 | 2026-06-12 | $116.17 | −2.9% | 53 |
| 2026-08-11 | $119.06 | 2026-09-09 | $112.65 | −5.4% | 29 |
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.
Three big winners and a long list of small losses
Nine trades won and 13 lost. The three largest winners were 2024-08-27 to 2025-02-13 at +21.47% over 170 days, 2025-05-08 to 2025-10-21 at +18.09% over 166 days and 2023-04-12 to 2023-08-21 at +11.75% over 131 days. The next two were 3.86% and 3.68%. Those three trades did the work, and every other winner was small.
The five worst losses were -10.96% from 2022-03-29, -7.51% from 2023-09-14, -5.38% from 2026-08-11, -4.88% from 2022-12-05 and -4.7% from 2024-06-13. The median trade lost 0.74%, and the longest losing streak was 4 against a longest winning streak of 2.
The arithmetic of a trend rule is visible here. A win rate of 41% needs winners that are larger than losers, and the rule has that: 6.83% on average against -4.14%. The ratio only just clears the line, since the profit factor is 1.04. The equity result sits close to flat because the winners and the losers roughly cancel after the first three large trades are counted.
The last trade, 2026-08-11 to 2026-09-09, bought at 119.06 and sold at 112.65 for -5.38%. It followed another loss from 2026-04-20 to 2026-06-12 at -2.94%. The 2026 exits show 3 round trips with 1 win. The fund itself fell 7.26% in the 2026 partial year, so the rule's -9% is slightly worse than holding in the period.
The mix of entry timing is worth reading as well. The rule bought into several strong rallies late: the entry on 2025-10-27 at 118.98 was one of the highest entry prices of the run and lost 4.16% by 2025-11-17. Entries near highs, followed by a reversal that takes the 10-day average back under the 50-day, produce the whipsaw losses that fill the list. Each loss is a few percent, and several of them in a row erode the gains from the long trades.
Largest drawdowns
| Peak | Low point | Depth | Days to low | Recovered | Days to recover |
|---|---|---|---|---|---|
| 2021-11-19 | 2023-04-12 | −27.5% | 509 | 2025-07-21 | 831 |
| 2025-09-16 | 2026-09-09 | −13.0% | 358 | not yet | – |
| 2021-04-16 | 2021-08-19 | −8.8% | 125 | 2021-10-29 | 71 |
Buy-and-hold's deepest drawdown ran from 2021-11-19 to 2022-12-28 and reached −39.1%.
Drawdowns and costs
The deepest drawdown was 27.48%, from a peak on 2021-11-19 to a trough on 2023-04-12 after 509 days, and the account took 831 more days to recover, on 2025-07-21. Buy and hold peaked on the same date, 2021-11-19, and fell 39.06% to 2022-12-28, which took until 2024-11-06 to recover. The rule's drawdown was 11.58 points shallower.
The trough of the rule's drawdown, 2023-04-12, is also the date of the entry that began the 11.75% winner. The rule was in cash at the bottom of the account and re-entered after the fund had been rising. A second drawdown of 12.98% began on 2025-09-16 and reached its trough on 2026-09-09 after 358 days without recovering. A third of 8.75% ran from 2021-04-16 to 2021-08-19 and recovered on 2021-10-29.
The fund had its own second drawdown of 25.64% from 2024-12-17 to 2025-04-08, recovered on 2025-09-12, and a third of 14.79% from 2026-01-12 to 2026-03-30 with no recovery. The rule's equity did not take the 25.64% hit, which is where its 2025 gap came from.
Costs take the CAGR below zero. At 5 basis points per fill the CAGR was -0.04%, the drawdown 28% and the ending equity $9,978. At 10 basis points the CAGR was -0.45%, the drawdown 28.63% and the ending equity $9,744. The Sharpe ratio fell from 0.1 to 0.07 and 0.042. With 44 fills over the window the cost effect is modest next to the gap from buy and hold, but it is enough to turn a flat result into a small loss. XLY trades about $892,144,651 a day and a median of 15,102 shares a minute, so a $10,000 order is small against the fund's liquidity.
With trading costs
The headline run fills at the bar price. These runs charge slippage on every fill.
| Slippage per fill | CAGR | Max drawdown | Final value | Sharpe |
|---|---|---|---|---|
| None (headline) | 0.3% | −27.5% | $10,202 | 0.10 |
| 5 basis points | −0.0% | −28.0% | $9,978 | 0.07 |
| 10 basis points | −0.5% | −28.6% | $9,744 | 0.04 |
Changing the parameters
| Version | CAGR | Max drawdown | Round trips | Win rate | Final value |
|---|---|---|---|---|---|
| Published rules | 0.3% | −27.5% | 22 | 41% | $10,202 |
| SMA 5/50 | 1.2% | −28.7% | 30 | 27% | $10,730 |
| SMA 20/50 | 2.9% | −22.5% | 16 | 31% | $11,764 |
| SMA 10/100 | −0.7% | −31.9% | 12 | 42% | $9,592 |
Faster, slower and wider pairs
Three variants changed one of the two windows. SMA 5/50 returned 1.23% a year with a 28.74% drawdown, ended at $10,730 and made 30 trades with 8 wins. SMA 20/50 returned 2.87% with a 22.47% drawdown, ended at $11,764 and made 16 trades with 5 wins. SMA 10/100 returned -0.72% with a 31.9% drawdown, ended at $9,592 and made 12 trades with 5 wins.
The 20/50 pair did best, at 2.87% and the lowest drawdown of the four at 22.47%, and its Sharpe ratio of 0.274 was also the highest. A slower fast average meant fewer entries and fewer whipsaws, and the pair's 16 trades compare with the default's 22. The 5/50 pair traded most and won 8 of 30. The 10/100 pair was the worst, with the deepest drawdown at 31.9%, because the slow average of 100 days turned late in both directions.
The spread is narrow in dollar terms: the four versions finished between $9,592 and $11,764. None came close to the fund's $14,177. The 20/50 result is the best of the group, but it comes from one fund over one window, and one extra trade or one date shifted could change the order. The variants say that slowing the fast average a little helped here, and give no reason to think a particular pair holds an edge.
How XLY behaved
| Measure | XLY |
|---|---|
| Data in this test | 2021-01-04 to 2026-10-02 (1444 sessions) |
| Total return, buy and hold | 44.7% |
| Annualized volatility | 23.3% |
| Deepest drawdown | −39.7% (2021-11-19 to 2022-12-28) |
| Up days | 53.0% |
| Average daily range | 1.68% |
| Average overnight gap | 0.63% |
| Correlation to SPY | 0.87 |
| Correlation to QQQ | 0.86 |
| Correlation to TLT | 0.11 |
| Sessions above the 200-day average | 65.1% |
| Crossings of the 200-day average | 59 |
| Falls of 10% or more from a 20-day high | 24 |
XLY's volatility and why the crossover lagged
XLY gained 44.67% in total, 6.64% a year, with volatility of 23.32%. It closed higher on 53.01% of days, averaging 1.06% on up days and -1.13% on down days. Calendar returns ran 29.05% in 2021, -36.28% in 2022, 39.68% in 2023, 26.51% in 2024, 7.36% in 2025 and -7.26% in 2026 so far.
The fund had 24 drawdown events of 10% or more within 20 days, spread over 98 days. Those are the sharp pullbacks that make a 10-day average dip below a 50-day one and trigger a sale. The best day was +10.79% on 2025-04-09 and the worst was -6.54% on 2022-05-18. The best days came in sharp rebounds, and the rule was in cash for some of them, including the rebound of 2022-11-10 at +7.27%.
Price held above the 200-day average on 65.06% of sessions, with 59 crossings. The lag-1 autocorrelation was -0.02, which shows little day-to-day persistence. A crossover earns from strong trends that last for months, and the fund's trends were interrupted by sharp reversals.
The RSI figures give a contrast. RSI(14) fell below 30 on 27 sessions, with a median 20-day forward return of -0.78% against a baseline of 0.77%. RSI(2) below 10 occurred on 152 sessions, with a median 5-day forward return of 0.74% against 0.22%, and a 20-day return of 1.8%. Short-term oversold readings were followed by rebounds in this fund, which favours the mean reversion rules listed below over the trend rule.
The overnight share of the return was 89.7% and the intraday share was 10.3%. The fund's beta to SPY was 1.24 and its correlation was 0.87. XLY moves with the broad market and a little more than it. The XLY fund page has the full tables.
Overnight returns and the open-to-open rule
XLY earned 89.7% of its log return overnight and 10.3% during sessions, with an average overnight gap of 0.63% and an average intraday range of 1.68%. The rule buys and sells at the open, so a crossover seen in yesterday's closes is acted on after the gap has printed. For a fund where the overnight leg carried nearly all the return, the entry already includes the move that triggered it.
Weekday averages were small: Monday 0.13%, Friday 0.08%, Wednesday 0.05%, Tuesday 0.01% and Thursday -0.08%. The fund's largest day, 10.79% on 2025-04-09, and its second largest, 7.27% on 2022-11-10, both fell where the rule held nothing. The rule bought on 2022-12-05 at $69.53, after the 2022-11-10 jump, and sold on 2022-12-15 at $66.14 for -4.88%, its fourth worst trade. In that case the crossover turned bullish after the rebound day, and the next leg down was inside the trade.
Daily dollar volume of $892,144,651 puts XLY far above the thin funds elsewhere in the library. The 5 basis point cost run is the closer match for a fund this liquid, and it moves the CAGR from 0.35% to -0.04%.
The rules
A faster moving-average crossover: hold while the 10-day average is above the 50-day.
- WHEN the market opens · IF not invested AND SMA(10) > SMA(50) · THEN buy with 98% of the sleeve
- 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.
Other rules on XLY and other sector funds
The SMA 10/50 rule ranked 9th of 12 on XLY. The best was the weekly 7% target at 10.19% a year with a 24.73% drawdown, followed by RSI(2) snapback at 8.2% with 16.62% and RSI mean reversion at 7% with 20.65%. All three are mean reversion or profit target rules. The EMA 12/26 trend returned 2.36% and the golden cross returned 1.35%, both ahead of the SMA 10/50.
Below it were the 200-day regime filter at -2.16%, the 3-month momentum at -3.94% and the trend with trailing stop at -4.4% with a 39.69% drawdown. No trend rule beat buy and hold's 6.27% on this fund. Buy and hold itself would have ranked 4th by CAGR among these rules.
Among sector funds, the same SMA 10/50 rule returned 9.47% on XLK, 7.65% on SOXX, 6.06% on VOX, 4.02% on XLF and 1.21% on XLP. XLY at 0.35% is last of the six. The category median was 6.06% against 2.12% across all 59 ETFs, and XLY ranked 41st of 59 for the rule.
One 5.74-year window, daily decisions and a long-only position set the limits. With 22 trades, three of them produced the whole gain. The window holds one bear market and every number is hypothetical.
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 XLY?
Over 2021-01-04 to 2026-10-02, SMA 10/50 trend on XLY returned 0.3% annualized vs 6.3% for buy-and-hold: it trailed buy-and-hold by 5.9% per year, with a maximum drawdown 11.6 points shallower than holding (27.5% vs 39.1%).
How many trades did it make?
22 completed round trips over 5.7 years (44 fills), with 41% 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.
Does the SMA 10/50 trend rule work on XLY?
It made a small profit in the headline run: 0.35% a year over 2021-01-04 to 2026-10-02, finishing at $10,202. Buy and hold made 6.27% a year. Adding 5 basis points a fill takes the CAGR to -0.04%.
How often does the rule win on XLY?
9 of 22 round trips won, a 41% win rate. Winners averaged 6.83% and losers averaged -4.14%. Three trades of 11.75% or more produced most of the gains.
How deep was the drawdown compared with buy and hold?
27.48% for the rule and 39.06% for buy and hold. Both peaked on 2021-11-19. The rule's account regained its high on 2025-07-21.
Which SMA pair did best on XLY?
SMA 20/50, at 2.87% a year with a 22.47% drawdown and $11,764 at the end. SMA 5/50 made 1.23% and SMA 10/100 made -0.72%, against 0.35% for the default 10/50.
Why did the rule lose to buy and hold in most years?
It trailed in 2021, 2023, 2024 and 2026 because its signals arrived after the fund's moves. It led in 2022 and 2025, when sharp reversals made cash worth holding. XLY made 29.05% in 2021 and 39.68% in 2023.
Which strategy did best on XLY in this test?
The weekly 7% target, at 10.19% a year with a 24.73% drawdown, then RSI(2) snapback at 8.2% and RSI mean reversion at 7%. The SMA 10/50 trend placed 9th of 12.
Related
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.