RSI(14) Mean Reversion 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.
RSI(14) mean reversion worked well on the Consumer Staples Select Sector SPDR Fund (XLP) in this window. The rule bought when the 14-day RSI closed under 30 and sold when it climbed over 70. Between 2021-01-04 and 2026-10-02 it made 16 round trips, won 13 of them, and grew $10,000 to $14,360. That is a CAGR of 6.51% with a maximum drawdown of 9.64% and a Sharpe ratio of 0.75.
A holder who bought XLP at the first open finished with $13,819 (5.8% a year), after a 15.99% peak-to-trough loss, and a Sharpe ratio of 0.51. The rule was ahead on all three measures while sitting in the fund for 41.7% of trading days. A win rate of 81% and a profit factor of 8.55 are unusual for a simple rule, and they come with a catch that the trade list makes plain: the average winner was 3.29%, the average loser was -1.58%, and there were only three losers in the whole run.
XLP is a defensive sector fund with annualized volatility of 13.28%, and its RSI rarely reached the oversold zone. That matters for the rule, because it only acts on the rare dips. The strategy is described on the RSI mean reversion page and the fund has an XLP page with all twelve templates. Sixteen trades over 5.74 years, with no fees in the headline run, is a small sample.
Year by year
| Year | RSI mean reversion | buy & hold |
|---|---|---|
| 2021 | 13.4% | 18.1% |
| 2022 | 5.4% | −0.7% |
| 2023 | −0.5% | −0.9% |
| 2024 | 3.4% | 12.0% |
| 2025 | 9.2% | 1.5% |
| 2026 | 6.9% | 5.6% |
How each year compared with holding
The rule returned 13.4% in 2021, 5.4% in 2022, -0.5% in 2023, 3.4% in 2024, 9.2% in 2025 and 6.9% in 2026 so far. Holding returned 18.1%, -0.7%, -0.9%, 12%, 1.5% and 5.6%. The rule was ahead in 2022, 2023, 2025 and 2026, and behind in 2021 and 2024, the two years when the fund made its biggest gains.
2021 was the clearest case of the rule lagging in a strong year. The rule bought on 2021-02-01 at an adjusted $55.4 and sold on 2021-03-19 at $56.94 for 2.78%. It then waited until 2021-09-29 for the next signal, so April through August are all zeros in the monthly table. The trade from 2021-09-29 to 2021-10-21 returned 2.07%. The one big trade of the year was the entry on 2021-12-02 at $61.7, sold on 2021-12-17 at $66.91 for 8.44%, which is the best trade of the run and made December 2021 the rule's best month at 8.25%. Holding made 10.36% that same month. The rule finished the year with a gain that was smaller by 4.7 points for a simple reason: it was in cash for most of the spring and summer while the fund rose.
2022 was the year the rule did its best work. Buy-and-hold lost 0.7% and the rule made 5.4%. The fund spent the year in a fall, with a drawdown of 16.27% on the profile from 2022-04-20 to 2022-10-07. The rule entered on 2022-01-26 and held through to 2022-03-29 for 2.7%, entered again on 2022-05-19 at $62.85 and held to 2022-07-07 for 3.47%, then entered on 2022-09-06 at $64.9. That last trade is worth a look. September 2022 returned -7.41% for the rule, its worst month, as the fund dropped, and then October 2022 returned 7.32%. The trade closed on 2022-10-28 at $64.48, a loss of only 0.65%. A rule with no stop-loss sat through the whole dip and ended near flat.
2023 returned -0.5% against -0.9%. The year had three round trips, two wins. The two wins were 2.29% from 2023-01-30 to 2023-03-30 and 0.44% from 2023-05-23 to 2023-06-23. The loser was the entry on 2023-08-18 at $66.53, held 90 days and sold on 2023-11-16 at $64.39 for -3.22%, the worst trade of the run. September 2023 cost the rule 4.64% and October another 1.38%.
2024 returned 3.4% against 12%, the widest gap in the rule's disfavor at -8.6 points. The rule made two trades, both winners: 2.36% from 2024-04-15 to 2024-05-03 and 2.4% from 2024-10-04 to 2024-11-27. For the other months it was in cash while the fund made most of its year.
2025 was the rule's best year relative to holding, 9.2% against 1.5%. It entered on 2024-12-19 at $76.05 and exited on 2025-02-24 for 2.95%, then entered on 2025-03-21 at $75.61 and held 152 days, the longest hold, to 2025-08-20 for 5.89%. A late entry on 2025-09-11 lost 0.88% by 2025-11-28. The fund's worst day of 2025 was -4.24% on 2025-04-04, and its best was 3.81% on 2025-04-09. The rule was invested through both.
2026 is a partial year. The rule returned 6.9% against 5.6%. A six-day trade from 2026-01-08 at $75.16 to 2026-01-14 at $79.8 returned 6.17%, which is most of the 6.04% January figure. The entry on 2026-03-16 at $83.71 lasted 65 days and returned 0.8%.
Month by month
| Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2021 | 0.0% | −1.6% | 4.4% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | −0.9% | 3.0% | 0.0% | 8.3% |
| 2022 | 2.2% | −1.3% | 1.7% | 0.0% | 4.9% | −2.3% | 0.9% | 0.0% | −7.4% | 7.3% | 0.0% | 0.0% |
| 2023 | 1.2% | −2.3% | 3.4% | 0.0% | −2.3% | 2.8% | 0.0% | 0.1% | −4.6% | −1.4% | 2.9% | 0.0% |
| 2024 | 0.0% | 0.0% | 0.0% | 2.1% | 0.2% | 0.0% | 0.0% | 0.0% | 0.0% | −1.1% | 3.5% | −1.3% |
| 2025 | 0.5% | 3.7% | 3.6% | 0.2% | 1.2% | −1.6% | −1.4% | 3.7% | −1.5% | −2.6% | 3.3% | 0.0% |
| 2026 | 6.0% | 0.0% | −3.3% | 2.8% | 1.4% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | – | – |
What the monthly table shows
The rule was in cash in many months, and the zeros are visible: April through August 2021, April 2022, August 2022 and November and December 2022, and most of early 2024. The 41.7% exposure means the position was open on well under half of all sessions. That is by design, since RSI(14) under 30 is a rare condition for this fund. The fund had only 37 such sessions in the window, against 73 sessions with RSI(14) above 70.
The best months for the rule were December 2021 at 8.25%, October 2022 at 7.32%, January 2026 at 6.04% and May 2022 at 4.88%. The worst were September 2022 at -7.41%, September 2023 at -4.64% and March 2026 at -3.32%. Holding had its best month in December 2021 at 10.36% and its worst in March 2026 at -8.31%. In March 2026 the rule lost 3.32% while the holder lost 8.31%.
September deserves a note. XLP averaged -3.79% in September over six years, the weakest month by a wide margin, and both of the rule's worst months were Septembers. November was the fund's strongest month at an average of 3.33%. The rule's November 2023 was 2.86% and November 2024 was 3.48%. These averages each rest on five or six observations, so they describe this window and no more.
The pattern of the rule's returns fits the way it works. It buys after weakness, so its losing months tend to be the ones where the dip continued, and its winning months are the rebounds. A trade that starts in a decline often shows a loss for the first month and a gain for the next.
Every trade
RSI mean reversion on XLP made 16 closed round trips, an average hold of 54 days, an average winner of 3.29%, an average loser of −1.58%, a profit factor of 8.55, a longest losing streak of 1. It held a position at the close on 41.7% of trading days.
| Entry | Entry price | Exit | Exit price | Return | Days held |
|---|---|---|---|---|---|
| 2021-02-01 | $55.40 | 2021-03-19 | $56.94 | 2.8% | 46 |
| 2021-09-29 | $60.87 | 2021-10-21 | $62.13 | 2.1% | 22 |
| 2021-12-02 | $61.70 | 2021-12-17 | $66.91 | 8.4% | 15 |
| 2022-01-26 | $65.51 | 2022-03-29 | $67.28 | 2.7% | 62 |
| 2022-05-19 | $62.85 | 2022-07-07 | $65.03 | 3.5% | 49 |
| 2022-09-06 | $64.90 | 2022-10-28 | $64.48 | −0.7% | 52 |
| 2023-01-30 | $65.93 | 2023-03-30 | $67.44 | 2.3% | 59 |
| 2023-05-23 | $67.68 | 2023-06-23 | $67.98 | 0.4% | 31 |
| 2023-08-18 | $66.53 | 2023-11-16 | $64.39 | −3.2% | 90 |
| 2024-04-15 | $69.19 | 2024-05-03 | $70.82 | 2.4% | 18 |
| 2024-10-04 | $76.79 | 2024-11-27 | $78.63 | 2.4% | 54 |
| 2024-12-19 | $76.05 | 2025-02-24 | $78.29 | 3.0% | 67 |
| 2025-03-21 | $75.61 | 2025-08-20 | $80.06 | 5.9% | 152 |
| 2025-09-11 | $77.47 | 2025-11-28 | $76.79 | −0.9% | 78 |
| 2026-01-08 | $75.16 | 2026-01-14 | $79.80 | 6.2% | 6 |
| 2026-03-16 | $83.71 | 2026-05-20 | $84.38 | 0.8% | 65 |
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 16 trades
Thirteen of the 16 trades won, which is a win rate of 81%. The average winner returned 3.29% and the average loser returned -1.58%. The profit factor of 8.55 reflects that the winners were larger and far more numerous. The median trade returned 2.4% over a median hold of 54 days, and the average hold was 54.1 days. The longest hold was 152 days and the shortest was 6. Five wins in a row was the best streak, and no loss was ever followed by another, so the three losers were spread apart.
The three losers were the entry on 2023-08-18 for -3.22%, the entry on 2025-09-11 for -0.88% and the entry on 2022-09-06 for -0.65%. All three entered during a September or late-summer slide. The best winners were 8.44% from 2021-12-02, 6.17% from 2026-01-08, 5.89% from 2025-03-21, 3.47% from 2022-05-19 and 2.95% from 2024-12-19.
Grouped by the year each trade closed: 2021 went 3 for 3, 2022 and 2023 were 2 for 3, 2024 was 2 for 2, 2025 was 2 for 3 and 2026 was 2 for 2. The rule never lost in 2021 or 2024 or 2026 on the trade list.
The size of the wins is modest. Ten of the 16 trades earned between 0.44% and 3.47%. A rule that holds until RSI is above 70 takes a modest gain whenever the fund bounces and waits for the next dip. The 8.44% and 6.17% winners were fast, with holds of 15 and 6 days, which suggests the largest gains came from sharp rebounds in a fund that is otherwise calm.
The template has no stop-loss, and its caveat is that RSI can stay oversold for weeks while the position keeps losing. The worst trade held for 90 days and lost 3.22%. XLP's dips were shallow enough that the missing stop never cost much in this window. A fund with deeper declines would test that gap harder.
Largest drawdowns
| Peak | Low point | Depth | Days to low | Recovered | Days to recover |
|---|---|---|---|---|---|
| 2022-09-12 | 2022-10-07 | −9.6% | 25 | 2023-08-18 | 315 |
| 2023-08-30 | 2023-10-12 | −8.7% | 43 | 2024-10-15 | 369 |
| 2022-05-27 | 2022-06-17 | −8.1% | 21 | 2022-09-12 | 87 |
Buy-and-hold's deepest drawdown ran from 2022-04-20 to 2022-10-07 and reached −16.0%.
The drawdowns
The deepest drawdown on the rule was 9.64%, from the peak on 2022-09-12 to a low on 2022-10-07, 25 days later, and it recovered on 2023-08-18, 315 days after the low. The second was 8.65%, from 2023-08-30 to 2023-10-12, recovering 369 days later on 2024-10-15. The third was 8.05%, from 2022-05-27 to 2022-06-17, recovered by 2022-09-12.
The 9.64% drawdown is the 2022 September trade seen from the inside. The account peaked, the fund fell, and the position was open until the rebound. The equity recovered only after the exit and the following months. The 2023 drawdown is the 2023-08-18 entry, the worst trade, in which the rule bought a fall that did not end quickly.
Buy-and-hold's drawdowns were deeper. The worst was 15.99%, from 2022-04-20 to 2022-10-07, with recovery on 2024-03-28, 538 days after the low. A second, of 9.52%, began on 2026-02-27, bottomed on 2026-03-20 and was still open at the end of the data. A third was 8.37%, from 2025-08-20 to 2025-11-06, recovered in 69 days. The rule's three drawdowns were all shallower than the holder's deepest, which fits an account that was invested part of the time.
The rule's drawdowns share a feature. Each ended in a rebound that restored the old high, though slowly, since the 2023 episode took 369 days to climb back.
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) | 6.5% | −9.6% | $14,360 | 0.75 |
| 5 basis points | 6.2% | −9.7% | $14,136 | 0.72 |
| 10 basis points | 5.9% | −9.9% | $13,917 | 0.69 |
Cost runs
Adding 5 basis points per fill takes the CAGR down to 6.21% and the end value down to $14,136. At 10 basis points the CAGR was 5.93% and the end value was $13,917. The drawdown widened from 9.64% to 9.73% and 9.87%. The Sharpe ratio went from 0.75 to 0.723 and 0.691.
With 32 fills the rule pays the cost 32 times. At 10 basis points the CAGR of 5.93% and the end value of $13,917 stayed just above the holder's 5.8% and $13,819. Liquidity is ample: $854,044,173 traded on an average day and 17,592 shares in the median minute, so the cost assumptions lean cautious.
Changing the parameters
| Version | CAGR | Max drawdown | Round trips | Win rate | Final value |
|---|---|---|---|---|---|
| Published rules | 6.5% | −9.6% | 16 | 81% | $14,360 |
| RSI < 25 / > 70 | 4.1% | −9.7% | 12 | 75% | $12,592 |
| RSI < 35 / > 70 | 3.9% | −16.1% | 17 | 65% | $12,443 |
| RSI < 30 / > 65 | 4.4% | −9.7% | 16 | 63% | $12,827 |
| RSI < 30 / > 75 | 5.3% | −9.6% | 13 | 85% | $13,458 |
What the parameter variants show
Four variants were tested. Buying under 25 instead of 30 returned 4.1% with a 9.68% drawdown over 12 trades, 9 winners, ending at $12,592. Buying under 35 returned 3.88% with a 16.12% drawdown over 17 trades, 11 winners, ending at $12,443. Selling above 65 returned 4.43% with 9.66% and 16 trades, 10 winners. Selling above 75 returned 5.31% with 9.64% and 13 trades, 11 winners, ending at $13,458.
Every variant did worse than the published 30/70 pair on return. The published rule's 6.51% sits above all four. That is a sign the result may be tuned to this window and fund, and it is a reason to read 6.51% with caution. The pattern still has a shape. Loosening the entry to 35 brought in more trades and a deeper drawdown, 16.12% against 9.64%, because the rule bought dips that were not yet washouts. Tightening it to 25 cut the trades to 12 and the return too, since the rule skipped some of the profitable dips. Selling earlier at 65 cut the gains from each rebound. Selling later at 75 gave 5.31%, the closest to the published rule, with fewer trades at 13.
The takeaway is limited to this fund. None of the variants changed the drawdown much except the entry at 35. The published thresholds are the textbook values, 30 and 70, and they happened to be the best of the five in this window.
How XLP behaved
| Measure | XLP |
|---|---|
| Data in this test | 2021-01-04 to 2026-10-02 (1444 sessions) |
| Total return, buy and hold | 40.3% |
| Annualized volatility | 13.3% |
| Deepest drawdown | −16.3% (2022-04-20 to 2022-10-07) |
| Up days | 51.6% |
| Average daily range | 1.12% |
| Average overnight gap | 0.29% |
| Correlation to SPY | 0.47 |
| Correlation to QQQ | 0.30 |
| Correlation to TLT | 0.13 |
| Sessions above the 200-day average | 75.1% |
| Crossings of the 200-day average | 73 |
| Falls of 10% or more from a 20-day high | 1 |
How XLP behaved
XLP is a consumer staples sector fund, described in the data as a common risk-off equity sector. Buying and holding it returned 40.33% in total, 6.08% a year on the profile numbers. By calendar year it made 18.47%, then -0.75%, -0.89%, 12.23%, 1.53% and 5.68% for 2026 to date. Up days made up 51.63% of sessions, the average day spanned a 1.12% range and the typical overnight gap was 0.29%.
Against SPY it showed a correlation of 0.47 and a beta of 0.38, and against QQQ a correlation of 0.3. It moved with the market only loosely. Its closest relatives in the data were VTV at 0.64 and VOOV at 0.63. The fund spent 75.1% of sessions above its 200-day average and crossed that average 73 times, so it drifted around the line often.
The RSI statistics bear directly on the rule. The RSI(14) closed under 30 on 37 sessions. Twenty sessions later the median gain was 2.44%, where an arbitrary session offered 0.73%. The median 5-day return was 0.59% against 0.18%. Dips in XLP were followed by recoveries more often than not in this window, which is the premise of the rule, and the evidence is 37 events. Only one slide of 10% from a 20-day high occurred, lasting 3 days. A rule with no stop has little to fear from a fund that rarely falls hard, as in this window.
Most of the fund's return arrived during the trading day. The intraday log return was 23.86% against 8.98% overnight, which makes intraday 72.64% of the total. The rule buys and sells at the open and holds through both parts. Worst days were -6.45% on 2022-05-18, -4.24% on 2025-04-04 and -3.38% on 2022-09-13, and the best day was 3.81% on 2025-04-09.
The rules
Buy when the 14-day RSI drops below 30 (oversold), sell when it recovers above 70 (overbought).
- WHEN the market opens · IF not invested AND RSI(14) < 30 · THEN buy with 98% of the sleeve
- WHEN the market opens · IF invested AND RSI(14) > 70 · THEN sell the whole position
A standard mean-reversion setup. The Relative Strength Index measures how stretched recent price action is. Readings under 30 have historically marked short-term washouts in uptrending assets. This template buys at the next session open and holds until RSI crosses back above 70. It has no profit target and no stop.
Good for: assets that trend up over time but overshoot on the way, such as broad index ETFs.
Watch out: in a persistent downtrend, RSI can stay oversold for weeks while the position keeps losing; there is no stop-loss in this template.
How the rule fits staples and its place among the templates
Entry puts 98% of the sleeve into XLP at the open following an RSI close under 30, and exit sells it all at the open following an RSI close above 70. It has no profit target and no stop. The strategy page names assets that trend up and overshoot on the way as the good fit, and XLP rose 40.33% over the window with shallow dips.
The rule ranks 2nd of 12 templates on XLP and 17th of 59 funds for this strategy. Only the RSI(2) snapback did better at 8.22% with an 11.06% drawdown. The monthly cycle returned 5.46%, the weekly 7% target 2.37%, the golden cross 2.05% and the trend with a trailing stop 1.82%. The dip buyer returned 1.32%, the SMA 10/50 trend 1.21% and the EMA 12/26 trend 1.19%. The 200-day regime filter lost 0.81%, the 3-month momentum lost 1.67% and the momentum breakout lost 1.87%. The two RSI dip-buying rules led, and the trend rules trailed.
Among sector funds the rule did better on SOXX at 12.78% with a drawdown of 35.01%, XLF at 11.82%, XLK at 8.74% and XLY at 7%. XLP at 6.51% was fifth, ahead of VOX at 2.39%. XLP had the smallest drawdown of the group by a wide margin, 9.64%, against 18.73% on XLF and 35.01% on SOXX. The median for this template was 2.98% over all 59 funds and 8.74% over the sector funds.
The return was fifth of six in its category, and the drawdown was the smallest. The limits are a single window of 5.74 years, daily decisions with minute-bar fills, no margin, a headline run with no fees and 16 trades. The result is a description of this window and not a forecast.
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 RSI mean reversion beat buy-and-hold on XLP?
Over 2021-01-04 to 2026-10-02, RSI mean reversion on XLP returned 6.5% annualized vs 5.8% for buy-and-hold: it beat buy-and-hold by 0.7% per year, with a maximum drawdown 6.3 points shallower than holding (9.6% vs 16.0%).
How many trades did it make?
16 completed round trips over 5.7 years (32 fills), with 81% of round trips closing profitably.
Why RSI 30/70?
They are the conventional oversold and overbought bands from Welles Wilder's original formulation. Treat them as a starting point. In DeployQuant you can change them to 25/65 or anything else and re-backtest in seconds.
Does this strategy use a stop-loss?
No. The only exit is RSI recovering above 70. Adding a stop or a take-profit block is a one-block edit in the Lab.
Did RSI mean reversion beat buy-and-hold on XLP?
Yes, on this window. The rule returned a 6.51% CAGR and ended at $14,360, while buy-and-hold returned 5.8% and ended at $13,819. The rule's maximum drawdown was 9.64% against 15.99%. It won in 2022, 2023, 2025 and 2026 and lost in 2021 and 2024.
How many trades did the rule make on XLP?
Sixteen round trips and 32 fills. Thirteen won, an 81% win rate, with a profit factor of 8.55. The average winner was 3.29% and the average loser was -1.58%.
What was the worst trade?
The entry on 2023-08-18 at an adjusted $66.53, sold on 2023-11-16 at $64.39 for -3.22% after 90 days. The best was the entry on 2021-12-02 at $61.7, sold on 2021-12-17 at $66.91 for 8.44%.
Why was the rule invested only part of the time?
RSI(14) closed below 30 on only 37 sessions in the window, so entry signals were rare. Exposure was 41.7% of trading days. The rest of the time the account was in cash.
Do other RSI thresholds work better?
Not in this test. Buying under 25 returned 4.1%, buying under 35 returned 3.88%, selling above 65 returned 4.43% and selling above 75 returned 5.31%. All were below the published 30/70 rule's 6.51%, which may mean the published pair suits this window.
How much do trading costs matter?
At 5 basis points per fill the CAGR is 6.21% and the end value is $14,136. At 10 basis points the CAGR is 5.93% and the end value is $13,917. XLP is liquid, so these costs are conservative.
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.