Learn › Strategies › 20-Day Momentum + Trailing Stop › XLF

20-Day Momentum + 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.

Result: momentum breakout on XLF turned $10,000 into $14,738 (47.4% total, 7.0% CAGR): it trailed buy-and-hold by 5.6% per year, with a maximum drawdown 7.8 points shallower than holding (17.6% vs 25.5%).

The 20-day momentum breakout with a trailing stop buys the Financial Select Sector SPDR Fund (XLF) with 98% of the sleeve at the open once the fund's 20-day return is above +10%. After that, a trailing stop sits 10% below the position's high-water mark, ratchets up with each new high close and never moves down. There is no profit target. From $10,000 on 2021-01-04, the rule reached $14,738.31 by 2026-10-02, a CAGR of 6.99% with a Sharpe ratio of 0.6 and a max drawdown of 17.64%.

Buy-and-hold on XLF ended at $19,741.85, a CAGR of 12.58% with a Sharpe of 0.76 and a max drawdown of 25.47%. The rule gave up return and took less drawdown. Five round trips and 10 fills produced 3 winners, with the account invested 60% of the time.

XLF is a sector fund of banks, insurers and asset managers. A breakout rule needs the fund to move 10% in four weeks, and XLF did that only a handful of times in five and a half years. The rule had long periods in cash, and the entries it did take came late in the move. The result is one that depends on two or three positions.

Among the 12 templates the rule placed 5th on XLF, and XLF placed 17th of 59 funds for this template. The middle fund of the 59 earned a CAGR of 0% under this rule, so 6.99% is above the median.

7.0%CAGR
12.6%buy & hold CAGR
−17.6%max drawdown
0.60Sharpe ratio
5round trips
60%win rate
■ momentum breakout   ■ buy & hold, $10,000 invested 2021-01-04

Year by year

Yearmomentum breakoutbuy & hold
202117.4%35.8%
2022−9.8%−10.4%
20234.6%11.9%
202429.8%29.9%
202510.3%14.7%
2026−7.0%−1.1%

How each year went

Each year is compared with buy-and-hold in the yearly table, and the pattern is that the rule lagged in strong years and held up in weak ones.

2021: the rule returned 17.4% and holding returned 35.8%, a gap of 18.4 points, the widest of the six years. The rule was in cash in January, lost 4.22% in February, and bought on 2021-02-25 at an adjusted $30.58. That entry came after the fund had already risen, and the rule missed the earlier part of the year. March to May added 5.75%, 6.35% and 4.72%, and October added 7.15%. November lost 5.66%, and the trade stayed open into the following year.

2022: the rule lost 9.8% and holding lost 10.4%, so it beat holding by 0.6 points, the only year it came out ahead. The first trade was stopped out on 2022-01-24 at $34.605 for a gain of 13.16% over 333 days, after a January loss of 3.83%. From February to July the monthly table shows 0.0%, which means the rule was flat. It bought again on 2022-08-11 at $32.61 and was stopped out on 2022-09-21 at $30.132, a loss of 7.6%. It bought a third time on 2022-10-31 at $31.78. That position had a small October loss of 0.06%, a November gain of 6.82% and a December loss of 5.08%.

Holding lost 10.64% in June 2022 alone, and the rule was flat for that month. In the second half of the year it took two entries, and one of them lost 7.6% within six weeks. Over the whole year the two ended within a point of each other.

2023: the rule returned 4.6% against 11.9%, a gap of 7.3 points. The third position from 2022 lasted until 2023-03-09, with a January gain of 6.69% followed by losses of 2.28% in February and 6.34% in March, and closed at $31.437 for a loss of 1.08%. The rule then sat in cash from April to October. The next entry was 2023-11-27 at $33.67. XLF gained 12.11% over the calendar year, and most of that came while the rule was on the sideline.

2024: the rule returned 29.8% and holding returned 29.9%. The yearly gap was 0.1 points. The 2023-11-27 position was open for all of 2024 and earned what the fund earned, with November 2024 the best month of the run at 10.22%. December lost 5.36% and April lost 4.04%.

2025: the rule returned 10.3% against 14.7%, a gap of 4.4 points. January gained 6.37% and February 1.37%. March lost 9.08%, the worst month of the run, and the stop fired on 2025-03-11 at $46.161. That trade returned 37.1% over 470 days, the best of the run. April shows 0.0% because the rule was in cash, and the rule bought again on 2025-05-06 at $47.97.

2026 is a partial year. The rule lost 7% and holding lost 1.1%. January 2026 lost 2.35% and February lost 4.74%, and the stop fired on 2026-02-23 at $50.247 for a gain of 4.75% on the trade. From March to October the rule has had no entry, which is why those months show 0.0%. Holding's decline in 2026 was shallower than the rule's, so the rule lost the comparison in the one year where it held a position through a decline.

