RealTest Strategies / RealTest All-Time-High Mean-Reversion Strategy

RealTest All-Time-High Mean-Reversion Strategy

A RealTest mean-reversion strategy that buys Russell 3000 stocks on a pullback from a new all-time high. Tested on survivorship-bias-free Norgate data, with Interactive Brokers commissions and limit fills modeled, and trading live since May 2024.

Live traded since May 2024Trading costs included Survivorship-bias-free data
$100k$300k$1.0M$3.0M'02'04'06'08'10'12'14'16'18'20'22'24'26 Live $3.1M $592k
Strategy SPY buy & hold
Sharpe ratio?
1.09
+127%vs SPY 0.48
Best year?
+50.2%
1.9×SPY best: 27.0% in 2003
Max drawdown?
-24.0%
52% smallervs SPY -49.9%

Validated four ways

See how each test is run →

Live market performance
Performs in real market conditions since 2024-05-07
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

What happened in every crash

CrisisDatesStrategySPYSame $100k in
Dotcom crash Mar 2000 – Oct 2002 25.8% -41.8%
2008 financial crisis Oct 2007 – Mar 2009 2.1% -49.9%
COVID-19 crash Feb 2020 – Mar 2020 -12.5% -28.7%
2022 bear market Jan 2022 – Oct 2022 -5.7% -21.3%

Strategy monthly returns

JanFebMarAprMayJunJulAugSepOctNovDecYear
20004.412.6-15.312.710.40.95.29.83.90.20.00.050.2%
20010.00.00.00.00.00.00.00.00.00.00.00.00.0%
20020.00.00.20.40.00.00.00.00.00.00.00.00.6%
20030.00.00.00.22.61.3-0.90.80.88.55.32.322.5%
20040.42.92.3-1.73.9-0.8-0.7-0.41.12.01.82.013.3%
2005-5.23.66.6-2.9-0.83.10.12.92.1-5.31.51.26.4%
20069.9-4.15.21.0-1.0-2.40.3-0.1-0.82.22.21.013.5%
20071.4-2.7-2.11.23.32.4-0.62.71.03.7-1.40.19.0%
20080.00.00.00.00.40.00.00.00.00.00.00.00.4%
20090.00.00.00.00.02.81.32.7-0.3-0.82.80.29.0%
2010-1.71.80.60.69.5-2.10.60.20.01.11.01.313.5%
20112.52.71.51.93.0-0.3-3.1-2.20.00.10.10.06.0%
20121.60.82.61.1-0.52.1-1.90.60.20.30.60.17.7%
20131.00.90.50.20.61.81.7-1.32.74.23.31.618.6%
2014-1.82.5-0.79.80.61.4-1.93.73.1-12.01.02.47.0%
20152.92.25.60.42.01.11.6-1.80.10.01.2-0.615.5%
20160.00.00.2-0.81.23.30.20.04.1-0.12.32.513.6%
20170.70.90.60.50.12.2-0.03.8-2.26.21.40.115.0%
20181.31.80.62.92.7-1.00.96.60.2-4.40.80.012.7%
20190.00.22.73.2-1.71.25.11.2-1.44.51.32.420.1%
2020-0.1-2.0-5.60.00.62.25.8-5.22.6-0.911.91.29.7%
20215.2-3.91.31.54.4-0.01.8-0.41.03.2-0.70.314.2%
2022-4.90.90.5-0.3-1.60.00.00.00.00.00.00.1-5.3%
20230.12.3-0.71.3-3.14.03.51.0-1.1-1.52.8-0.48.3%
20248.08.45.20.41.92.10.80.41.03.59.8-0.149.4%
202519.7-7.0-2.8-1.20.50.91.82.55.73.5-4.52.521.2%
20266.10.64.32.37.710.9-4.42.533.2%

Strategy overview

Why the pullback happens

A stock at a new all-time high has no overhead supply. Everyone holding it is in profit, so there is no trapped seller waiting to exit at breakeven. The new high triggers profit-taking from short-term holders and shakes out late buyers, and that selling pushes the stock below where its trend would place it. The strategy waits for that pullback rather than buying the breakout. The stock is strong and briefly cheaper, which is a different situation from a stock that is simply falling.

How it was tested

The backtest runs on the Russell 3000 with delisted companies included, so survivorship bias does not inflate the results. Every fill is modeled with a limit-order buffer and Interactive Brokers commissions, and a liquidity filter keeps entries in stocks you can trade at size, so the equity curve is after real costs. The rules use few parameters, which leaves fewer ways to fit the strategy to past data, and it was checked with walk-forward analysis and Monte Carlo simulation. Both are shown on this page.

How it fits your trading

The strategy takes many small trades and holds them for a short time, so capital keeps turning over rather than sitting in one position. It is long-only and built on liquid US equities, which makes it straightforward to run alongside a trend or breakout system. Because the rules are simple and the logic is clear, it is a strategy you can follow through a full market cycle without second-guessing each signal.

