RealTest Strategies / RealTest SPX Mean-Reversion

RealTest SPX Mean-Reversion

A systematic mean-reversion strategy for S&P 500 stocks built in RealTest. It identifies statistically oversold conditions using rate-of-decline filters and enters via limit orders to provide liquidity during broad selloffs. Backtested since 2000 with survivorship-bias-free Norgate data, validated through walk-forward analysis and Monte Carlo simulation.

Beating SPY
$100k grows to $12.1M. SPY only $585k
Steady Growth
Last 3 years profitable streak.
Low Drawdown Period
Strategy remained below 10% drawdown for the last 15.3 months.
Live Market Performing
Performs in live market conditions since 2024-01-30
Premium

Portfolio Growth

+2,370%

11,986.3%

SPY 485.4%

Sharpe Ratio

+143%

1.16

SPY 0.48

Max Drawdown

+56%

-21.8%

SPY -49.9%

RealTest SPX Mean-Reversion equity curve vs SPY benchmark $100k$300k$1.0M$3.0M$10.0M '02'04'06'08'10'12'14'16'18'20'22'24'26
Strategy SPY ETF

Strategy Overview

Mean-Reversion Methodology

This strategy measures the velocity and magnitude of price decline in S&P 500 constituents relative to their recent trading range. When a stock reaches a statistically defined oversold threshold, it generates a limit order entry. The logic is designed around the empirical observation that large-cap equities tend to revert after sharp short-term dislocations, particularly when the decline is driven by broad market sentiment rather than company-specific events.

Execution and Liquidity

Entries use calculated limit orders rather than market orders, which serves two purposes: it improves average fill price and naturally filters for the deepest oversold conditions. The S&P 500 universe ensures sufficient liquidity for realistic execution at the modeled prices. Backtests include Interactive Brokers tiered commissions and a limit order buffer to account for real-world fill dynamics.

Portfolio Context

Mean-reversion strategies tend to exhibit low correlation with trend-following and momentum systems. Adding this type of strategy to a portfolio that already holds long-term or momentum-based positions can reduce overall equity curve volatility. The strategy is most active during elevated-volatility regimes, providing returns in the periods where buy-and-hold exposure typically suffers the largest drawdowns.

What You Get

RealTest by MHP Trading logo
RealTest Strategy Code (.rts)
Complete RealTest (.rts) strategy code. Import, backtest, and modify.
Trading strategy rules plain text document
Plain Text Rules
Full strategy logic in plain text. Clear rules for implementation on any trading platform.

Advanced Backtest Insights

Stress Test Analysis

Crisis PeriodDatesPortfolioSPY
Dotcom Crash 2000-03-10 → 2002-10-09 108.3% -41.8%
2008 Financial Crisis 2007-10-09 → 2009-03-09 13.4% -49.9%
COVID-19 Crash 2020-02-19 → 2020-03-23 -0.5% -28.7%
2022 Bear Market 2022-01-03 → 2022-10-12 22.8% -21.3%
2025 Tariffs Crash 2025-02-19 → 2025-04-08 -10.2% -16.3%

Monthly Returns

