Learn › Strategies › First-to-Last Day of Month › XLP

First-to-Last Day of Month 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: monthly cycle on XLP turned $10,000 into $13,570 (35.7% total, 5.5% CAGR): it trailed buy-and-hold by 0.3% per year, with a maximum drawdown 2.6 points shallower than holding (13.4% vs 16.0%).

The monthly cycle template buys the first session of each month and sells on the last. It is a calendar test, with no price signal at all. Run on XLP, the Consumer Staples Select Sector SPDR Fund, it returned 5.46% a year from 2021-01-04 to 2026-10-02. A $10,000 start ended at $13,570.36, with a maximum drawdown of 13.42% and a Sharpe ratio of 0.5.

Buy-and-hold on XLP returned 5.8% a year and ended at $13,819.40, with a 15.99% drawdown and a Sharpe ratio of 0.51. The rule trailed by 0.34 points of CAGR and finished $249.04 behind. It was 2.57 points shallower on drawdown. Because the rule is invested 95.2% of sessions, a result this close to buy-and-hold is expected: the template only skips the few sessions that sit between the last open of one month and the first open of the next.

The test made 69 closed round trips and 139 fills. 37 of the round trips won, a win rate of 54%. The average winner returned 3.19% and the average loser returned -2.58%, which gives a profit factor of 1.35. One more trade, entered on 2026-10-01 at an adjusted 80.49, was still open on the last day with a gain of 0.07%.

The headline run has no fees or slippage, covers 5.74 years and uses one fund.

5.5%CAGR
5.8%buy & hold CAGR
−13.4%max drawdown
0.50Sharpe ratio
69round trips
54%win rate
■ monthly cycle   ■ buy & hold, $10,000 invested 2021-01-04

Year by year

Yearmonthly cyclebuy & hold
202120.8%18.1%
20220.1%−0.7%
2023−1.8%−0.9%
202411.6%12.0%
2025−1.6%1.5%
20265.1%5.6%

Year by year against holding XLP

2021 was the best year at 20.8%, against 18.1% for buy-and-hold, so the rule was 2.7 points ahead. XLP's own calendar return that year was 18.47%. The monthly series shows why the rule did well: March gained 7.61% and December gained 8.72%, the best month of the whole test.

2022 returned 0.1% against -0.7% for holding. That is a 0.8 point lead in a year in which the fund fell from its 2022-04-20 peak to an 2022-10-07 trough. The rule's monthly results swung widely, with April at 4.43%, May at -4.64%, June at -2.99%, September at -5.92% and October at 8.19%. Those swings netted to almost nothing. Holding the fund over the same year lost 0.75% on the profile.

2023 lost 1.8% against -0.9% for the fund. The rule was behind by 0.9 points. The months that mattered were May at -5.8%, August at -3.74% and September at -4.38%, which were only partly offset by gains in March, April, June and July.

2024 gained 11.6% against 12% for holding. The monthly pattern was smoother: January 2.25%, February 2.36%, March 3.77% and August 4.95% on the way up, with October at -3.42% and December at -4.61% giving some back. The rule was 0.4 points behind.

2025 was the weak year. The rule lost 1.6% while buy-and-hold gained 1.5%, a gap of 3.1 points, the widest in the test. Months of -1.94% in March, -1.64% in June, -1.8% in July, -2.84% in September and -2.91% in October were only partly offset by February at 5.66% and November at 3.98%. Only 4 of the 12 round trips that exited in 2025 won, the fewest of any year.

2026 gained 5.1% against 5.6% for the fund on a partial year. January at 6.13% and February at 6.2% were followed by March at -7.81%, the worst month of the test. The rule beat holding in 2021 and 2022 only, and trailed in the other four years. The yearly gaps were small except in 2021 and 2025.

Month by month