Strategy details & model assumptions

Details

StyleMean reversionUniverseRussell 3000 current & past stocksTimeframeDailySideLongEntry executionLimit orderExit executionMarket on open

Costs included in results

Commission$0.005 / shareLimit price buffer0.1% past limitSPY benchmarkNo fees applied (favors SPY)

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
Trade it on any platform without reading the code.

What you need

Market dataNorgate Data US Stocks. Platinum Plan to reproduce the backtest, because it carries delisted stocks. Silver Plan is enough to trade it live.SoftwareRealTest (since 2024 or later).Without RealTest or NorgateThe rules come as plain English, not only as code. You can use the strategy rules in TradingView, Python, AmiBroker or your own tools.

Quick start & live trading

RealTest trading software logo
Quick start guide
From download to first backtest in 1 minute
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'

What traders say

Buying a SetupAlpha strategy didn't save me money, it saved me research time. I estimate it replaced 70–90 hours of development, debugging, and validation. Even if I never trade the strategy exactly as delivered, the research process was worth the investment.

Roman Blackwood
Roman Blackwood
Founder of AI in Trading (+13K subscribers)

I've been using a strategy from SetupAlpha and I'm really impressed with its elegance and stability. The unique approach gives me a fresh perspective and ideas I can apply to other strategies I'm developing. I'm currently working on integrating it into my suite of trading strategies.

TradeQuantiX
TradeQuantiX
Multi-country systematic trader (+4.7K subscribers)

I traded discretionary for over a decade and kept putting off going systematic because I did not know where to start. Having a finished, tested system to take apart was what finally got me moving.

Daniel
Daniel
Crypto trader

I have run it live since 2024 and it is still in my portfolio. It also changed how I test the systems I build myself.

Systematic Traders
Systematic Traders
Algo trader & Substack writer (+6.4K subscribers)

FAQ

What is RealTest All-Time-High Mean-Reversion Strategy?
A RealTest mean-reversion strategy that buys Russell 3000 stocks on a pullback from a new all-time high. Tested on survivorship-bias-free Norgate data, with Interactive Brokers commissions and limit fills modeled, and trading live since May 2024.
Why should this edge keep working?
A new all-time high means no seller is trapped above the current price, which is a structurally strong position. The pullback that follows is usually profit-taking and late-buyer exits rather than a change in trend. Entering into that selling means buying a stock that is still in an uptrend at a short-term low. The behavior behind it, short-term traders taking profits into strength, is a standard feature of how stocks trade, not a one-time pattern.
What is RealTest and what software do I need?
RealTest is a backtesting and trade automation platform for systematic traders, built by Martin Parker at MHP Trading. Each strategy comes as an .rts file you import directly. To trade it live you add OrderClerk and an Interactive Brokers account.
How was this backtested?
Survivorship-free Norgate data from January 2000 to the present, with out-of-sample walk-forward analysis and over 1000 Monte Carlo simulations to test stability.
Are transaction costs included?
Yes. The results include Interactive Brokers commissions, and a limit-order buffer of 0.1% past limit, so the equity curve is after costs.
When did live trading start?
Live trading started in May 2024. The equity curve shows the backtest from 2000 and real performance from that point on.
What's included in the download?
RealTest .rts file (complete source). Plain-text trading rules. Full documentation with parameter explanations.
How does it compare to SPY?
The chart at the top plots this strategy against SPY, the S&P 500 ETF, from 2000 with both starting at $100,000. The Full metrics panel lists the exact numbers side by side, including CAGR, maximum drawdown, Sharpe and Sortino for the strategy and for SPY over the same period.
Can I modify the code?
Yes. You get the complete source code with a perpetual license, so you can adjust parameters, change position sizing, combine it with other systems, or use it as a starting point for your own research.
What market data do I need?
Norgate Data (recommended) for survivorship-free US equities. Yahoo Finance works for basic testing but lacks delisted stocks. The backtest results shown here use Norgate Platinum.
Can I automate execution?
RealTest to OrderClerk to Interactive Brokers. Generate signals daily in RealTest, execute automatically via OrderClerk to IBKR. Setup course available.
Can I ask questions about the code or the strategy?
Yes. Email setupalpha.capital@gmail.com and you will get an answer, before or after you buy.
Portfolio growth since 2000
3,043.9%
SPY same period: 491.9%
$899one-time
Instant download
Full metrics
MetricStrategySPY
Sharpe1.090.48
ROR13.79%
Sortino0.980.45
MAR0.57
Net profit$3.0M$492k
Expectancy1.83%
Max exposure93.98%100%
Worst year-5.3%-33.2%

Download the complete strategy now

Active Script - C:\REALTEST\Strategies\all_time_high_mean_reversion.rts
RealTest All-Time-High Mean-Reversion Strategy full RealTest script
Trading strategy rules plain text document
Plain text rules
Trade it on any platform without reading the code.
RealTest All-Time-High Mean-Reversion Strategy
$899one-time
Instant download