YearJanFebMarAprMayJunJulAugSepOctNovDecTotalMaxDD
20006.517.713.712.713.64.6-0.9-0.23.016.84.91.1140.8%-11.1%
2001-2.76.73.51.70.50.87.2-0.3-9.0-0.82.52.312.0%-18.2%
2002-1.72.0-1.82.00.11.9-3.21.94.03.82.22.013.6%-14.4%
2003-2.83.31.00.06.10.34.31.72.91.03.40.023.0%-5.8%
20042.20.92.7-4.51.20.0-1.72.30.00.4-0.70.93.5%-10.4%
2005-4.5-0.23.93.30.21.0-0.20.02.1-3.20.01.94.0%-6.0%
20066.20.26.80.8-6.53.60.90.00.02.10.30.014.7%-12.1%
20070.00.21.30.02.43.7-1.23.71.01.9-3.63.313.2%-9.3%
2008-13.43.03.51.28.33.04.1-0.711.65.51.8-1.627.1%-17.9%
20090.7-13.53.25.01.42.92.10.08.07.42.63.924.5%-19.9%
2010-1.611.60.05.111.1-7.74.4-1.64.00.03.80.331.6%-13.9%
20110.03.30.92.64.3-6.11.5-8.47.67.62.01.917.2%-21.8%
20120.00.02.92.2-2.66.8-4.01.8-0.84.43.62.217.3%-6.4%
20131.5-2.70.30.8-0.74.92.50.90.24.4-0.8-0.910.6%-4.8%
2014-0.11.00.33.61.60.0-1.9-0.24.23.80.01.514.7%-7.5%
20151.9-0.34.7-0.10.01.43.31.0-2.31.64.42.118.8%-8.8%
2016-5.02.00.5-1.3-0.94.91.6-0.11.7-0.32.00.35.1%-7.4%
20171.70.00.30.90.0-1.00.53.50.00.00.40.06.4%-2.4%
20180.01.3-2.32.21.1-1.70.40.00.63.26.1-7.03.4%-10.5%
2019-0.10.02.60.0-0.83.60.01.40.02.00.04.313.6%-2.4%
2020-1.80.47.5-0.32.43.31.40.02.70.47.50.325.9%-6.8%
20210.01.017.54.91.92.07.66.64.30.80.06.366.0%-4.7%
20222.26.711.65.76.2-13.93.02.1-2.13.84.11.232.4%-20.4%
20230.5-2.9-2.80.4-1.30.50.01.7-0.3-1.63.70.0-2.3%-8.7%
20242.70.01.43.70.54.51.50.54.60.00.00.121.0%-7.4%
20254.3-6.8-1.22.70.90.00.06.40.00.03.45.715.7%-13.2%
20263.20.45.20.50.00.1-2.46.9%-10.4%
Avg-0.01.33.22.11.90.91.10.91.82.52.11.221.5%-10.5%
MetricPortfolioSPY
Sortino Ratio0.810.45
MAR Ratio0.91-
Net Profit$12.0M$485k
Expectancy2.47-
Trades10211
Win Rate73.75%-
Max Exposure100.53%100.0%
Best Year140.8%27.0%
Worst Year-2.3%-33.2%

Statistical Edge Verification

Science, governed by mathematics

Live Market Performance
Performs in real market conditions since 2024-01-30
Verified
Statistical Validation
Validated across In-Sample & Out-of-Sample data
Passed
Walk Forward Analysis
Tests robustness across unseen data
Passed
Monte Carlo Stress Test
Resilient against 1,000+ sequence risk simulations
Passed
RealTest trading software logo

Quick start guide

From download to first backtest in 1 minutes

1
You download the .rts file
Click Download
2
You open it in RealTest
File → Open → Select file
3
You import symbols
Click Import
4
You run the backtest
Click Test
OrderClerk automated trading execution interface

Daily Live Trading

For RealTest automated execution

1
Open OrderClerk
Click 'Connect to IB'
2
Import signals
Click 'Import' in RealTest
3
Generate orders
Click 'Orders' in RealTest
4
Execute trades
Click 'Place Orders'

Total daily time: ~5 minutes

Get OrderClerk automation course →

Strategy Details

Style
Mean Reversion
Universe
S&P 500 Current & Past Stocks
Timeframe
Daily
Side
Long
Entry execution
Limit Order
Exit execution
Limit Order

Model assumptions

Included in Backtest

Commission$0.005 / Share
Limit Price Buffer0.1% Past Limit

SPY Buy & Hold Benchmark

Does not include any transaction fees, slippage, or management costs.

Portfolio Builder & Simulator

Visualize your diversification edge

Instantly simulate how this strategy improves your existing portfolio. Check correlations, optimize allocations, and verify the smoothed equity curve before you deploy.

Generate Correlation Matrix
Optimize Capital Allocation
Simulate Combined Metrics
Visual Performance Comparison
Open Strategy Combiner →

Strategy Code Preview

RealTest full source code included in download

RealTest SPX Mean-Reversion RealTest code structure

Pick Your Strategy Below

Demo Strategy

$0one-time

Free RealTest demo mean reversion strategy.

  • RealTest .rts file
  • Robustness Verified
  • Does not include RealTest SPX Mean-Reversion
RealTest Users' Favorite

RealTest SPX Mean-Reversion

$899one-time

Full strategy code and rules.

  • 11,986.3% Portfolio Growth
  • In-Sample / Out-of-Sample Validated
  • Survivor-Bias Free
  • Outperforms SPY Benchmark
  • Fully Customizable Source Code
  • Download Once, Use Forever

Multi-Strategies Bundle

$2,700one-time

Instant diversification. You own our complete suite of uncorrelated, robust strategies.