Month by month

YearJanFebMarAprMayJunJulAugSepOctNovDec
20210.0%−4.2%5.8%6.3%4.7%−3.0%−0.4%5.0%−1.8%7.2%−5.7%3.4%
2022−3.8%0.0%0.0%0.0%0.0%0.0%0.0%−5.6%−1.9%−0.1%6.8%−5.1%
20236.7%−2.3%−6.3%0.0%0.0%0.0%0.0%0.0%0.0%0.0%1.6%5.4%
20242.9%4.0%4.7%−4.0%3.1%−0.9%6.3%4.4%−0.5%2.6%10.2%−5.4%
20256.4%1.4%−9.1%0.0%3.7%3.1%0.0%3.1%0.1%−2.7%1.8%3.0%
2026−2.4%−4.7%0.0%0.0%0.0%0.0%0.0%0.0%0.0%0.0%––

Best and worst months

November 2024 at 10.22% was the rule's best month and March 2025 at -9.08% its worst. For holding, October 2022 gave 11.62% and June 2022 gave -10.64%. In October 2022 the rule had just bought on 2022-10-31, so it missed the rally that occupied nearly all of the month and returned -0.06%. In June 2022 the rule was in cash and avoided the worst month completely.

The rule shows 0.0% in many months: February to July 2022, April to October 2023, April 2025 and March to October 2026. The long cash stretches are the reason the rule's exposure was 60%, and they explain why its max drawdown is much shallower than holding's even though it was invested at the start of the biggest decline.

Every trade

momentum breakout on XLF made 5 closed round trips, an average hold of 253 days, an average winner of 18.34%, an average loser of −4.34%, a profit factor of 5.99, a longest losing streak of 2. It held a position at the close on 60.0% of trading days.

EntryEntry priceExitExit priceReturnDays held
2021-02-25$30.582022-01-24$34.6013.2%333
2022-08-11$32.612022-09-21$30.13−7.6%41
2022-10-31$31.782023-03-09$31.44−1.1%129
2023-11-27$33.672025-03-11$46.1637.1%470
2025-05-06$47.972026-02-23$50.254.8%293

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 five trades

The rule made 5 round trips, none of them open at the end of the data. All prices below are adjusted ones, which sit under the quotes printed at the time.

The average winner was 18.34% and the average loser was -4.34%, which gave a profit factor of 5.99 and a 60% win rate. The best trade was the 2023-11-27 entry, and it produced most of the profit. The median trade returned 4.75% and the average hold was 253.2 days, the longest being 470 days and the shortest 41 days.

The worst trade was the 41-day one in August and September 2022, a loss of 7.6%, which is within the 10% trailing stop. The stop trails the highest close, so a position that rose a little before reversing exits with a loss smaller than 10% from entry. The 2022-10-31 trade also lost, but only 1.08% over 129 days, a flat result that ties up capital without much reward. The longest win streak and the longest loss streak were both 2.

The trade list has a pattern in the exits. Every closed trade ended through the trailing stop, since the rule has no other exit. The first, fourth and fifth are the three winners, and each followed a sustained run before the stop was hit. Both 2022 losers were entered while the fund was still working through its yearly decline.

Largest drawdowns

PeakLow pointDepthDays to lowRecoveredDays to recover
2022-01-122022-11-03−17.6%2952024-05-17561
2026-01-062026-02-23−9.6%48not yet–
2025-02-182025-03-11−9.1%212025-08-29171

Buy-and-hold's deepest drawdown ran from 2022-01-12 to 2022-10-12 and reached −25.5%.

Drawdowns

The rule's largest drawdown was 17.64%, from 2022-01-12 to 2022-11-03, which took 295 days to reach the low and recovered on 2024-05-17, 561 days after. Holding's largest was 25.47%, from the same January peak to 2022-10-12, with recovery on 2024-02-22. The rule's drawdown was shallower, but its recovery came later, and the rule spent the rebound in cash or in small losing trades.

The rule's second drawdown was 9.63%, from 2026-01-06 to 2026-02-23, and it had not recovered by the end of the data. The third was 9.1%, from 2025-02-18 to 2025-03-11, with recovery on 2025-08-29, 171 days after the low. Holding's second and third drawdowns were deeper: 15.33% from 2025-02-18 to 2025-04-08, and 14.65% from 2026-01-06 to 2026-03-27.

