A 3-Year Backtest of MACD SMI & Trend Following vs. SPY (2023–2026)
This post walks through a real backtest run on quantstr.at, an AI-assisted quantitative backtesting platform. Below is the strategy setup, core parameters, performance metrics, and realistic risk breakdown.
This study evaluates a quantitative strategy based on the prompt below across a multi-asset ETF universe over the 2023-08-29 to 2026-08-27 period. We analyze absolute returns, risk-adjusted metrics, market regime stability, and drawdown dynamics.
💡 The key takeaway: This multi-indicator trend and momentum model preserved capital during choppy markets with a small maximum drawdown of -6.9% (vs. SPY -18.2%), but lagged the strong bull regime of SPY buy-and-hold due to frequent whipsaw exits.
Trade XLK, XLF, XLI, XLE, XLV, and XLY using an active trend-following and momentum strategy. Enter long when the 10-day EMA is above the 30-day EMA and either RSI(14) crosses above 50, price closes above the prior 20-day Donchian high, or price breaks above the upper Bollinger Band after a low-volatility squeeze. Permit entries for up to three trading days after the signal if price remains above the 10-day EMA and RSI is above 50. Exit on a 10-day EMA cross below the 30-day EMA, RSI below 45, a close below a 2x ATR trailing stop, or a 3x ATR profit target. Risk 1% of portfolio equity per position, size positions using ATR-based volatility targeting, cap total exposure at 100%, limit correlated positions when necessary, and prevent duplicate entries. Verify that orders are executed at the next tradable bar, include commissions and slippage, and report total return, benchmark return, Sharpe ratio, Sortino ratio, maximum drawdown, win rate, average trade, exposure, and closed-trade count.
| Strategy Initialization & Execution Parameters | |
| Core environment setup for this backtest run | |
| Parameter | Setting / Value |
|---|---|
| Asset Universe | U.S. Sector & Asset ETFs |
| Time Window | 2023-08-29 to 2026-08-27 |
| Starting Equity | $100,000 |
| Benchmark | SPY Buy & Hold |
| Execution Fill | Close of bar T |
| Slippage & Commission | 5 bps slippage, $0 commission |
| Position Sizing | Account-relative allocation |
This is a long-only trend-following and momentum strategy applied to XLK, XLF, XLI, XLE, XLV, and XLY. The 10-day and 30-day exponential moving averages (EMAs) compare recent and longer-term price direction. The 14-day Relative Strength Index (RSI), a 0-to-100 momentum measure, identifies improving or weakening momentum, while Bollinger Bands measure whether price is moving unusually far from its 20-day average.
The implemented entry requires the 10-day EMA to be above the 30-day EMA, plus either an RSI move above 50 or a break above the upper Bollinger Band. Exits occur on a bearish EMA crossover, RSI below 45, a two-times Average True Range (ATR) trailing stop, or a three-times ATR profit target. ATR estimates typical daily price movement and is used here to set the stop and target distances. Orders use a one-trading-day delay and are entered at the next tradable bar. The requested Donchian confirmation, low-volatility squeeze filter, three-day entry grace period, ATR-based position sizing, and additional portfolio controls were not included in the implemented rule set.
| Strategy Specification | |
| Quantitative component breakdown | |
| Component | Description |
|---|---|
| Indicator | ema_fast: Technical indicator calculation. ema_slow: Technical indicator calculation. rsi_14: Technical indicator calculation. donchian_20: Technical indicator calculation. bbands_20: Technical indicator calculation. atr_14: Technical indicator calculation. atr_stop_2x: Technical indicator calculation. atr_target_3x: Technical indicator calculation. |
| Signal | trend_up: The 10-day EMA remains above the 30-day EMA. rsi_cross_above_50: RSI(14) crosses above 50. rsi_above_50: RSI(14) remains above 50. bbands_break: Price breaks above the upper Bollinger Band, represented by Bollinger percent B crossing above 1. entry_signal: Long entry when the fast EMA is above the slow EMA and either RSI crosses above 50 or price breaks above the upper Bollinger Band. ema_exit: The 10-day EMA crosses below the 30-day EMA. rsi_exit: RSI(14) remains below 45. |
| Rule | Enter long on trend momentum signal: Order execution rule. Exit on bearish EMA crossover: Order execution rule. Exit on RSI weakness: Order execution rule. Two-ATR trailing stop: Order execution rule. Three-ATR profit target: Order execution rule. |
| Backtest Summary | ||
| The core figures from this run, at a glance | ||
| Metric | Value | What It Measures |
|---|---|---|
| Total Return | 3.34% | Growth of the account over the full backtest window |
| Annualized Return | 0.0429% | Return scaled to a one-year rate, for comparing across different time windows |
| Number of Trades | 120 | Closed round-trip trades this strategy actually made |
| Position Size | 54 to 171 units per trade | How many shares/units each trade actually bought or sold — see “A note on position sizing” below |
| Win Rate | 36.8% | Share of closed trades that were profitable |
| Sharpe Ratio | 0.015 | Return per unit of total volatility |
| Sortino Ratio | 0.019 | Return per unit of downside volatility only |
| Calmar Ratio | 0.160 | Return relative to the worst peak-to-trough drawdown |
| Max Drawdown | 6.94% | Largest peak-to-trough decline over the backtest |
| Value at Risk (VaR) | -0.600% | The loss threshold not expected to be exceeded in a typical period |
| Expected Shortfall (CVaR) | -1.28% | The average loss in the worst-case tail beyond the VaR threshold |
| Buy & Hold XLK + XLF + XLI + XLE + XLV + XLY Return | 157.82% | What simply buying and holding XLK + XLF + XLI + XLE + XLV + XLY the whole time would have returned — the baseline this strategy is measured against |
| Strategy vs. Buy & Hold | -154.47% | How much better (positive) or worse (negative) the strategy did than that baseline |

