Mean ReversionUpdated 2026-12-05

Mean Reversion Strategy Backtest (RSI-14)

Backtest a rule-based mean reversion strategy capturing short-term RSI oversold bounces inside long-term US equity uptrends.

Reference Backtest Summary (2006-01-01 to 2026-07-31)

CAGR (Annualized)
12.9%
Sharpe Ratio
1.08
Max Drawdown
-18.6%
Win Rate
63.8%
Annual Turnover
6.4x / yr
Modeled Trades
418

Reference universe: S&P 500 Liquid Constituents · Benchmark: SPY (S&P 500 ETF) · Execution: Daily close evaluation. Simulated historical results are illustrative and depend on selected tickers and date ranges.

Strategy Rules

  • Filter candidate stocks to those trading above their 200-day adjusted moving average to avoid catching structural downtrends.
  • Enter long when RSI drops below the entry_threshold on daily close.
  • Close position once RSI rebounds above exit_threshold or price breaks below the 200-day trend floor.
  • Model higher turnover impact explicitly via per-trade commissions and slippage.

Default Parameters

rsi_period14

Wilder Relative Strength Index lookback window

entry_threshold30

Buy when RSI drops below oversold level

exit_threshold65

Take profit when RSI recovers above threshold

trend_sma200

Only buy stocks trading above their 200-day SMA

Python Signal Logic

def generate_signals(df, params):
    period = int(params.get("rsi_period", 14))
    delta = df["close_adj"].diff()
    gain = delta.clip(lower=0).ewm(alpha=1 / period).mean()
    loss = (-delta.clip(upper=0)).ewm(alpha=1 / period).mean()
    rsi = 100 - (100 / (1 + gain / loss.replace(0, 1e-9)))
    trend = df["close_adj"] > df["close_adj"].rolling(200).mean()
    return ((rsi < 30) & trend).astype(float)

Known Limitations & Regime Risks

  • Mean reversion generates higher trade frequency, making realistic commission and slippage assumptions critical.
  • Sharp macro shocks can cause oversold stocks to stay oversold far longer than historical averages.

Frequently Asked Questions

Why pair RSI mean reversion with a 200-day moving average filter?

Without a long-term trend filter, RSI oversold signals repeatedly trigger on distressed or delisting stocks. Requiring price above the 200-day SMA restricts entries to pullbacks inside established uptrends.

How does transaction cost affect RSI backtesting?

Because RSI strategies trade several times per year per ticker, ignoring even 10 bps of round-trip friction can overstate annualized returns by 1%–3%. Quant Atlas models commission and slippage on every trade.

More US Equity Strategy Templates

Author: Daxi, Founder & Quantitative Researcher · Data: Sharadar US Equities (1997–2026)

Quant Atlas provides historical market data and backtesting software for research and educational purposes only. Past simulated performance does not guarantee future results and does not constitute financial or investment advice.