The stop explains the shallower figures. In 2025 and 2026 the stop fired during each decline, and the rule exited at about a 10% distance from the high-water mark, while holding continued to fall. In both cases the exits came before the lows, which kept the drawdowns smaller. After each exit the rule needs another 10% burst over 20 sessions to re-enter, so it did not buy back until 2025-05-06, and as of the end of the data it has not bought back after 2026-02-23.

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)7.0%−17.6%$14,7380.60
5 basis points6.9%−17.8%$14,6820.60
10 basis points6.8%−18.0%$14,6100.59

Cost runs

Ten fills leave little room for costs to matter. Charging 5 basis points a fill cut the CAGR to 6.92%, lifted the max drawdown to 17.79% and left $14,681.66 at the end, with a Sharpe of 0.597. Charging 10 basis points gave a CAGR of 6.83%, a drawdown of 17.96%, $14,610.29 and a Sharpe of 0.59. The headline run charges nothing.

XLF trades an average of $1,682,204,673 a day, and the median minute carries 62,901 shares. Orders of a $10,000 sleeve disappear into that volume, so the cost runs are a cautious assumption here. The shortfall against holding exists before any cost is charged, and costs add only a little to it.

Changing the parameters

VersionCAGRMax drawdownRound tripsWin rateFinal value
Published rules7.0%−17.6%560%$14,738
5% trailing stop1.5%−13.3%743%$10,918
15% trailing stop1.9%−29.8%540%$11,145
20% return entry0.0%−0.0%0–$10,000

Changing the stop and the entry

Three variants were tested, and each one changes the picture sharply.

The base rule returned 6.99%, so both stop variants did worse and in different ways. The tighter stop was shaken out more often. It made two more trades than the base rule and kept its drawdown to 13.26%, but it never held a position long enough to catch the 2023 to 2025 trend. The wider stop made the same number of trades as the base rule but its drawdown was 29.76%, deeper than the 25.47% of holding, because a 15% trail gives back more at each exit.

The 20% entry never triggered. XLF did not gain 20% in 20 sessions in this window, which fits its volatility of 18.43% a year. The entry threshold decides whether the rule trades at all, and at 20% it does not.

These variants show that the base result is sensitive to the 10% stop. A change to 5% or 15% moved the CAGR from 6.99% to under 2%. That points to the result depending on a few exits that landed well, and not on a stable edge. The test is one fund over one window, with three variants, so it cannot say which stop is better on other funds.

How XLF behaved

MeasureXLF
Data in this test2021-01-04 to 2026-10-02 (1444 sessions)
Total return, buy and hold102.9%
Annualized volatility18.4%
Deepest drawdown−25.9% (2022-01-12 to 2022-10-12)
Up days52.9%
Average daily range1.40%
Average overnight gap0.49%
Correlation to SPY0.77
Correlation to QQQ0.59
Correlation to TLT-0.05
Sessions above the 200-day average71.2%
Crossings of the 200-day average38
Falls of 10% or more from a 20-day high10

How XLF behaved and what it meant for a breakout rule

Over the window XLF gained 102.88%, a CAGR of 13.11%, on annualized volatility of 18.43% and 1,444 sessions of data. The deepest fall was 25.87%, from the 2022-01-12 peak to the 2022-10-12 low, and the fund needed until 2024-02-22 to get back, with 528 sessions as its longest time under water. By calendar year it returned 36.61%, -10.55%, 12.11%, 30.43% and 14.86% from 2021 to 2025, and -1.15% in 2026 to date.

The fund follows the broad market. Beta to SPY was 0.87 at a correlation of 0.77, while QQQ gave a beta of 0.48 and a correlation of 0.59. TLT showed a correlation of -0.05. Its nearest relatives in the data are FAS, the leveraged financials fund, at 1.0, then VTV and VOOV at 0.89. SH, SDS and SPDN sat at -0.78, -0.77 and -0.77, and UVXY at -0.64.

A breakout rule wants a fund that trends in bursts, and XLF moved in both directions about equally. Up days were 52.88% of sessions, and an average up day of 0.86% matched an average down day of -0.86%. The daily range averaged 1.4%. Lag-1 autocorrelation of 0.02 means yesterday's move told nothing about today's. The fund closed above its 200-day average on 71.16% of sessions and crossed it 38 times, so trends reversed often and a 10% trailing stop had plenty of chances to trigger.

Drops of 10% or more from a 20-day high happened in 10 episodes spread over 45 days. The rule never buys those, since its entry follows a rise. The extreme days were 2025-04-04 at -7.36% and 2025-04-09 at 7.59%, five days apart, and the rule had exited on 2025-03-11 and held cash through both. A 6.09% day on 2024-11-06 landed inside the rule's best month and its winning position.

Overnight moves produced 62.56% of the return and the session itself 37.44%, with an average gap of 0.49% at the open. The rule buys at the open, so every entry follows a burst and pays whatever gap came with it.

