A 3-Year Backtest of a 10/30 EMA Crossover with RSI Confirmation vs. SPY (2023β2026)
What Did We Test?
The strategy buys a sector ETF when its short-term trend rises above its longer-term trend, provided momentum is also positive. Positions are closed when the short-term trend reverses below the longer-term trend.
Technically, we measure this across six liquid sector ETFs, XLK (Technology), XLF (Financials), XLI (Industrials), XLE (Energy), XLV (Health Care), and XLY (Consumer Discretionary), using a 10-day and 30-day exponential moving average (EMA) crossover combined with a 14-day Relative Strength Index (RSI) above 50.
What Happened to $100,000?
We backtested a 10/30 EMA trend-following strategy with an RSI(14) > 50 filter across six major U.S. sector ETFs using $100,000 starting capital over the 3-year period from 2023-08-29 to 2026-08-27.
Over the 3-year backtest, the active sector strategy grew $100,000 to $158,574 (+58.57% total return, +$58,574 net profit, +16.66% CAGR across 79 closed trades). Over the exact same period, the broad S&P 500 benchmark (SPY) returned +77.04% ($177,038 ending equity, +21.01% CAGR), while an unhedged equal-weight buy-and-hold basket of the six sector ETFs returned +69.44% ($169,438 ending equity, +19.27% CAGR).
π‘ The key takeaway: This strategy meaningfully lagged SPY on raw return (Strategy: +58.6% vs. SPY: +77.0%). But it had a smaller maximum decline than either benchmark (Strategy: -9.8% vs. SPY: -18.2% vs. the sector basket: -17.5%), and it actually posted a better risk-adjusted return than SPY (1.36 Sharpe vs. 1.12) β for each unit of volatility taken on, the strategy delivered more return than buy-and-hold. That combination makes it a reasonable fit for a more risk-averse investor willing to trade some upside for a smoother ride, even though it gave up the “matches the market’s raw return” claim.
Did It Beat SPY?
The strategy completed 79 closed round-trip trades across the six sector ETFs, growing the initial $100,000 capital to $158,574 for a total return of +58.57% (+16.66% annual return). In terms of raw total return, the active strategy meaningfully lagged the broad S&P 500 benchmark (SPY), which returned +77.04% ($177,038) over the exact same period, trailing it by 18.47 percentage points. Meanwhile, simply buying all six sector ETFs equally and holding them returned +69.44% ($169,438) β also ahead of the active strategy, though by a much smaller margin than SPY.
The one advantage the strategy retained was downside risk protection. Maximum drawdown means the largest fall in the account from a previous high. The strategy’s maximum drawdown was -9.81% (a $12,752 drop from a $129,932 peak in December 2024, recovering by June 2025), clearly smaller than -18.20% on SPY and -17.51% on the Sector Basket β and it still posted the best risk-adjusted return of the three, at 1.36 Sharpe versus 1.12 for SPY and 1.31 for the Sector Basket.
Across the 79 closed trades, 32 were profitable, producing an overall win rate of 40.5%. Two sectors, Industrials (XLI +$17,849) and Health Care (XLV +$16,303), plus Technology (XLK +$16,943), drove essentially all of the strategy’s net profit; Financials (XLF +$5,268) and Consumer Discretionary (XLY +$5,467) contributed modestly, while Energy (XLE -$3,256) was a net loser over the window.
How Much Time Was the Strategy Actually Invested?
A central question for systematic trend strategies is cash drag: how much time does the strategy sit in cash, and does sitting idle harm overall compounding?
Benchmark Methodologies
-
Equal-Weight Sector Basket Baseline: Equal-weighted once at inception ($16,667 per ETF on 2023-08-29) and allowed to drift over the 3-year period without periodic rebalancing back to 16.67%.
-
Dividend Handling: Both benchmark (SPY) and sector ETF returns reflect total returns (adjusted daily prices with dividend reinvestment).
What If Idle Cash Had Been Parked in T-Bills or a Bond ETF Instead?
Rather than assume a flat T-bill rate applied to the strategy’s average cash balance, we re-ran the backtest’s actual daily cash ledger and let every dollar of idle cash earn a real instrument’s daily return instead β sweeping cash in and out exactly when the strategy itself deposits or withdraws cash to enter and exit sector ETF positions. We tested three options, each backed by real downloaded price data (not simulated or assumed): BIL (a 1-3 month Treasury-bill ETF β the standard liquid, near-zero-duration way to actually "buy T-bills" through a brokerage), BND (the Vanguard Total Bond Market ETF, intermediate duration), and TLT (long-duration Treasuries), since "a bond ETF" isn’t one thing and duration turns out to matter a lot here.
Duration is the whole story here. BIL returned a real +14.2% over 2023-08-29 to 2026-08-27 (about +4.5% annualized, right in line with prevailing T-bill rates) with almost no price volatility of its own, since 1-3 month bills barely move — and parking idle cash there made the strategy modestly better on every dimension: total return, Sharpe ratio, and max drawdown all improved. BND (intermediate duration, +13.3% real return) and TLT (long duration, -1.9% real return) both made the strategy worse despite BND’s real return being positive, because their own price volatility dragged on the cash balance during the strategy’s own drawdown periods — more than offsetting whatever yield they earned. The practical takeaway: “put idle cash to work” is a reasonable instinct, but the instrument matters as much as the yield — a genuinely liquid, non-volatile T-bill proxy like BIL is the right tool for cash that needs to be available on short notice to fund the next trade, while longer-duration bond funds introduce exactly the kind of price risk that idle cash is supposed to avoid. One caveat: the real, dollar-weighted average cash balance over this backtest is only about 6% of equity (see the code note below), well below the 31.5% slot-based average used for the flat idle-cash-yield estimate above, so the dollar impact of any of these three overlays is smaller than it might first appear.
Did RSI Actually Help?
π§ͺ Mini-Experiment: Does Adding RSI(14) > 50 Actually Help?
Comparing a raw 10/30 EMA trend crossover strategy against the 10/30 EMA + RSI momentum filter across the exact same 3-year period:
Adding the RSI > 50 filter made zero measurable difference: both variants produced exactly 79 trades and identical returns, meaning every EMA-crossover entry in this backtest already had RSI above 50. The drawdown reduction the strategy shows versus buy-and-hold comes entirely from the EMA trend-following mechanism itself, not from the RSI filter. Want to see if RSI matters over a longer window or a different threshold?
The Full Strategy’s raw return (+58.57%) trails both SPY (+77.04%) and the Equal-Weight Sector Basket (+69.44%) — but it still posts the best risk-adjusted return of all three real variants: a 1.36 Sharpe ratio versus 1.31 for the basket and 1.12 for SPY. Note that the “EMA 10/30 Trend Only” row above is identical to the Full Strategy: the RSI filter makes no difference to which trades are taken (see the Mini-Experiment above), so it can’t be credited with the drawdown reduction either. What the trend-following rule itself contributed was cutting maximum drawdown to -9.81%, clearly better than either passive benchmark (-17.51% and -18.20%). The strategy’s Calmar ratio of 1.70 and Sortino ratio of 1.93 (see the Backtest Summary above) reinforce the same point: for each unit of downside risk taken, this strategy delivered more return than either buy-and-hold alternative, even though its total dollar return was smaller than both.
Which Sectors Worked Best?
Explore the 6 Sector ETF Universe Descriptions βΎ
This strategy evaluates systematic trend filtering across six highly liquid U.S. Economic Sector ETFs:
- Technology (XLK): Semiconductor, software, and hardware equities.
- Financials (XLF): Diversified banking, investment services, and insurance providers.
- Industrials (XLI): Aerospace, defense, machinery, and logistics companies.
- Energy (XLE): Oil, natural gas, refining, and energy production equities.
- Health Care (XLV): Pharmaceuticals, biotechnology, and medical equipment providers.
- Consumer Discretionary (XLY): Retail, automotive, leisure, and consumer service equities.
Note on Universe Selection: These six sector ETFs were selected as the primary liquid universe because they represent over 80% of total S&P 500 market capitalization and exhibit distinct, non-correlated business cycle sensitivities. Defensive and niche sectors (such as Consumer Staples XLP, Utilities XLU, and Real Estate XLRE) were excluded from this baseline to focus specifically on cyclical trend dynamics.
Price, Signals & Momentum: XLK Example
β’ Top Profit Contributor: Industrials (XLI) generated +$17,849 net profit.
β’ Most Consistent Hit Rate: Financials (XLF) achieved a 66.7% win rate (8 wins out of 12 trades).
β’ Most Active Sector: Energy (XLE) triggered 25 closed trades — and was the only sector to lose money overall (-$3,256).
Full Sector Performance Breakdown
Was the Result Driven by One Lucky Trade?
The distribution above shows real fat tails: trade-level P&L skewness is 1.87 and excess kurtosis is 3.44, both above the 0 you’d see from a symmetric, bell-shaped distribution. Losses cluster mostly between roughly -$2,400 and breakeven, while the right tail stretches out to three standout winners of +$9,685, +$9,207, and +$5,988. That shape — many small, capped losses and a few large, uncapped gains — is exactly what you’d expect from a trend-following exit rule that cuts losers quickly on a bearish EMA cross but lets winners run for as long as the trend holds.
This second chart is different: it’s the distribution of the strategy’s own day-to-day portfolio returns across all 750 trading days in the backtest, not per-trade P&L. It is only mildly fat-tailed — skewness of -0.26 and excess kurtosis of 3.01. About 8% of days sit at exactly 0% (fully in cash), which produces the sharply peaked spike at the center, and the largest single-day moves are a +3.79% gain on 2025-05-12 and a -3.59% loss on 2025-10-10 — both ordinary market moves.
When Did the Strategy Struggle?
π‘ What Surprised Us in This Backtest
- 1. The RSI Filter Turns Out to Do Nothing: Requiring RSI(14) > 50 before entry made zero difference to which trades were taken — every EMA crossover in this backtest already had RSI above 50.
- 2. Fat-Tailed Profit Concentration: 43.8% ($36.1k) of the strategy’s gross winning-trade profit came from just its 5 largest winning trades—a real trend-following fat-tailed distribution.
- 3. Capital Protection Came at the Cost of Raw Return, But Not Risk-Adjusted Return: The strategy’s smaller maximum drawdown (-9.8% vs -18.2% for SPY and -17.5% for the sector basket) is real, and it trailed SPY’s raw return by 18.5 percentage points (+58.6% vs +77.0%) — but it still posted a better Sharpe ratio (1.36 vs 1.12).
β οΈ When This Strategy Struggles
Horizontal range-bound markets create repeated false EMA crossovers, causing whipsaw stop-outs.
Lagging 10/30 moving averages react after rapid market pivots, giving back open gains during sharp turnarounds.
Cash protection rules cause the active strategy to lag 100% unhedged long-only sector holdings in runaway bull runs.
Drawdown Summary: The strategy experienced its worst decline between December 2024 and May 2025 (-6.82%) when markets moved sideways, producing several false trend signals before recovering to new highs by June 2025.
Read detailed macro drawdown analysis βΎ
The largest drawdown in this run was -6.82%, meaning portfolio equity fell $8,497 from a peak of $124,573 down to a trough of $116,076 on May 6, 2025 before recovering. It took 106 days to reach its low (December 2, 2024 through May 6, 2025) and another 37 days to recover back to new equity highs by June 30, 2025.Get the Next Quantitative Strategy Teardown
One backtest per weekβincluding what worked, what failed, and exact R/Python rules.
How Consistent Were Monthly Returns?
Monthly Returns Commentary & Cross-Asset Dynamics
Inspecting the month-by-month performance matrix highlights key market regimes during the 2023β2026 backtest:
-
Strong Sector Trend Regimes (e.g. Late 2024 / Q1 2025): Major monthly gains in the strategy occurred during multi-month bull rallies in Tech (XLK) and Financials (XLF). Because active sector positions aligned with positive EMA trend and RSI > 50, portfolio equity compounded rapidly alongside SPY.
-
Volatile & Pullback Regimes (e.g. Early 2026): During sharp market pullbacks (such as early 2026), the active strategy experienced brief initial dips before trailing EMA crossover rules triggered cash exits. In contrast to unhedged sector ETFs which suffered severe unhedged drawdowns, systematic exit signals capped monthly portfolio losses, preserving accumulated equity.
-
Asymmetric Monthly Returns: Across the 35 months with nonzero returns, 21 were positive (averaging +3.57%, with a best month of +8.47%) versus 14 negative months (averaging -1.91%, with a worst month of -4.80%). Both the frequency and the average size of gains outweigh the losses. Mechanically, this follows from the strategy’s own rules: the EMA/RSI entry filter keeps it out of the market during choppy or declining stretches (it was invested only 68.5% of the time), and the EMA-cross exit closes losing trades quickly rather than riding out a full down month, while winning trends are held for as long as the crossover stays bullish.
Conclusions
In summary, this 3-year backtest (2023β2026) shows a systematic 10/30 EMA trend filter meaningfully reducing sector ETF drawdown risk, but at a real cost to raw return. By growing $100,000 to $158,574 (+58.57% total return, +16.66% CAGR) across 79 closed trades, the strategy lagged the SPY benchmark (+77.04% total return, $177,038) by 18.5 percentage points, while reducing maximum portfolio drawdown from -18.20% to -9.81% and posting a better Sharpe ratio (1.36 vs. 1.12). The RSI filter makes no measurable difference to the result β the drawdown reduction comes entirely from the EMA trend-following mechanism itself.
Unhedged long-only sector holdings also outperformed the active strategy on raw return (+69.44% for the Sector Basket), while exposing investors to a larger -17.51% drawdown and a lower Sharpe ratio (1.31). For risk-conscious traders willing to accept a lower raw return in exchange for a smoother, better risk-adjusted equity curve, systematic trend filtering provides a disciplined mechanism for managing downside risk β though this backtest does not support the stronger claim that it does so "without sacrificing returns."
As with any backtest, historical results in a 3-year sample do not guarantee future performance. Market regimes evolve, and execution friction (such as slippage and liquidity shifts) should always be accounted for when transitioning from backtest to live execution.
Take It Further
The strategy’s maximum drawdown was 9.8%. Adding a volatility-based stop-loss could make downside control more explicit while preserving the existing trend and momentum entries.
Trade XLK, XLF, XLI, XLE, XLV, and XLY. Enter long when the 10-day exponential moving average crosses above the 30-day exponential moving average and the 14-day RSI is above 50. Exit when the 10-day exponential moving average crosses below the 30-day exponential moving average, or when the closing price falls 2 times the 14-day Average True Range below the entry price, whichever happens first. Keep the same position sizing approach as the original strategy and make no other changes.
Copy this prompt into quantstr.at’s strategy builder to try it yourself.
π Continue Experimenting
EMA Crossover Backtest
Does a moving-average crossover strategy work without an RSI filter?
Read Walkthrough →RSI Mean-Reversion Backtest
How effective is RSI by itself for tactical asset allocation?
Read Walkthrough →Bollinger Bands Mean Reversion
How do volatility envelopes compare to moving average trend filters?
Read Walkthrough →Strategy Specifications & Replication Code
Understanding Slippage & Execution Friction βΎ
In real-world quantitative trading, orders are subject to market impact, bid-ask spreads, and execution delays. To model these realistic conditions, this backtest applies a **5 basis points (0.05%) slippage penalty** on every transaction fill.β’ Market Buy Trigger: Technology (XLK) trading at $200 per share
β’ Actual Execution Fill Price = $200 × (1 + 0.0005) = $200.10 per share
β’ Total Capital Outlay (100 shares) = $20,010 ($10 entry friction penalty)
β’ Sell Exit Fill Price ($220 trigger) = $220 × (1 – 0.0005) = $219.89 per share
Strategy Code & Replication
The full R (quantstrat) and Python (VectorBT) implementations behind every number in this article β including the parameter optimization grid search and the look-ahead-free walk-forward validation β are published as two standalone, pre-executed research reports. Each one actually re-runs the backtest end to end against fresh market data when rendered; nothing in them is copy-pasted from this article, and re-rendering either one reproduces every result from scratch.
Both reports use a fixed 300-share position size per trade, 5 bps slippage, and next-bar-open fills β identical mechanics to this article’s headline backtest.
What’s Actually in the Full Code Package
The two research reports linked above are real, tested, pre-executed code — here’s what’s in them if you want to run this strategy, or adapt it, yourself.
- The exact strategy code behind every number in this article — not a summary, the real backtest, in both R (quantstrat) and Python (VectorBT).
- A parameter optimization grid search across EMA fast/slow windows — ready to point at your own parameter ranges.
- A genuine walk-forward validation: rolling re-optimization with real, no-look-ahead out-of-sample testing — extended live through today’s date, not frozen at this article’s publish date.
- The honest out-of-sample check built in: over the same 20 months (Feb 2025 – Sep 2026), walk-forward re-optimization — every parameter choice made using only data available at the time — returned +33.6% vs. +31.6% for SPY and +30.3% for the sector basket, with less than half the drawdown (-8.3% vs. -18.8%). And it doesn’t flatter itself: the fixed EMA 10/30 rule returned +37.5% over the same dates, and the best combo picked with hindsight +42.0% — the code prints that full comparison so you can see what re-optimizing actually bought you, on your parameters, before risking real capital.
- Cash-management overlays (T-Bill/bond ETF), portfolio exposure tracking, and every chart in this article — all reproducible, all editable.