The strategy completed 120 closed round-trip trades and turned the initial $100,000 into a 3.3444% total return. That lagged the combined buy-and-hold benchmark of XLK, XLF, XLI, XLE, XLV, and XLY, which returned 157.82%, by 154.47 percentage points. It also lagged SPY’s 77.04% return over the same period.
The Sharpe ratio was 0.0146. Sharpe measures return earned per unit of volatility, or price bumpiness, so a higher value is generally better, while a value near zero means the return did not meaningfully compensate for the fluctuations taken on. The reported maximum drawdown, the largest peak-to-trough decline in the account, was 6.9372%, and the low Sortino ratio of 0.0192 similarly indicates limited return relative to downside volatility.
At the trade level, 120 trades provide more observations than a single-trade result, but the modest total gain shows that winning and losing positions largely offset one another. The reported monthly returns ranged from -504.67% to +333.25%, which is inconsistent with the 3.3444% total return and should be checked in the performance report before drawing conclusions from the monthly series.


| Risk-Adjusted Return Metrics | ||
| Every number here comes straight from this backtest’s quantstr.at report | ||
| Metric | Value | What It Measures |
|---|---|---|
| Annualized Return | 1.11% | Return scaled to a one-year rate |
| Annualized Volatility | 5.39% | How much returns swing year to year |
| Sharpe Ratio | 0.015 | Return per unit of total volatility — the classic risk-adjusted return measure |
| Sortino Ratio | 0.019 | Return per unit of downside volatility only — ignores upside swings that Sharpe penalizes unfairly |
| Calmar Ratio | 0.160 | Return relative to the worst peak-to-trough drawdown |
| Omega Ratio | 0.050 | Probability-weighted ratio of gains to losses — doesn’t assume a normal return distribution the way Sharpe does |
| Downside Deviation | 0.259% | Volatility of losing periods only |
| Upside Potential Ratio | 0.511 | Upside capture relative to downside risk — a Sortino-style ratio facing the other direction |
| Probability Sharpe > 0 | 65.44% | Statistical confidence the strategy’s TRUE Sharpe ratio (not just this one sample) is greater than zero |
| Min. Track Record Needed | 12,866 | Minimum number of return observations needed for that confidence level to be meaningful |
| Sharpe Statistically Significant? | No | Whether this backtest has enough history for its Sharpe ratio to be statistically real, not noise |

