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
Loading...
Live Market Performing
Performs in live market conditions since 2024-01-30
Premium

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

Statistical Edge Verification

Science, governed by mathematics

RealTest trading software logo

Quick start guide

From download to first backtest in 1 minutes

OrderClerk automated trading execution interface

Daily Live Trading

For RealTest automated execution

Total daily time: ~5 minutes

Get OrderClerk automation course →

Strategy Details

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

$ 0 one-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

$ 899 one-time

Full strategy code and rules.

  • ...% 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,700 one-time

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

No Coding Needed

How To Use

Download strategy, open RealTest, click "import" and "test".

You may also like

Common Questions

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.
RealTest by Martin Parker (MHP Trading). Strategies are delivered as .rts files for direct import. For live execution: OrderClerk + Interactive Brokers.
Survivorship-bias-free data from Norgate (January 2000 to present). Walk Forward Analysis for out-of-sample validation. 1000+ Monte Carlo simulations for statistical robustness. No cherry-picked parameters.
Interactive Brokers tiered commission structure is modeled. Limit order buffer: 0.1% Past Limit.
2024-01-30. The equity curve shows both backtest (from 2000) and real performance afterward.
RealTest .rts file (complete source). Plain-text trading rules. Full documentation with parameter explanations.
The equity curve above plots RealTest SPX Mean-Reversion against SPY (S&P 500 ETF) from 2000. Key metrics: CAGR, Maximum Drawdown, Sharpe, Sortino.
Complete source code, perpetual license. Modify parameters, adjust position sizing, combine with other systems, or use as a starting point for your own research. No restrictions.
Norgate Data (recommended) for survivorship-bias-free US equities. Yahoo Finance works for basic testing but lacks delisted stocks. The backtest results shown here use Norgate Platinum.
RealTest to OrderClerk to Interactive Brokers. Generate signals daily in RealTest, execute automatically via OrderClerk to IBKR. Free setup course available.