YearJanFebMarAprMayJunJulAugSepOctNovDec
2021−2.4%−0.3%7.6%2.1%1.6%−1.5%2.0%0.7%−2.2%3.0%0.4%8.7%
2022−1.9%−1.5%2.1%4.4%−4.6%−3.0%2.8%−1.1%−5.9%8.2%3.6%−2.2%
2023−1.9%−1.8%4.2%3.4%−5.8%2.3%2.8%−3.7%−4.4%−1.5%3.0%2.4%
20242.3%2.4%3.8%−1.0%0.9%0.4%1.1%5.0%1.6%−3.4%3.0%−4.6%
20250.1%5.7%−1.9%−0.2%1.3%−1.6%−1.8%−0.2%−2.8%−2.9%4.0%−0.8%
20266.1%6.2%−7.8%2.2%−0.8%2.3%1.7%−0.9%−3.3%0.1%––

Monthly results and the March 2026 hit

The best month was 2021-12 at 8.72%. Buy-and-hold's best month was also 2021-12, at 10.36%. The rule captured less of the move because it does not own the last session of each month. The worst month was 2026-03 at -7.81%, against -8.31% for holding in the same month. In that case the rule did a little better.

A held month is always from the first open to the last open, so the rule never owns the final session of a month. When that final session carries a large move, the rule gets only the part before it. This gives the rule a slightly lower volatility than the fund and a result slightly behind it in most years.

Seasonality in XLP is visible in the fund's own month-of-year averages. September averaged -3.79% across six years and November averaged 3.33%. May averaged -1.08% and April 1.68%. In the rule's own results September lost 2.22% in 2021, 5.92% in 2022, 4.38% in 2023, gained 1.65% in 2024, lost 2.84% in 2025 and lost 3.28% in 2026. That makes five of six Septembers negative. Each calendar month holds only 5 or 6 observations, so these averages are anecdotes about this window, not a calendar rule.

The rule's own results include a few streaks. The longest winning streak was 5 round trips and the longest losing streak was also 5. A losing streak of 5 means five losing monthly trades in a row.

Every trade

monthly cycle on XLP made 69 closed round trips and one position still open at the end of the test, an average hold of 28 days, an average winner of 3.19%, an average loser of −2.58%, a profit factor of 1.35, a longest losing streak of 5. It held a position at the close on 95.2% of trading days.

Best 10 round trips

EntryEntry priceExitExit priceReturnDays held
2021-12-01$62.022021-12-31$67.578.9%30
2022-10-03$60.302022-10-31$65.358.4%28
2021-03-01$54.962021-03-31$59.257.8%30
2026-02-02$82.152026-02-27$87.366.3%25
2026-01-02$76.102026-01-30$80.876.3%28
2025-02-03$74.932025-02-28$79.285.8%25
2024-08-01$73.582024-08-30$77.315.1%29
2022-04-01$67.312022-04-29$70.374.5%28
2023-03-01$64.892023-03-31$67.694.3%30
2025-11-03$73.792025-11-28$76.794.1%25

Worst 10 round trips

EntryEntry priceExitExit priceReturnDays held
2026-03-02$88.072026-03-31$81.01−8.0%29
2022-09-01$65.172022-09-30$61.22−6.1%29
2023-05-01$70.282023-05-31$66.11−5.9%30
2022-05-02$69.282022-05-31$65.99−4.8%29
2024-12-02$78.742024-12-31$75.03−4.7%29
2023-09-01$66.852023-09-29$63.85−4.5%28
2023-08-01$69.402023-08-31$66.74−3.8%30
2024-10-01$78.652024-10-31$75.90−3.5%30
2021-01-04$57.952021-01-29$55.97−3.4%25
2026-09-01$84.972026-09-30$82.11−3.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.

The 69 round trips

The median trade returned 0.44%, the median hold was 29 days, the longest hold was 30 days and the shortest was 25 days. Average hold was 28.4 days. The best trade returned 8.95% and the worst lost 8.02%. Every trade is about a month long by design, so the only variation is the calendar: months with a holiday or a weekend at the edge are a day or two longer or shorter.

Per exit year the record was 12 round trips and 8 wins in 2021, 12 and 5 in 2022, 12 and 6 in 2023, 12 and 9 in 2024, 12 and 4 in 2025, and 9 and 5 in 2026. The 2024 year had the highest hit rate. It is also the year the rule came closest to buy-and-hold, behind by only 0.4 points. The year with 4 wins, 2025, is the year with the biggest shortfall.