RSI(14) closed under 30 on 30 sessions, and the median return over the next 5 days was 0.75% against 0.42% for all days. Over 20 days it was 3.18% against 1.5%. RSI(2) closed under 10 on 169 sessions, with medians of 0.38% over 5 days and 1.89% over 20. Those rebounds suit the RSI mean reversion rule, which led on this fund. Month of year gave November 4.85%, July 4.03% and October 3.3% at the top, and September -3.37% at the bottom, each from five or six observations.

The rules

Buy after a +10% four-week burst and let a 10% trailing stop manage the exit.

  1. WHEN the market opens · IF not invested AND the 20-day return > +10% · THEN buy with 98% of the sleeve
  2. WHILE invested · a managed trailing stop follows 10% below the position's high-water mark

Momentum entry, trailing-stop exit. A +10% gain over 20 sessions marks a burst of momentum. The template buys the strength and exits on a 10% trailing stop that ratchets up beneath the highest close and never moves down. There is no profit target, so winners run until the trail is hit.

Good for: high-momentum assets where trends extend, such as semiconductor and leveraged tech ETFs.
Watch out: buying strength means buying high; when a burst immediately reverses, the trail exits about 10% below the entry.

How the breakout compares with the other templates on XLF

Rankings by CAGR on XLF, with the max drawdown in brackets:

The breakout took 5th place. Both RSI rules and the dip buyer, which all buy weakness, finished in the top six. The pure trend rules (SMA 10/50, golden cross, regime filter, EMA 12/26) all landed in the bottom half. XLF crossed its 200-day average 38 times, and each false crossover costs a trend rule a round trip. The breakout's drawdown of 17.64% was lower than most of the group, and three rules that bought dips still returned more.

Within the sector funds, SOXX returned 16.73% over 18 round trips, XLK returned 11.62%, XLY 3.83%, VOX 2.19% and XLP -1.87% over 2 round trips. XLF sits third at 6.99%. Funds that produced more 10% bursts gave the rule more entries. Everything the rule did on XLF is also on the XLF fund page.

What the test covers

Five trades over 5.74 years on a single fund make a small sample. The headline run charges no fees or slippage. Everything here is a hypothetical look at the past and none of it is investment advice.

Run momentum breakout on XLF 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 momentum breakout beat buy-and-hold on XLF?

Over 2021-01-04 to 2026-10-02, momentum breakout on XLF returned 7.0% annualized vs 12.6% for buy-and-hold: it trailed buy-and-hold by 5.6% per year, with a maximum drawdown 7.8 points shallower than holding (17.6% vs 25.5%).

How many trades did it make?

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

How does the trailing stop work in the backtest?

The stop sits 10% below the highest price since entry and only ratchets up. When a bar trades through it, the position sells at the stop, or at the open if the price gaps below it. Trailing-stop exits can be backtested now; deploying them live is not available yet.

Did the momentum breakout beat buy-and-hold on XLF?

No. Holding returned 12.58% a year and the rule 6.99%, with final values of $19,741.85 and $14,738.31. The rule's max drawdown was shallower, 17.64% against 25.47%. Only 2022 went the rule's way.

What is the entry and exit rule?

Entry needs a 20-day return above +10%, and the order goes in at the open for 98% of the sleeve. The only exit is a stop 10% under the highest close since entry, and no profit target exists.

How many trades did the rule make on XLF?

Five round trips and 10 fills, with 3 winners for a 60% win rate. The best gained 37.1% over 470 days and the worst lost 7.6% over 41 days.

Why did the rule make nothing in 2026 after February?

The stop fired on 2026-02-23 at $50.247. A new entry needs a fresh 20-day gain above 10%, and XLF did not post one between March and the end of the data.

What happens with a different stop or entry level?

Moving the stop to 5% gave 1.54% and moving it to 15% gave 1.91%, both below the 6.99% of the 10% stop. A 20% entry never fired, which left the account at $10,000.

How much did costs change the XLF result?

The CAGR fell to 6.92% at 5 basis points a fill and 6.83% at 10. Ten fills in a liquid fund leave costs a small effect.

Which template did best on XLF?

The [RSI mean reversion](/learn/strategies/rsi-mean-reversion/xlf/) returned 11.82% and the [monthly cycle](/learn/strategies/monthly-cycle/xlf/) returned 11.63%. The breakout was 5th at 6.99%, and XLF ranked 17th of 59 funds for it.

Related

20-Day Momentum + Trailing Stop on all 59 ETFsfull results table All strategies on XLF12 templates compared RSI(14) Mean Reversion on XLFsame ETF, different rulesRSI(2) Dip Snapback on XLFsame 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.