EMA 12/26 Trend 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.
This page tests one rule on one fund. The rule holds the Consumer Staples Select Sector SPDR Fund (XLP) while its 12-day exponential average sits above its 26-day average, and sits in cash otherwise. The window runs from 2021-01-04 to 2026-10-02 with $10,000 at the start. The headline run has no fees and no slippage, and orders fill on minute bars.
The result is weak. The strategy ended at $10,701, a CAGR of 1.19% and a total return of 7.01%. Buy-and-hold on XLP ended at $13,819 with a CAGR of 5.8%. The strategy also had the deeper drawdown, 22.82% against 15.99% for simply holding the fund. A rule that is supposed to step aside during declines ended up with more pain than the fund it was trying to protect.
Two things explain most of that. XLP is a low-volatility fund, with annualized volatility of 13.28%, so there is little trend for a fast crossover to ride. The rule is also fast, so it trades often: 27 round trips in about five and a half years, of which 13 were winners. For the full rule set and the other funds, see the EMA 12/26 Trend strategy page, and for the fund itself see the XLP profile.
The test covers one window and one fund. It uses daily decisions, no margin and a single position of 98% of the sleeve when invested. Nothing here is a forecast.
Year by year
| Year | EMA 12/26 trend | buy & hold |
|---|---|---|
| 2021 | 11.3% | 18.1% |
| 2022 | 4.2% | −0.7% |
| 2023 | 2.9% | −0.9% |
| 2024 | 6.6% | 12.0% |
| 2025 | −15.5% | 1.5% |
| 2026 | −0.5% | 5.6% |
How each calendar year played out
The year table shows the pattern clearly. In 2021 the strategy made 11.3% while the fund made 18.1%. The strategy was flat in January and February of 2021, because the average pair had not yet crossed, and its first entry came on 2021-03-16 at an adjusted price of $57.17. It missed the first two months and then gave back part of the later gains on whipsaw exits in June and September.
In 2022 and 2023 the picture reversed. The strategy returned 4.2% in 2022 and 2.9% in 2023, while the fund lost 0.7% and 0.9%. These are the only two years the strategy beat buy-and-hold. The fund went sideways and then fell during 2022, and the rule spent long stretches in cash. In 2022 all three round trips that closed were winners. In 2023 three of four were winners. The gains were small, between 0.13% and 1.71% on most trades, but they were positive while the fund was flat to down.
2024 was the fund's second good year, with buy-and-hold at 12.0%. The strategy made 6.6%. It caught the two largest trades in the whole test, a 9.17% gain from 2023-11-10 to 2024-04-12 and a 7.65% gain from 2024-04-25 to 2024-10-09, but it was out of the market for gaps between them. Five round trips closed in 2024 and three were wins. The late-year trades were poor: a 1.05% loss in October and a 3.42% loss from 2024-11-26 to 2024-12-20.
2025 was the damaging year. The strategy lost 15.5% while the fund gained 1.5%. Eight round trips closed in 2025 and only one was a winner. The fund drifted in a narrow range, and each time the 12-day average crossed above the 26-day average the position was bought near a local high and sold a few weeks later at a lower price. That is the pattern a crossover rule shows in a range-bound market. 2026 so far (through 2026-10-02) shows the strategy at -0.5% against 5.6% for the fund, with four round trips closed and one win. Because 2026 is a partial year, it should be read as a running total and not a full-year result.
The gap table in the facts confirms the same split. The strategy trailed buy-and-hold by 6.8 points in 2021, led by 4.9 in 2022 and 3.8 in 2023, trailed by 5.4 in 2024, trailed by 17.0 in 2025 and trailed by 6.1 in 2026. One bad year, 2025, accounts for a large share of the final shortfall.
Month by month
| Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2021 | 0.0% | 0.0% | 3.2% | 1.9% | 1.7% | −2.0% | 2.0% | 1.1% | −2.0% | 0.1% | −1.4% | 6.6% |
| 2022 | −1.4% | −0.7% | −0.2% | 2.4% | −1.8% | 0.0% | 2.0% | −1.8% | 1.3% | 1.3% | 6.0% | −2.6% |
| 2023 | −2.8% | 0.0% | 1.7% | 3.6% | −4.1% | 0.0% | 1.5% | −2.2% | 0.0% | 0.0% | 2.8% | 2.7% |
| 2024 | 1.2% | 2.0% | 3.3% | −4.0% | 2.3% | −0.2% | 1.6% | 5.8% | 1.2% | −3.0% | 0.9% | −4.2% |
| 2025 | 0.0% | 5.2% | −4.1% | −2.5% | −0.7% | −2.9% | −4.3% | −2.6% | 0.0% | −3.3% | 0.0% | −1.2% |
| 2026 | 3.4% | 7.6% | −5.6% | 0.0% | −2.1% | −3.4% | 2.3% | −0.1% | −2.1% | 0.0% | – | – |
What the month table adds
The month table has a visible rhythm. Positive months tend to arrive in clusters when a trend takes hold, and the losing months come in clusters when the rule is whipsawed. December 2021 was a good month at 6.58%, and November 2022 was another at 6.01%, both when the strategy held the fund through a sharp rise. February 2026 was the best month of the whole test at 7.63%. March 2026 was the worst, at -5.56%, and it followed straight on from that best month: the position bought in January 2026 was sold on 2026-03-13 for a 6.7% gain, but the fund kept falling in March while the strategy had already been caught in part of the decline.
From April 2025 to October 2025 the strategy lost money in almost every month it was invested: -2.48% in April, -0.72% in May, -2.85% in June, -4.28% in July, -2.63% in August and -3.34% in October. September 2025 and November 2025 show 0.0% because the strategy was in cash. This run is what produced the -15.5% year. No single month was catastrophic. The damage came from eight small losses in a row, the kind a trader sees as a slow bleed and not a crash.
Months at 0.0% are worth a note. They mark cash, not a flat fund. The strategy shows 0.0% for January and February 2021 and for several quiet stretches in 2022 and 2023, and its exposure over the whole test was 61.2% of trading days. That is the other side of the strategy: it sat in cash for nearly four days in ten, and XLP gained over the same window, so the idle time carried a cost.
The fund's own seasonal averages in the facts show September as its weakest month, at -3.79% on average across 6 observations, and November as its strongest at 3.33%. The strategy happened to be in the market in November 2022 and in cash in November 2025 and November 2023 was a gain of 2.75%. Six observations per month is too few to treat as a pattern, and the rule does not use the calendar at all.
Every trade
EMA 12/26 trend on XLP made 27 closed round trips, an average hold of 48 days, an average winner of 3.05%, an average loser of −2.23%, a profit factor of 1.19, a longest losing streak of 8. It held a position at the close on 61.2% of trading days.
| Entry | Entry price | Exit | Exit price | Return | Days held |
|---|---|---|---|---|---|
| 2021-03-16 | $57.17 | 2021-06-21 | $59.94 | 4.8% | 97 |
| 2021-07-12 | $60.97 | 2021-09-21 | $61.63 | 1.1% | 71 |
| 2021-10-25 | $62.33 | 2021-12-02 | $61.70 | −1.0% | 38 |
| 2021-12-08 | $63.91 | 2022-02-15 | $66.56 | 4.2% | 69 |
| 2022-03-29 | $67.28 | 2022-05-11 | $67.52 | 0.4% | 43 |
| 2022-07-11 | $65.15 | 2022-09-02 | $66.11 | 1.5% | 53 |
| 2022-10-28 | $64.48 | 2023-01-19 | $65.58 | 1.7% | 83 |
| 2023-03-28 | $66.77 | 2023-05-24 | $67.47 | 1.1% | 57 |
| 2023-07-05 | $68.19 | 2023-07-13 | $67.61 | −0.8% | 8 |
| 2023-07-14 | $67.72 | 2023-08-16 | $67.81 | 0.1% | 33 |
| 2023-11-10 | $63.34 | 2024-04-12 | $69.15 | 9.2% | 154 |
| 2024-04-25 | $71.33 | 2024-10-09 | $76.79 | 7.7% | 167 |
| 2024-10-17 | $78.13 | 2024-10-22 | $77.31 | −1.1% | 5 |
| 2024-10-23 | $77.25 | 2024-10-24 | $77.55 | 0.4% | 1 |
| 2024-11-26 | $78.13 | 2024-12-20 | $75.46 | −3.4% | 24 |
| 2025-02-04 | $75.25 | 2025-03-19 | $75.95 | 0.9% | 43 |
| 2025-04-02 | $78.56 | 2025-04-08 | $75.46 | −4.0% | 6 |
| 2025-04-17 | $77.41 | 2025-05-15 | $76.43 | −1.3% | 28 |
| 2025-05-16 | $77.96 | 2025-06-18 | $77.21 | −1.0% | 33 |
| 2025-07-02 | $79.29 | 2025-07-16 | $77.52 | −2.2% | 14 |
| 2025-07-24 | $78.94 | 2025-07-31 | $77.20 | −2.2% | 7 |
| 2025-08-08 | $79.76 | 2025-08-29 | $77.62 | −2.7% | 21 |
| 2025-10-22 | $77.14 | 2025-10-30 | $74.51 | −3.4% | 8 |
| 2025-12-01 | $77.17 | 2026-01-08 | $75.16 | −2.6% | 38 |
| 2026-01-12 | $78.07 | 2026-03-13 | $83.30 | 6.7% | 60 |
| 2026-05-01 | $83.64 | 2026-06-03 | $80.62 | −3.6% | 33 |
| 2026-06-12 | $84.25 | 2026-09-09 | $82.62 | −1.9% | 89 |
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 27 round trips
The trade list is the most honest part of this page. Of 27 round trips, 13 won, a win rate of 48%. The average winner returned 3.05% and the average loser returned -2.23%, which gives a profit factor of 1.19. The median trade lost 0.85%, which tells you that the typical trade was a small loser and the total was held up by a few large winners. The median hold was 38 days, the average hold was 47.5 days, the longest was 167 days and the shortest was 1 day.
The five best trades were:
- 2023-11-10 to 2024-04-12, 154 days, 9.17%
- 2024-04-25 to 2024-10-09, 167 days, 7.65%
- 2026-01-12 to 2026-03-13, 60 days, 6.7%
- 2021-03-16 to 2021-06-21, 97 days, 4.85%
- 2021-12-08 to 2022-02-15, 69 days, 4.15%
All five lasted at least 60 days. That is the profile of a trend-following rule: the profit comes from holding through a move, and the long holds are where the strategy earns its keep. The best trade was 9.17%, and the worst was -3.95%, from 2025-04-02 to 2025-04-08, a six-day hold that bought near a high and sold into the early April 2025 selloff. The fund's own worst days include 2025-04-04 at -4.24%, which sits inside that trade.
The five worst trades were all between -2.68% and -3.95%: the April 2025 trade, a 33-day trade that opened 2026-05-01 for -3.61%, the 24-day trade from 2024-11-26 for -3.42%, an 8-day trade from 2025-10-22 for -3.41% and a 21-day trade from 2025-08-08 for -2.68%. None of the losses was large on its own. Losses were capped because the exit rule is another crossover and not a hard stop, and because XLP rarely moves far in a few weeks.
The per-year counts show how the hit rate decayed. In 2021 two of three trades won. In 2022 all three won. In 2023 it was three of four. In 2024 it was three of five. In 2025 it was one of eight, and in 2026 so far it was one of four. The longest losing streak was 8 trades and the longest winning streak was 5, which fits with that decay: the early years were mostly wins and the later years mostly losses.
A small number of trades lasted very little time. The 1-day trade from 2024-10-23 to 2024-10-24 made 0.39%, and the 5-day trade from 2024-10-17 made -1.05%. When the two averages sit close together, small moves in the fund flip the signal back and forth. Trades like these are the clearest sign of whipsaw, and each one would pay a cost in a real account. The last trade in the list entered on 2026-06-12 at $84.25 and exited on 2026-09-09 at $82.62 for -1.93%, so the test ends with no open position.
Largest drawdowns
| Peak | Low point | Depth | Days to low | Recovered | Days to recover |
|---|---|---|---|---|---|
| 2024-09-16 | 2026-06-22 | −22.8% | 644 | not yet | – |
| 2022-04-20 | 2022-07-18 | −6.2% | 89 | 2022-08-18 | 31 |
| 2022-11-30 | 2023-07-07 | −5.6% | 219 | 2023-12-28 | 174 |
Buy-and-hold's deepest drawdown ran from 2022-04-20 to 2022-10-07 and reached −16.0%.
The drawdown that never recovered
The largest drawdown for the strategy was 22.82%. It began at a peak on 2024-09-16 and reached its trough on 2026-06-22, after 644 days, and it had not recovered by the end of the window. That makes it an open drawdown at the time of testing. Two smaller drawdowns appear in the list: 6.2% from 2022-04-20 to 2022-07-18, which recovered by 2022-08-18, and 5.63% from 2022-11-30 to 2023-07-07, which recovered by 2023-12-28.
Buy-and-hold had a different shape. Its worst drawdown was 15.99%, from the peak on 2022-04-20 to the trough on 2022-10-07, and it recovered on 2024-03-28 after 538 days. The strategy's 2022 drawdown from the same peak date was only 6.2%, so the rule did what it was meant to do in the 2022 decline. It cut the exposure and avoided most of the fund's fall. That is the case for the rule on this fund, and it is real.
The second half of the story is the one that hurt. The strategy's deep drawdown starts in September 2024, at a time when the fund was near a high, and it lasted through the whole of 2025 and into 2026. The fund did not fall hard in that period. Buy-and-hold in 2025 had a drawdown of 8.37% from 2025-08-20 to 2025-11-06, which recovered by 2026-01-14. The strategy lost far more than that because it was buying and selling in a narrow range, not because the fund collapsed.
This is the main limit of the long/flat crossover on a low-volatility fund. A trend rule protects against a long, sustained decline, but a slow grind in a tight range hurts it more than it hurts the fund. XLP had no long decline after 2022 in this window, so the protective feature had nothing to do while the whipsaw cost kept accumulating. The Sharpe ratio of 0.17 for the strategy against 0.51 for buy-and-hold summarises that outcome, with a lower return and a higher drawdown at once.
The fund's own risk figures put this in perspective. XLP's maximum drawdown was 16.27% on its own price series, and it spent 486 sessions in its longest drawdown. Only one 10% drawdown event over 20 days occurred in the sample, lasting 3 days. For a fund this stable, there is little for a protective rule to avoid. The best case for a defensive rule is a fund that falls hard, and XLP did not.
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) | 1.2% | −22.8% | $10,701 | 0.17 |
| 5 basis points | 0.7% | −23.9% | $10,426 | 0.12 |
| 10 basis points | 0.3% | −25.1% | $10,147 | 0.07 |
What 5 and 10 basis points do
The headline run has no costs. The cost runs add 5 and 10 basis points per trade. At 5 basis points, the CAGR falls from 1.19% to 0.73%, the end equity falls to $10,426, the maximum drawdown rises to 23.92% and the Sharpe ratio falls to 0.124. At 10 basis points, the CAGR is 0.26%, the end equity is $10,147, the maximum drawdown is 25.07% and the Sharpe ratio is 0.074.
The effect is large relative to the return because the starting return is so small. With 54 fills over the window, every basis point of cost is paid 54 times, and the strategy's whole edge over cash is a few percent in total. At 10 basis points the strategy is barely above flat over five and a half years. These are the costs of a liquid ETF with an average daily dollar volume of $854,044,173 and a median minute volume of 17,592 shares, so the spread on XLP is likely to be narrow, but the test does not model the actual spread or any market impact. It applies a fixed charge.
Cost matters more for a strategy that trades 27 times than for one that trades 5 times. The comparison with a slower rule, such as the SMA 10/50 trend or the golden cross on the same fund, shows how much trade count drives the net result. The SMA 10/50 trend returned 1.21% CAGR on XLP and the golden cross returned 2.05%, so on this fund neither slow rule did much better than the EMA rule, and all of them are near the cost line.
Changing the parameters
| Version | CAGR | Max drawdown | Round trips | Win rate | Final value |
|---|---|---|---|---|---|
| Published rules | 1.2% | −22.8% | 27 | 48% | $10,701 |
| EMA 8/21 | 2.9% | −22.1% | 31 | 45% | $11,764 |
| EMA 20/50 | −0.3% | −19.5% | 15 | 40% | $9,844 |
| EMA 12/50 | −0.2% | −17.9% | 21 | 29% | $9,906 |
What the parameter variants show
Three variants were run. Each is a different length pair on the same fund.
- EMA 8/21: CAGR 2.87%, maximum drawdown 22.09%, end equity $11,764, Sharpe 0.354, 31 trades, 14 wins.
- EMA 20/50: CAGR -0.27%, maximum drawdown 19.47%, end equity $9,844, Sharpe 0.027, 15 trades, 6 wins.
- EMA 12/50: CAGR -0.16%, maximum drawdown 17.91%, end equity $9,906, Sharpe 0.036, 21 trades, 6 wins.
The default 12/26 pair gave 1.19%. The faster 8/21 pair gave 2.87% with more trades, and both slower variants lost money. That runs against the common assumption that a slower rule is better on a quiet fund. On XLP the faster pair did better, though it still trailed buy-and-hold at 5.8%.
The two slower variants had lower drawdowns, 19.47% and 17.91%, and both lost money overall. The 12/50 variant made 21 trades with only 6 wins, so its win rate was low, and its drawdown was close to the 15.99% that buy-and-hold had. Slowing the exit did not help, because the fund spent much of the window moving in a narrow band, and a slower average mostly turned small losses into slightly larger ones.
These three variants are a small sample. The spread between -0.27% and 2.87% is wide for what are close neighbours, which means the result on XLP is sensitive to the exact lengths. A single window with a fixed fund cannot tell which pair is better. It is reasonable to read this as saying the 12/26 default is not tuned for XLP and that nothing on this page was chosen after the fact. The headline result is simply the default rule on this fund.
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 defensive consumer staples fund. Over the test window it returned 40.33% in total, a CAGR of 6.08% on its price series, with annualized volatility of 13.28% and 1,444 sessions. It was up on 51.63% of days. The average up day was 0.64% and the average down day was -0.63%, so up and down days were nearly symmetric. The lag-1 autocorrelation of daily returns was -0.01, which is essentially zero. A fund with no day-to-day persistence gives a trend rule very little to follow.
The fund crossed its 200-day average 73 times, and spent 75.1% of sessions above it. Crossing that line 73 times in under six years is frequent, and it shows how often the fund pushed through the long average without following through. A 12/26 crossover is faster than a 200-day signal, so it flips more often still.
XLP's correlation to SPY was 0.47, with a beta of 0.38. Its correlation to QQQ was 0.3 and to TLT was 0.13. Most of its return came from the intraday part of the day, 72.64% of it, against 27.36% overnight. The strategy buys at the open and sells at the open, so it participates in both, but it cannot avoid an overnight gap once it holds the position.
Defensive funds like XLP sit between equities and cash in behaviour. They fall less in a bear market, and they rise less in a rally. The strategy's 2022 result, a gain of 4.2% against a small loss for the fund, is the best example of the rule working. The rest of the test shows the cost of that defensiveness: a fund that does not trend gives a crossover rule too few long moves to pay for the trades it makes in between.
Among the funds in the Sector ETFs category, XLP ranks last of the six shown for this strategy, with a CAGR of 1.19%. SOXX returned 17.96% with a drawdown of 33.96%, XLK returned 9.84%, VOX returned 5.8%, XLF returned 5.63% and XLY returned 2.36%. The category median CAGR for this strategy was 5.8%, and the median across all 59 funds was 2.76%. XLP ranks 35th of 59 funds for this strategy. The sectors that moved more gave the rule more to work with.
The rules
Hold while the 12-day exponential average is above the 26-day, the core of the MACD used as a position switch.
- WHEN the market opens · IF not invested AND EMA(12) > EMA(26) · THEN buy with 98% of the sleeve
- WHEN the market opens · IF invested AND EMA(12) < EMA(26) · THEN sell the whole position
The 12/26 exponential moving average pair is the core of the MACD indicator. Exponential averages weight recent days more than simple averages, so this crossover reacts faster than an SMA pair of the same length. Used as a long/flat switch, it gives you a position you can hold and measure.
Good for: traders who like MACD logic but want it expressed as a simple, testable long/flat rule.
Watch out: faster reaction means more trades and more whipsaws than a 50/200 cross; check the trade count on each backtest page.
How the rules fit this fund
The rule has two parts. It buys with 98% of the sleeve when the 12-day exponential average rises above the 26-day average, and it sells the whole position when the 12-day average falls below. There is no stop, no target and no volatility filter. Exponential averages weight recent prices more, so the crossover reacts faster than an SMA pair, and the caveat on the strategy page says the same thing: faster reaction means more trades and more whipsaws.
On XLP that caveat is visible in the numbers. The 27 round trips with a 48% win rate and a median trade of -0.85% show a rule that is frequently wrong in small amounts. The 8-day trade in July 2023 followed by a 33-day trade starting the next day, and the 5-day and 1-day trades in October 2024, are the same signal flipping around the crossover point. When a fund's average daily range is 1.12% and the average overnight gap is 0.29%, small moves are enough to push the fast average across the slow one and back.
Among the 12 strategies tested on XLP, this one ranks 9th. The strategies ahead of it on this fund were the RSI(2) snapback at 8.22% CAGR with an 11.06% drawdown, the RSI mean reversion at 6.51% with 9.64%, the monthly cycle at 5.46% with 13.42%, the weekly 7% target at 2.37%, the golden cross at 2.05% and the trend plus trailing stop at 1.82%. The dip buyer at 1.32% and the SMA 10/50 trend at 1.21% were also ahead. Behind it were the 200-day regime filter at -0.81%, the 3-month momentum at -1.67% and the momentum breakout at -1.87%.
The top of the list is made up of mean reversion rules. That fits what the fund data shows. After RSI(14) fell below 30, XLP's median 20-day forward return was 2.44%, against a baseline of 0.73%, across 37 sessions. After RSI(2) fell below 10, the median 5-day forward return was 0.26% against a baseline of 0.18%, across 154 sessions. The sample is small, but a fund that does not trend and does not drift far from its average is the type where buying weakness has worked better than following strength. See the RSI(2) snapback on XLP, the RSI mean reversion on XLP and the monthly cycle on XLP for the measured results.
In this window the default EMA 12/26 switch on a quiet fund gave up more in whipsaw than it saved in 2022. The same rule on a faster-moving sector fund, such as XLK or SOXX, returned much more, with deeper drawdowns.
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 EMA 12/26 trend beat buy-and-hold on XLP?
Over 2021-01-04 to 2026-10-02, EMA 12/26 trend on XLP returned 1.2% annualized vs 5.8% for buy-and-hold: it trailed buy-and-hold by 4.6% per year, with a maximum drawdown of 22.8% (buy-and-hold: 16.0%).
How many trades did it make?
27 completed round trips over 5.7 years (54 fills), with 48% of round trips closing profitably.
Is this the same as trading MACD signals?
It uses the MACD's underlying trend component. Classic MACD trades the signal-line crossover of the 12/26 spread. This template trades the spread's sign directly, which is simpler and can be built fully in blocks.
How did EMA 12/26 Trend perform on XLP from 2021 to 2026?
The strategy turned $10,000 into $10,701, a CAGR of 1.19% and a total return of 7.01%. Buy-and-hold on XLP ended at $13,819 with a CAGR of 5.8%. The test ran from 2021-01-04 to 2026-10-02 with no fees in the headline run.
Did the EMA 12/26 rule reduce drawdown on XLP?
No over the full window. The strategy's maximum drawdown was 22.82% against 15.99% for buy-and-hold. In 2022 the rule did limit the loss, with a drawdown of 6.2% from the 2022-04-20 peak, but the long drawdown that started on 2024-09-16 reached its trough on 2026-06-22 and had not recovered by the end of the test.
Why did the strategy lose 15.5% in 2025 when XLP rose?
XLP gained 1.5% in 2025 but moved in a narrow range. The strategy made eight round trips that closed in 2025 and only one won. Each crossover entry came near a local high and each exit came a few weeks later at a lower price.
Do trading costs change the result on XLP?
Yes, a lot. At 5 basis points per trade the CAGR falls from 1.19% to 0.73% and the end equity to $10,426. At 10 basis points the CAGR is 0.26% and the end equity is $10,147. The strategy made 54 fills, so cost is paid often.
Does a different EMA length work better on XLP?
The 8/21 pair returned 2.87% CAGR with a Sharpe ratio of 0.354 and 31 trades. The slower 20/50 and 12/50 pairs lost money, at -0.27% and -0.16%. All three variants trailed buy-and-hold at 5.8%, and the spread between them shows the result depends on the exact lengths.
Which strategies did better than EMA 12/26 Trend on XLP?
Eight of the other 11 strategies had a higher CAGR. The RSI(2) snapback was first at 8.22%, followed by RSI mean reversion at 6.51% and the monthly cycle at 5.46%. The weekly 7% target, golden cross, trend plus trailing stop, dip buyer and SMA 10/50 trend also finished ahead.
How many trades did the strategy make on XLP?
It made 27 closed round trips, with 13 winners and a win rate of 48%. The average hold was 47.5 days and the longest was 167 days. The best trade returned 9.17% and the worst returned -3.95%.
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.