Win rate by itself says little here. 54% of trades won, and the average win was larger than the average loss, which produced a profit factor of 1.35. Those figures describe an asset that rose about as often as it fell with a mild upward drift. They would look much the same for any fund held in monthly slices.

The one open trade entered on 2026-10-01 at 80.49, the first session of October. By 2026-10-02 it showed 0.07%, which is why it stays out of the closed-trade statistics of 69 round trips even though it is counted as a 70th trade in the list.

Largest drawdowns

PeakLow pointDepthDays to lowRecoveredDays to recover
2022-04-202022-10-07−13.4%1702024-03-07517
2025-03-032025-11-06−10.9%2482026-02-0389
2026-02-242026-03-20−9.8%24not yet–

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

Drawdowns: 2022 and what came after

The deepest drawdown was 13.42%, from a peak on 2022-04-20 to a trough on 2022-10-07, 170 days later. It recovered on 2024-03-07 after 517 days. Buy-and-hold had its own drawdown on the same dates: 15.99%, recovered on 2024-03-28 after 538 days. The rule's decline was 2.57 points shallower and it recovered earlier, on 2024-03-07 against 2024-03-28.

The second drawdown was 10.86%, from 2025-03-03 to 2025-11-06, a 248 day slide that recovered on 2026-02-03 after 89 days. Buy-and-hold's comparable drawdown ran from 2025-08-20 and was 8.37%, which means the rule was deeper than the fund in this episode. The third was 9.85% from 2026-02-24 to a trough on 2026-03-20, 24 days, and it was still open at the end of the data. Buy-and-hold had a 9.52% drawdown starting on 2026-02-27 that was also open.

The rule fell behind in 2025 even though the fund held up, so this drawdown is the product of the monthly slicing. The rule does not own the last session of each month, and some of that year's up days fell there. The best day for XLP in the data was 2025-04-09 at 3.81%, and the fund's worst days were 2022-05-18 at -6.45% and 2025-04-04 at -4.24%.

None of these drawdowns approach the size seen in the communication and consumer discretionary funds in the same sector group. VOX had a 46.22% drawdown under the same rule and XLY had 43.81%. XLP's 13.42% was the shallowest in that group, which suits what the fund is: a staples sector, with annualized volatility of 13.28%.

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)5.5%−13.4%$13,5700.50
5 basis points4.3%−14.1%$12,6980.41
10 basis points3.0%−15.7%$11,8500.31

Costs on 139 fills

This is the page where cost matters most. A rule that trades every month makes 139 fills in the headline run, so each basis point is paid again and again. At 5 basis points per trade the CAGR fell from 5.46% to 4.25%, the end equity from $13,570.36 to $12,698.42 and the Sharpe ratio from 0.5 to 0.407. The drawdown grew to 14.09%.

At 10 basis points the CAGR was 3%, the end equity $11,850.45, the drawdown 15.69% and the Sharpe ratio 0.312. Compare that with buy-and-hold at 5.8%, which pays once. The rule's small deficit in the headline run turns into a clear one as soon as costs enter.

XLP trades with an average daily dollar volume of $854,044,173 and a median minute volume of 17,592, so a small order does not move the price in any noticeable way, and 5 basis points is a fair figure for a spread and commission. The fund's average intraday range was 1.12% and its average overnight gap 0.29%. A rule that enters at the open and exits at the open takes the gap on each end, and gap size matters less than frequency here.

If the template is read as a research test, the headline result is the one to read: 5.46% against 5.8%. If it is read as something to run, the cost runs describe it better. The test does not include taxes or any broker-specific fee schedule.

Changing the parameters

VersionCAGRMax drawdownRound tripsWin rateFinal value
Published rules5.5%−13.4%6954%$13,570
Only after a positive month0.7%−12.0%3954%$10,431
Only above the 200-day SMA0.3%−19.0%4450%$10,154
With a 5% profit target3.8%−14.1%6954%$12,417

Gates and a profit target

