SMA-200 Trend + 15% Trailing Stop on XLF
Financial Select Sector SPDR Fund: S&P 500 banks, insurers and asset managers. Backtest 2021-01-04 to 2026-10-02, $10,000 starting capital, computed by the same engine that runs live DeployQuant strategies.
Starting with $10,000 on 2021-01-04, the SMA-200 trend rule with a 15% trailing stop reached $11,602 by 2026-10-02 on XLF. That is 16.02% in total and 2.62% a year. XLF is the Financial Select Sector SPDR Fund, which covers banks, insurers and asset managers in the S&P 500. Buy-and-hold, with 98% of the account in at the first open, compounded at 12.58% and finished at $19,742. The rule gave up 9.96 points of CAGR a year and $8,140 of final value, and its maximum drawdown of 27.95% was slightly deeper than the 25.47% for holding.
That is the least favourable outcome a rule can have against holding: lower return and a deeper worst drawdown. The Sharpe ratio was 0.26 against 0.76. The rule trailed in all six calendar years, by 36.9 points in 2021, 2 in 2022, 7.6 in 2023, 0.1 in 2024, 5.0 in 2025 and 8.7 in 2026, a partial year to 2026-10-02. It was invested on 70.6% of trading days.
The trade count is tiny. Four trades closed, two of them profitable, so the win rate was 50%, and one more position was still open. Winners averaged 20.45% and losers averaged -10.76%, for a profit factor of 1.66. The average hold was 330 days. With four closed trades, the whole result rests on one trade: the 36.67% gain between 2023-06-16 and 2025-04-04.
The library ranks this rule eleventh of 12 on XLF. For the rule itself, XLF is 29th of 59 funds, close to the all-fund median CAGR of 2.61%. The six sector funds had a median of 8.57%, which leaves XLF well under its peer group.
Year by year
| Year | trend + trailing stop | buy & hold |
|---|---|---|
| 2021 | −1.1% | 35.8% |
| 2022 | −12.4% | −10.4% |
| 2023 | 4.3% | 11.9% |
| 2024 | 29.8% | 29.9% |
| 2025 | 9.7% | 14.7% |
| 2026 | −9.8% | −1.1% |
Six years, each behind holding
2021: the rule returned -1.1% against 35.8%. The first position was entered on 2021-10-19 at $36.42. October returned 1.43%, November lost 5.65% and December gained 3.35%.
2022: -12.4% against -10.4%. The 2021 position closed on 2022-04-26 at $32.68, a loss of 10.26% over 189 days. The stop was hit once the fund had dropped 15% from the position's high. April 2022 cost the rule 7.7%. The rule then sat in cash through May to October 2022, which includes the fund's best month of the test, +11.62% in October 2022. It re-entered on 2022-11-11 at $33.46.
2023: 4.3% against 11.9%. The re-entry of 2022-11-11 closed on 2023-03-13 at $29.69 for -11.27% in 122 days, the worst trade of the test. March 2023 was the rule's worst month, -11.41%. The fund's worst days that month were -4.07% on 2023-03-09 and -3.94% on 2023-03-13, and the stop was hit on the second of those dates. The rule then bought again on 2023-06-16 at $31.90, which began the trade that decided the test. The months of that year ran from +6.68% in January and -2.28% in February to +10.59% in November and +5.37% in December.
2024: 29.8% against 29.9%. The 2023-06-16 position stayed open all year, so the rule simply owned the fund and finished within 0.1 points of it. The monthly table shows +4.74% in March, -4.04% in April, +6.32% in July and +4.39% in August, then +10.22% in November and -5.36% in December.
2025: 9.7% against 14.7%. The long position closed on 2025-04-04 at $43.60, a gain of 36.67% over 658 days, the same day the fund posted its largest daily loss of the test, -7.36%. The day before, 2025-04-03, the fund had lost 4.97%. The rule bought again on 2025-04-10 at $45.53, one session after the fund's best day, +7.59% on 2025-04-09, so the rebound that followed the sale was missed. That second position was held 351 days.
2026: -9.8% against -1.1%. The 2025 position closed on 2026-03-27 at $47.46 for 4.23%. The trail gave back part of the gain before the exit. A fresh entry on 2026-04-20 at $52.14 had not been closed by the last session and carried a gain of 2.57%. September 2026 lost 7.03% and March lost 6.48%.
Month by month
| Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2021 | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 1.4% | −5.7% | 3.4% |
| 2022 | 0.0% | −1.4% | −0.1% | −7.7% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 1.5% | −5.1% |
| 2023 | 6.7% | −2.3% | −11.4% | 0.0% | 0.0% | 0.4% | 4.7% | −2.6% | −3.0% | −2.5% | 10.6% | 5.4% |
| 2024 | 2.9% | 4.0% | 4.7% | −4.0% | 3.1% | −0.9% | 6.3% | 4.4% | −0.5% | 2.6% | 10.2% | −5.4% |
| 2025 | 6.4% | 1.4% | −4.1% | −6.3% | 4.3% | 3.1% | 0.0% | 3.1% | 0.1% | −2.7% | 1.8% | 3.0% |
| 2026 | −2.4% | −3.7% | −6.5% | −0.7% | −1.1% | 4.2% | 6.1% | 1.3% | −7.0% | 0.2% | – | – |
Month by month
The month table has three long stretches at 0.0%: 2021 January to September, 2022 May to October and 2023 April and May. The cash months are why exposure was 70.6%.
The strongest months were 2023-11 at 10.59%, 2024-11 at 10.22%, 2023-01 at 6.68%, 2025-01 at 6.37%, 2024-07 at 6.32% and 2026-07 at 6.06%. The worst were 2023-03 at -11.41%, 2022-04 at -7.7%, 2026-09 at -7.03%, 2026-03 at -6.48%, 2025-04 at -6.3% and 2021-11 at -5.65%. Holding had its best month in 2022-10 at 11.62% and its worst in 2022-06 at -10.64%, and the rule sat out both.
The fund's calendar averages put November at 4.85%, July at 4.03% and October at 3.3% as its strongest months, and September at -3.37% as the weakest. Both November 2023 and November 2024 show among the rule's best months. September 2026, at -7.03%, is consistent with the weak calendar average, though each average rests on only five or six observations.
Every trade
trend + trailing stop on XLF made 4 closed round trips and one position still open at the end of the test, an average hold of 330 days, an average winner of 20.45%, an average loser of −10.76%, a profit factor of 1.66, a longest losing streak of 2. It held a position at the close on 70.6% of trading days.
| Entry | Entry price | Exit | Exit price | Return | Days held |
|---|---|---|---|---|---|
| 2021-10-19 | $36.42 | 2022-04-26 | $32.68 | −10.3% | 189 |
| 2022-11-11 | $33.46 | 2023-03-13 | $29.69 | −11.3% | 122 |
| 2023-06-16 | $31.90 | 2025-04-04 | $43.60 | 36.7% | 658 |
| 2025-04-10 | $45.53 | 2026-03-27 | $47.46 | 4.2% | 351 |
| 2026-04-20 | $52.14 | open | – | 2.6% | – |
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.
Four closed trades and one open
Five rows cover everything the rule did.
- 2021-10-19 to 2022-04-26, $36.42 to $32.68, -10.26% over 189 days.
- 2022-11-11 to 2023-03-13, $33.46 to $29.69, -11.27% over 122 days.
- 2023-06-16 to 2025-04-04, $31.90 to $43.60, 36.67% over 658 days.
- 2025-04-10 to 2026-03-27, $45.53 to $47.46, 4.23% over 351 days.
- 2026-04-20, $52.14, open at 2.57%.
The median trade returned 4.23% and the median hold was 351 days, with holds running from 122 to 658. Two wins in a row and two losses in a row were the longest streaks. The two losses were 10.26% and 11.27%. Both were smaller than 15% because each position had risen a few percent before the stop followed it down. Both came during the 2022 and 2023 decline, and each is larger in size than the second winner of 4.23%.
The best trade, 36.67%, is the only one that justifies the rule on this fund. It lasted 658 days and survived the corrections of 2024 and early 2025 because none of them reached 15% from the position's high until April 2025. The second winner shows the cost of the trail. It returned 4.23% after 351 days, because the 15% giveback from the peak consumed most of the gain.
Per year of exit, there was one trade each in 2022, 2023, 2025 and 2026, with wins in 2025 and 2026. With 4 closed trades the win rate of 50% has a very wide margin of error, and a result built on one trade says little about the next window.
How much of the result rests on one trade
Take away the 2023-06-16 entry and the account would have had two losing trades of 10.26% and 11.27%, one small winner of 4.23% and an open position up 2.57%. The 36.67% gain over 658 days is the whole case for the rule on this fund, and it came from a single decision to buy when XLF closed above its 200-day average and a stop that stayed unhit for nearly two years.
That concentration is typical of a wide trailing stop. Few trades are made, losers are cut near 10%, and the account relies on the occasional long trend. On XLF the long trend arrived once in the window, and the exposure of 70.6% was spent mostly inside it. The other winner, the 351-day hold, shows the other side: the rule stayed invested for 351 days and still returned only 4.23%, because the stop followed the peak down.
Sale prices, re-entry prices and the days around them
Setting each stop-out beside the next buy shows what the trail cost in re-entry. The first exit was at 32.68 on 2022-04-26 and the next entry was at 33.46 on 2022-11-11. The second exit was at 29.69 on 2023-03-13 and the next entry at 31.9 on 2023-06-16. The third exit was at 43.6 on 2025-04-04 and the fourth trade began at 45.53 on 2025-04-10. The fourth exit was at 47.46 on 2026-03-27 and the open trade began at 52.14 on 2026-04-20. All four re-entries came in above the price the rule had sold at.
The days around those dates stand out in the fund's record. The 2022-11-11 entry came one session after the fund's 5.11% gain on 2022-11-10, so the rule bought after the jump, and the fund's 4.17% gain on 2022-10-13 fell while the rule was in cash. The 2025 sale on 2025-04-04 came on the fund's worst day, -7.36%, and the buy on 2025-04-10 came the session after its best day, 7.59%. The 200-day condition and the stop are both read from closes and filled at the next open, so the rule's orders follow a move by a day or more.
The 2026-03-27 sale came on the date of the trough of the fund's own 14.65% drawdown, which the buy-and-hold run recovered by 2026-07-06. The rule sold at 47.46 that day and was back in at 52.14 on 2026-04-20. The open trade stood at 2.57% on the last day.
The fund's gain of 6.09% on 2024-11-06 fell inside the 658-day position and was collected. That position is the only one in the list that a large up day helped from the inside.
Sale prices, re-entry prices and the days around them
Setting each stop-out beside the next buy shows what the trail cost in re-entry. The first exit was at 32.68 on 2022-04-26 and the next entry was at 33.46 on 2022-11-11. The second exit was at 29.69 on 2023-03-13 and the next entry at 31.9 on 2023-06-16. The third exit was at 43.6 on 2025-04-04 and the fourth trade began at 45.53 on 2025-04-10. The fourth exit was at 47.46 on 2026-03-27 and the open trade began at 52.14 on 2026-04-20. All four re-entries came in above the price the rule had sold at.
The days around those dates stand out in the fund's record. The 2022-11-11 entry came one session after the fund's 5.11% gain on 2022-11-10, so the rule bought after the jump, and the fund's 4.17% gain on 2022-10-13 fell while the rule was in cash. The 2025 sale on 2025-04-04 came on the fund's worst day, -7.36%, and the buy on 2025-04-10 came the session after its best day, 7.59%. The 200-day condition and the stop are both read from closes and filled at the next open, so the rule's orders follow a move by a day or more.
The 2026-03-27 sale came on the date of the trough of the fund's own 14.65% drawdown, which the buy-and-hold run recovered by 2026-07-06. The rule sold at 47.46 that day and was back in at 52.14 on 2026-04-20. The open trade stood at 2.57% on the last day.
The fund's gain of 6.09% on 2024-11-06 fell inside the 658-day position and was collected.
Largest drawdowns
| Peak | Low point | Depth | Days to low | Recovered | Days to recover |
|---|---|---|---|---|---|
| 2022-01-12 | 2023-10-27 | −27.9% | 653 | 2024-07-16 | 263 |
| 2026-01-06 | 2026-06-03 | −17.2% | 148 | not yet | – |
| 2025-02-18 | 2025-04-21 | −15.7% | 62 | 2025-09-19 | 151 |
Buy-and-hold's deepest drawdown ran from 2022-01-12 to 2022-10-12 and reached −25.5%.
The worst declines in the account
The account's largest decline started from the high of 2022-01-12 and reached 27.95% on 2023-10-27, 653 days on. The account got back to its peak on 2024-07-16, 263 days after the low. A second drawdown of 17.17% began on 2026-01-06, reached its low on 2026-06-03 and had not recovered at the end. A third of 15.73% ran from 2025-02-18 to 2025-04-21 and recovered on 2025-09-19.
The fund itself fell 25.47% from that same 2022-01-12 high to 2022-10-12 and was back at the high on 2024-02-22. It also had 15.33% from 2025-02-18 to 2025-04-08 and 14.65% from 2026-01-06 to 2026-03-27.
The rule's trough came more than a year after the fund's. The fund bottomed on 2022-10-12. The rule was in cash from April to November 2022, bought on 2022-11-11 after the fund's low, and then lost 11.27% on that position by 2023-03-13. A trailing stop waits for a 15% fall before acting, and for a fund with 18.43% volatility that signal comes late.
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) | 2.6% | −27.9% | $11,602 | 0.26 |
| 5 basis points | 2.5% | −28.1% | $11,558 | 0.26 |
| 10 basis points | 2.5% | −28.2% | $11,504 | 0.25 |
Slippage
Headline fills cost nothing. Adding 5 basis points per fill gives a CAGR of 2.55%, the final value $11,558, the drawdown 28.13% and the Sharpe ratio 0.255. At 10 basis points the CAGR was 2.47%, the final value $11,504, the drawdown 28.24% and the Sharpe ratio 0.249. The rule made 9 fills, so friction is almost irrelevant on this page. XLF itself changes hands at about $1,682,204,673 a day, with a median minute volume of 62,901, so a small order moves nothing.
Changing the parameters
| Version | CAGR | Max drawdown | Round trips | Win rate | Final value |
|---|---|---|---|---|---|
| Published rules | 2.6% | −27.9% | 4 | 50% | $11,602 |
| 10% trailing stop | 4.2% | −21.9% | 8 | 25% | $12,660 |
| 20% trailing stop | 5.3% | −29.3% | 1 | 0% | $13,442 |
| 25% trailing stop | 4.1% | −33.6% | 1 | 0% | $12,625 |
How XLF behaved
| Measure | XLF |
|---|---|
| Data in this test | 2021-01-04 to 2026-10-02 (1444 sessions) |
| Total return, buy and hold | 102.9% |
| Annualized volatility | 18.4% |
| Deepest drawdown | −25.9% (2022-01-12 to 2022-10-12) |
| Up days | 52.9% |
| Average daily range | 1.40% |
| Average overnight gap | 0.49% |
| Correlation to SPY | 0.77 |
| Correlation to QQQ | 0.59 |
| Correlation to TLT | -0.05 |
| Sessions above the 200-day average | 71.2% |
| Crossings of the 200-day average | 38 |
| Falls of 10% or more from a 20-day high | 10 |
The rules
Enter when price is above the 200-day average; exit only when a 15% trailing stop is hit.
- WHEN the market opens · IF not invested AND yesterday's close > SMA(200) · THEN buy with 98% of the sleeve
- WHILE invested · a managed trailing stop follows 15% below the position's high-water mark
A hybrid of the regime filter and the trailing stop. The 200-day average decides when to get in, and a 15% trail from the position's high-water mark decides when to get out. Winners can run well past the point where a crossover would have exited, and the position gives back 15% from every peak.
Good for: long trends with moderate pullbacks; the 15% trail is wide enough to survive normal corrections.
Watch out: every exit gives back 15% from the peak, and on choppy assets it re-enters above the 200-day repeatedly after each stop-out.
What a 15% trail does on a financial fund
Entry depends on one condition: a flat account and a prior close above the 200-day average, which triggers a buy of 98% of the sleeve at the next open. Exit depends on a managed stop that trails 15% under the highest level the position has reached. The rule has no profit target and does not exit when price falls back below the average, so any dip shallower than the trail leaves the position alone.
The library's notes describe the intended use as long trends with moderate pullbacks, where 15% is wide enough to ride out ordinary corrections, and they list the cost: each exit hands back 15% from the peak, and on choppy funds the rule keeps re-entering above the 200-day line after each stop-out. XLF had an annualized volatility of 18.43%, and drops of 10% or more from a 20-day high happened 10 times, over 45 days. A stop that wide should rarely fire on a fund like that, yet it fired four times in five years.
Nine months of zeros open the monthly table, and the first entry came on 2021-10-19. A 200-day average needs 200 sessions of data, and the window starts on 2021-01-04, which would produce exactly this delay. While the rule waited, holding made 35.8% over 2021 as a whole, so the 36.9-point gap that year is partly warm-up.
Trailing stop width
Three alternative trails were tested. A 10% trail returned 4.19% a year with a 21.86% drawdown, 8 trades and 2 wins, ending at $12,660. A 20% trail returned 5.29% with a 29.28% drawdown and 1 trade with no wins, ending at $13,442. A 25% trail returned 4.14% with a 33.6% drawdown and 1 trade with no wins, ending at $12,625.
All three variants beat the published 15% trail on CAGR, which returned 2.62%. The 10% trail also had the shallowest drawdown of the four. The 20% and 25% versions recorded one trade each with no wins, which points to a stop that was rarely reached. On this fund and window the 15% trail was a worse setting than its neighbours: tight enough to stop out in the 2022 and 2023 declines and too wide to avoid a loss when it did. The variants are one window each, so none is evidence of a better rule.
Weekday averages and what short-term RSI says about XLF
XLF's average return was 0.08% on Mondays, 0.07% on Wednesdays and Fridays, 0.04% on Tuesdays and 0.03% on Thursdays. The lag-1 autocorrelation was 0.02. Both are small, so day-of-week and day-to-day patterns offered a daily rule little. Overnight moves made up 62.56% of the fund's log return and the intraday session 37.44%. The rule buys and sells at the open, so a position holds the overnight part by construction.
RSI(14) closed below 30 on 30 sessions and above 70 on 96. After the oversold closes the median 5-day return was 0.75% against a baseline of 0.42%, and the median 20-day return was 3.18% against 1.5%. RSI(2) closed below 10 on 169 sessions, with medians of 0.38% over 5 days and 1.89% over 20. The fund's dips were followed by gains a little above its ordinary drift, which fits the ranking on XLF, where the RSI mean reversion template and the monthly cycle placed first and second. A trend rule that waits for a close above the 200-day average buys after such dips have already reversed.
FAS, the 3x financial fund, had a correlation of 1 with XLF. The inverse funds SH, SDS and SPDN sat between -0.78 and -0.77, and UVXY at -0.64 and VXZ at -0.62 were the volatility funds that moved most against it.
Weekday averages and what short-term RSI says about XLF
XLF's average return was 0.08% on Mondays, 0.07% on Wednesdays and Fridays, 0.04% on Tuesdays and 0.03% on Thursdays. The lag-1 autocorrelation was 0.02. Both are small, so day-of-week and day-to-day patterns offered a daily rule little. Overnight moves made up 62.56% of the fund's log return and the intraday session 37.44%. The rule buys and sells at the open, so a position holds the overnight part by construction.
RSI(14) closed below 30 on 30 sessions and above 70 on 96. After the oversold closes the median 5-day return was 0.75% against a baseline of 0.42%, and the median 20-day return was 3.18% against 1.5%. RSI(2) closed below 10 on 169 sessions, with medians of 0.38% over 5 days and 1.89% over 20. The fund's dips were followed by gains a little above its ordinary drift, which fits the ranking on XLF, where the RSI mean reversion template and the monthly cycle placed first and second. A trend rule that waits for a close above the 200-day average buys after such dips have already reversed.
FAS, the 3x financial fund, had a correlation of 1 with XLF. The inverse funds SH, SDS and SPDN sat between -0.78 and -0.77, and UVXY at -0.64 and VXZ at -0.62 were the volatility funds that moved most against it.
How XLF behaved
As a fund, XLF gained 102.88%, a CAGR of 13.11%, with annualized volatility of 18.43%. Its worst drawdown, 25.87%, ran from 2022-01-12 to 2022-10-12 and was recovered on 2024-02-22, and the longest time under water was 528 sessions. Up days were 52.88% of the total. Average up and down days were both 0.86%, inside an average range of 1.4%.
Beta to SPY was 0.87 and to QQQ 0.48, with correlations of 0.77 and 0.59. Price finished above the 200-day average on 71.16% of sessions and crossed the line 38 times. For a rule built on that line, 38 crossings in 1444 sessions is a lot of back and forth, and the 15% trail meant only a few of them led to a trade. The closest relatives are FAS at 1.0 and VTV and VOOV at 0.89.
The same rule returned 19.81% on SOXX, 12.49% on XLK, 8.57% on VOX, 1.82% on XLP and -4.4% on XLY. SOXX made 14 round trips and VOX made 3.
Other rules did better here. The RSI mean reversion template led at 11.82% with an 18.73% drawdown, the monthly cycle came next at 11.63%, and the RSI(2) snapback made 9.72% with a 14.57% drawdown. The golden cross made 3.6%, and the 200-day regime filter was last at 2.06%. Rankings for all twelve are on the page of all strategies on XLF, and other funds for this rule are in the trend plus trailing stop hub.
One window of 5.7 years supports everything above. The headline run has no fees, decisions are daily, there is no margin, and trade-list prices are adjusted for splits and dividends. All results are hypothetical, and four closed trades are too few to say how the rule would do on another window.
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 trend + trailing stop beat buy-and-hold on XLF?
Over 2021-01-04 to 2026-10-02, trend + trailing stop on XLF returned 2.6% annualized vs 12.6% for buy-and-hold: it trailed buy-and-hold by 10.0% per year, with a maximum drawdown of 27.9% (buy-and-hold: 25.5%).
How many trades did it make?
4 completed round trips over 5.7 years (9 fills), with 50% of round trips closing profitably.
Why 15% rather than 10%?
A wider trail survives routine corrections and gives back more at the end. Both numbers are one-field edits in DeployQuant, so you can backtest both and compare.
How did the SMA-200 trend rule with a 15% trailing stop compare with holding XLF?
It finished behind. The rule compounded at 2.62% a year and ended at $11,602, while holding compounded at 12.58% and ended at $19,742. It trailed in all six calendar years, and its maximum drawdown of 27.95% was slightly deeper than the 25.47% for holding.
How often did this rule trade XLF?
Only four trades closed over the whole window, with a fifth open at the end. Two of the four won, a win rate of 50%. The average winner returned 20.45% and the average loser returned -10.76%.
What was the best trade?
The entry on 2023-06-16 at $31.90, closed on 2025-04-04 at $43.60 for 36.67% over 658 days. The stop was hit on a day the fund fell 7.36%.
Does a wider or tighter trailing stop work better on XLF?
All three alternatives beat the 15% trail on CAGR. A 10% trail returned 4.19%, a 20% trail 5.29% and a 25% trail 4.14%. The wider two made only one trade each, so these are thin single-window results.
Why was the first entry in October 2021?
The 200-day average needs 200 sessions of data and the window starts on 2021-01-04, which fits a first entry on 2021-10-19. The rule was in cash for the first nine months.
Do trading costs matter for this rule on XLF?
Very little. At 5 basis points per fill the CAGR was 2.55% and at 10 basis points it was 2.47%. The rule made only 9 fills.
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.