The largest drawdown was 6.9372%, or about $6,937 on the initial $100,000 account. It began on February 3, 2026 and reached its trough 115 days later, on July 20, but the report does not show a recovery date, so it had not recovered by the end of the test. The average drawdown lasted 20.8125 days and took 8.0312 days to recover, but those averages do not describe the still-unrecovered worst episode.
The risk-adjusted results provide little support for the 3.3444% total return. The Sharpe ratio was 0.0146 and the Sortino ratio was 0.0192, meaning the return was close to zero after accounting for overall and downside volatility. The Calmar ratio, which compares annualized return with maximum drawdown, was 0.16, also indicating limited return relative to the largest decline. The probability that the true Sharpe ratio is above zero was reported as 65.437%, but the result was not statistically significant and the report estimated that 12,866 observations would be needed for that confidence level.
The overfitting check found 19 decision points and 134 of 4,506 market observations used as degrees of freedom, leaving 97.0% remaining. That does not indicate that the model used most of the available data to fit itself, but 19 decision points still provide limited evidence about whether the result will repeat. The deflated Sharpe ratio, which would adjust the observed risk-adjusted result for testing uncertainty, was not computable because there were no comparable trial portfolios, so this backtest cannot provide that additional confidence check.

Before publication, this strategy was evaluated by our automated Strategy Review Agent across 2 review round(s).
RETRY_OPTIMIZEDA raw return number alone can mislead: a strategy earning 20% through wild swings is not automatically better than one earning 10% more smoothly.
Sharpe divides return by total volatility, so this backtest’s 0.0146 asks whether its return compensated for all price fluctuations. Sortino divides return by downside-only volatility, so its 0.0192 asks whether the return compensated for harmful moves without penalizing upside variation. Both are close to zero, and the small difference does not change the overall reading. Calmar divides annualized return by maximum drawdown, and the 0.16 result compares the 1.11% annualized return with the 6.9372% worst decline, also indicating limited compensation for risk. The reported 65.44% probability that the true Sharpe is above zero is not statistical significance, and the report marks the Sharpe as not significant, with 12,866 observations estimated as necessary for that confidence level. In your own quantstr.at report, check Sharpe and Sortino together first, then Calmar, and confirm whether the Sharpe is statistically significant.
This backtest showed a modest 3.3444% total return from 120 closed round-trip trades, far below the 157.82% buy-and-hold return for the six ETFs and SPY’s 77.04% return. Its Sharpe ratio of 0.0146 and Sortino ratio of 0.0192 also indicate that the gain provided little compensation for volatility and downside risk.
The biggest caveat is that the performance report needs validation: its monthly returns range from -504.67% to +333.25%, which is inconsistent with the reported total return. The reported 6.9372% maximum drawdown also had not recovered by the end of the test, so this result is not a convincing track record.
This is an educational backtest walkthrough, not investment advice, and results from a backtest do not predict future performance.
The strategy returned 3.3444% while the six-ETF buy-and-hold benchmark returned 157.82%, and its Sharpe ratio was only 0.0146. Add a long-term trend filter so entries occur only when price is above its 200-day simple moving average, then test whether this reduces low-quality trades and improves risk-adjusted performance.
Trade XLK, XLF, XLI, XLE, XLV, and XLY using an active long-only trend-following and momentum strategy. Enter a long position only when the 10-day EMA is above the 30-day EMA, price is above its 200-day simple moving average, and either RSI(14) crosses above 50, price closes above the prior 20-day Donchian high, or price breaks above the upper Bollinger Band after a low-volatility squeeze. Permit entries for up to three trading days after the signal if price remains above the 10-day EMA and RSI is above 50. Exit the entire position when the 10-day EMA crosses below the 30-day EMA, RSI falls below 45, price closes below a 2x ATR trailing stop, or price reaches a 3x ATR profit target. Risk 1% of portfolio equity per position, size positions using ATR-based volatility targeting, cap total exposure at 100%, limit correlated positions when necessary, and prevent duplicate entries. Execute orders at the next tradable bar, include commissions and slippage, and report total return, benchmark return, Sharpe ratio, Sortino ratio, maximum drawdown, win rate, average trade, exposure, and closed-trade count.
Copy this prompt into quantstr.at, or just click below — it loads straight into the chat, ready to run.
| Trade Statistics by Symbol | |||||||||||||||||||||||||||
| Detailed performance and risk metrics breakdown per traded asset | |||||||||||||||||||||||||||
| Symbol | Trades | Net P&L | Win Rate | Loss Rate | Max Equity | Min Equity | Gross Profits | Gross Losses | Max Drawdown | Transactions | Avg Daily P&L | Avg Trade P&L | Ending Equity | Largest Winner | Largest Loser | Profit Factor | Avg Winning Trade | Avg Losing Trade | Median Trade P&L | Annualized Sharpe | Daily P&L Std Dev | Trade P&L Std Dev | Avg Win/Loss Ratio | Median Losing Trade | Median Winning Trade | Median Win/Loss Ratio | Profit / Max Drawdown |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| XLK | 19 | -3524.24 | 36.8% | 63.2% | 1735.31 | -3524.24 | 3870.86 | -7395.10 | -5259.55 | 65 | -185.49 | -185.49 | -3524.24 | 1427.41 | -4150.32 | 0.52 | 552.98 | -616.26 | -31.46 | -2.64 | 1115.30 | 1115.30 | 0.90 | -213.56 | 525.94 | 2.46 | -0.67 |
| XLF | 16 | 2946.06 | 50.0% | 50.0% | 3531.83 | -68.36 | 4554.15 | -1608.09 | -2675.28 | 52 | 184.13 | 184.13 | 3221.37 | 1518.66 | -348.32 | 2.83 | 569.27 | -201.01 | 29.98 | 5.78 | 505.77 | 505.77 | 2.83 | -202.80 | 437.78 | 2.16 | 1.20 |
| XLI | 22 | 451.41 | 36.4% | 63.6% | 2521.62 | -3.70 | 5480.75 | -5029.34 | -2436.51 | 74 | 20.52 | 20.52 | 451.41 | 1215.72 | -691.78 | 1.09 | 685.09 | -359.24 | -255.56 | 0.57 | 575.67 | 575.67 | 1.91 | -358.94 | 627.20 | 1.75 | 0.19 |
| XLE | 19 | 299.54 | 26.3% | 73.7% | 5602.10 | -1054.14 | 5581.53 | -5281.99 | -5307.36 | 63 | 15.77 | 15.77 | 1507.54 | 1990.42 | -1645.73 | 1.06 | 1116.31 | -377.29 | -79.35 | 0.29 | 868.84 | 868.84 | 2.96 | -117.12 | 1189.67 | 10.16 | 0.28 |
| XLV | 19 | 1020.35 | 42.1% | 57.9% | 3493.57 | -1556.21 | 4991.32 | -3970.98 | -3486.61 | 59 | 53.70 | 53.70 | 2968.60 | 2140.72 | -1393.72 | 1.26 | 623.92 | -361.00 | -131.58 | 1.19 | 717.26 | 717.26 | 1.73 | -193.94 | 328.44 | 1.69 | 0.85 |
| XLY | 21 | -1185.91 | 28.6% | 71.4% | 1997.46 | -1280.26 | 2985.58 | -4171.49 | -3277.72 | 65 | -56.47 | -56.47 | -1280.26 | 1548.56 | -921.46 | 0.72 | 497.60 | -278.10 | -74.63 | -1.74 | 515.84 | 515.84 | 1.79 | -191.35 | 322.04 | 1.68 | -0.39 |
Built with quantstr.at. Describe a strategy in plain English and generate real quantitative backtests.