Three variants changed the template. Entering only after a positive month gave a CAGR of 0.74%, a drawdown of 12.03%, an end equity of $10,431.22 and a Sharpe ratio of 0.127, with 39 trades and 21 wins. Entering only above the 200-day SMA gave 0.27%, a drawdown of 19.03% and $10,154.42, with 44 trades and 22 wins. Adding a 5% profit target gave 3.84%, a drawdown of 14.12% and $12,416.64, with 69 trades and 37 wins.

All three did worse than the plain rule. The gates cut the number of trades from 69 to 39 and 44, so they should have saved on costs and avoided bad stretches. They did neither, and the months they skipped included gains. XLP closed above its 200-day average on 75.1% of sessions, but the average crossed 73 times, so the trend gate flipped often and the 200-day gate had a deeper drawdown than the base rule, 19.03% against 13.42%.

The profit target changed very little in the trade count: still 69 trades and 37 wins. A 5% gain inside one month is rare for a fund with 13.28% annualized volatility, so the target rarely triggered. The target left the trade count unchanged and still lowered the CAGR, which means it cut some of the larger monthly gains short.

The conclusion for this fund is plain: the unconditioned rule was the best of the four monthly-cycle versions tested, though all of them are inside the window's noise.

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

XLP returned 40.33% in total over 1,444 sessions, a CAGR of 6.08%, with annualized volatility of 13.28%. Its maximum drawdown was -16.27% from 2022-04-20 to 2022-10-07, recovered on 2024-03-28, and the longest drawdown lasted 486 sessions. The calendar returns were 18.47% in 2021, -0.75% in 2022, -0.89% in 2023, 12.23% in 2024, 1.53% in 2025 and 5.68% in 2026 so far.

The fund closed up on 51.63% of days, with an average up day of 0.64% and an average down day of -0.63%. Its lag-1 autocorrelation was -0.01, which is flat, so each day carries no information about the next. That matters for a calendar rule: the rule does not depend on any pattern in daily returns, and the data show none. Friday was the best weekday with an average of 0.13% and Tuesday and Wednesday were slightly negative at -0.02% and -0.04%.

Most of the return came during the trading day: intraday log return was 23.86% and overnight was 8.98%, which is 72.64% and 27.36% of the total. A rule that holds from open to open takes both parts, and the one-day shift from skipping the final session each month takes a small slice of each.

XLP closed above its 200-day average on 75.1% of sessions. Beta to SPY was 0.38 and the correlation to SPY was 0.47, which is low for an equity fund. It was negatively correlated with the inverse funds, at -0.47 for SDS, SH and SPDN, and -0.32 for UVXY. Its closest relatives were VTV at 0.64 and VOOV at 0.63. A low beta means the rule's market exposure is mild, and it explains why the drawdowns here are shallow.

RSI figures are modest. RSI(14) fell below 30 on 37 sessions and the median 20-day forward return after that was 2.44%, against a baseline of 0.73%. RSI(2) fell below 10 on 156 sessions with a 20-day median of 1.09%. Both RSI rules ranked above monthly cycle on this fund.

The rules

Buy the first session of each month and sell the last, as a calendar-seasonality test.

  1. WHEN the first session of the month opens · IF not invested · THEN buy with 98% of the sleeve (once per month)
  2. WHEN the last session of the month opens · IF invested · THEN sell the whole position

This template uses no indicators. It tests the turn-of-the-month effect by holding from each month's first open to its last. Whatever it earns or loses comes from calendar seasonality alone, so it is a useful comparison against buy-and-hold on the same page.

Good for: measuring how much of an asset's return accrues inside the month versus across month boundaries.
Watch out: this is a research template. It holds ~95% of all sessions, so results usually track buy-and-hold minus the boundary days.

Where monthly cycle ranks on XLP

Monthly cycle ranked 3rd of 12 strategies on XLP, at 5.46% CAGR. RSI(2) snapback led at 8.22% with an 11.06% drawdown and RSI mean reversion was second at 6.51% with a 9.64% drawdown. After monthly cycle came weekly 7% target at 2.37%, golden cross at 2.05%, trend + trailing stop at 1.82% and dip buyer at 1.32%. Further down were SMA 10/50 trend at 1.21%, EMA 12/26 trend at 1.19%, 200-day regime filter at -0.81%, 3-month momentum at -1.67% and momentum breakout at -1.87%.

The ranking has two groups. Rules that buy dips beat rules that follow trends, because XLP has little trend persistence. A fund with 73 crossings of its 200-day average in 5.74 years gives trend rules many false starts. The monthly cycle sits near the top because it is nearly buy-and-hold, and buy-and-hold at 5.8% beat most of the rules that try to time the fund.

Across the 59 funds, the rule's median CAGR was 5.46%, and XLP's own 5.46% puts it 30th of 59, in the middle. Among the sector funds the median was 11.63%.

For the sector group, SOXX returned 29.17% with a 44.51% drawdown, XLK 20.86% with 32.05%, XLF 11.63% with 23.47%, VOX 5.97% with 46.22%, XLP 5.46% with 13.42% and XLY 3.67% with 43.81%. Each made 69 round trips. XLP gave up return to those funds and kept most of its risk down.

Limits of the test

The window runs from 2021-01-04 to 2026-10-02, 5.74 years, on one fund. The headline run has no fees or slippage and the cost runs show that this matters. The rule decides once per day at the open and the position uses 98% of the sleeve with no margin. The 69 round trips are all about a month long, so they are not independent in the way separate signals would be: they share the same market.

Monthly seasonality estimates rest on 5 or 6 observations per calendar month. The September pattern, with five of six negative, is a feature of this window. Results here describe a hypothetical backtest and do not forecast XLP or any other fund. Nothing here is a recommendation to buy or sell.

Run monthly cycle 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 monthly cycle beat buy-and-hold on XLP?

Over 2021-01-04 to 2026-10-02, monthly cycle on XLP returned 5.5% annualized vs 5.8% for buy-and-hold: it trailed buy-and-hold by 0.3% per year, with a maximum drawdown 2.6 points shallower than holding (13.4% vs 16.0%).

How many trades did it make?

69 completed round trips over 5.7 years (139 fills), with 54% of round trips closing profitably.

Is the turn-of-the-month effect real?

It has appeared in long historical studies, but it depends on the market regime and is small. These pages show the recent five and a half years per ETF.

How did the monthly cycle strategy do on XLP?

It returned 5.46% a year from 2021-01-04 to 2026-10-02 and turned $10,000 into $13,570.36. The maximum drawdown was 13.42% and the Sharpe ratio was 0.5. Buy-and-hold returned 5.8% a year and ended at $13,819.40.

Does buying the first day and selling the last day of the month beat holding XLP?

Not in this window. The rule trailed buy-and-hold by 0.34 points of CAGR and finished $249.04 behind. It beat holding in only two of six years, 2021 and 2022, and it had a shallower drawdown, 13.42% against 15.99%.

How many trades did it make and how many won?

It closed 69 round trips and made 139 fills. 37 won, a win rate of 54%, with an average win of 3.19% and an average loss of -2.58%. One trade opened on 2026-10-01 was still open at the end.

What did trading costs do to the result?

Costs cut it sharply because the rule trades every month. At 5 basis points per trade the CAGR was 4.25% and at 10 basis points it was 3%. End equity fell from $13,570.36 to $12,698.42 and then to $11,850.45.

Do the gates and profit target improve the monthly cycle on XLP?

No. Trading only after a positive month gave a 0.74% CAGR and only above the 200-day SMA gave 0.27%. A 5% profit target gave 3.84%, all below the plain rule's 5.46%.

What was the worst month and the worst trade?

The worst month was 2026-03 at -7.81%, and the worst trade lost 8.02%. Buy-and-hold lost 8.31% in the same month. The best month for the rule was 2021-12 at 8.72% and the best trade returned 8.95%.

Which strategies did better than monthly cycle on XLP?

[RSI(2) snapback](/learn/strategies/rsi2-dip-snapback/xlp/) at 8.22% and [RSI mean reversion](/learn/strategies/rsi-mean-reversion/xlp/) at 6.51%. Monthly cycle was third of 12 at 5.46%.

Related

First-to-Last Day of Month 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.