RealTest strategies / RealTest Short Term Mean Reversion Strategy

RealTest Short Term Mean Reversion Strategy

A RealTest strategy that buys short-term pullbacks in S&P 500 stocks that are still in a confirmed uptrend, following the Connors and Alvarez methodology. By only buying dips inside a rising trend, it stays with strong stocks going through temporary weakness rather than ones that are breaking down. Tested on survivorship-free Norgate data with commissions modeled, and trading live since October 2024.

Live traded since Oct 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.3M $589k
Strategy SPY buy & hold
Sharpe ratio?
0.94
+96%vs SPY 0.48
Best year?
+120.2%
4.5×SPY best: 27.0% in 2003
Max drawdown?
-19.0%
62% smallervs SPY -49.9%

Validated four ways

See how each test is run →

Live market performance
Performs in real market conditions since 2024-10-09
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 136.2% -41.8%
2008 financial crisis Oct 2007 – Mar 2009 -5.1% -49.9%
COVID-19 crash Feb 2020 – Mar 2020 -1.6% -28.7%
2022 bear market Jan 2022 – Oct 2022 12.9% -21.3%

Strategy monthly returns

JanFebMarAprMayJunJulAugSepOctNovDecYear
200010.62.316.813.015.33.84.52.2-0.512.9-6.910.2120.2%
20010.50.84.42.4-0.50.74.00.6-9.12.83.24.914.9%
20021.8-3.81.03.91.51.3-0.50.0-1.4-0.10.61.86.1%
2003-0.72.34.62.10.45.53.53.1-1.65.61.52.432.5%
20040.10.73.3-5.31.92.0-1.5-1.7-0.5-0.7-0.02.20.3%
20050.62.2-0.73.45.00.01.5-0.70.00.2-0.70.711.9%
20061.51.41.72.0-3.53.30.10.00.8-1.0-0.51.06.9%
20070.9-0.3-0.1-0.10.40.0-1.914.30.02.12.50.418.9%
2008-9.4-0.36.9-2.01.3-0.1-4.02.24.2-7.90.0-0.1-9.9%
20092.1-0.3-1.15.22.23.10.20.42.0-1.68.10.622.7%
2010-3.010.10.2-1.4-0.2-1.51.8-0.71.00.70.50.98.2%
2011-0.24.11.60.01.60.6-1.5-3.3-0.48.00.21.412.4%
20121.00.91.4-0.41.26.61.30.50.0-0.80.30.012.5%
2013-0.00.50.32.70.81.70.6-1.10.81.6-0.7-0.66.6%
2014-1.21.6-1.51.60.90.20.60.7-0.42.4-0.30.65.3%
20151.2-0.1-0.1-0.60.20.00.58.70.83.50.60.816.2%
20160.16.80.00.00.00.40.81.50.1-2.80.7-1.56.0%
2017-1.4-0.61.10.30.5-0.00.61.10.32.50.71.46.6%
20180.62.4-0.10.0-0.20.60.61.11.01.63.8-0.011.9%
2019-0.10.5-0.10.8-1.60.8-0.6-0.80.4-0.30.40.0-0.6%
2020-0.3-1.15.20.00.80.30.1-0.12.8-2.25.10.010.9%
20212.410.8-2.5-0.90.20.09.95.22.30.90.51.633.8%
2022-1.43.56.62.45.4-5.60.20.00.13.01.8-0.615.9%
20230.51.5-1.20.4-0.30.00.5-1.7-0.0-0.71.90.00.9%
20240.80.62.65.50.70.6-1.30.40.6-1.82.41.813.5%
20252.80.1-5.08.8-2.60.00.10.70.10.44.60.510.4%
20260.92.75.01.50.91.714.80.5-0.8-6.021.9%

Strategy overview

Why it buys pullbacks in strength

A stock in a steady uptrend that dips for a few days is usually seeing normal profit-taking, not the end of its trend. Short-term traders and nervous holders sell into the weakness, and once that selling clears, the stock tends to pick the trend back up. The strategy only looks for these dips in stocks that are already trending higher, so it is buying temporary weakness in a strong name rather than trying to catch a stock that is genuinely falling apart.

How it was tested

The rules come from the Connors and Alvarez book Short Term Trading Strategies That Work, quantified exactly and tested properly. The backtest runs on S&P 500 stocks including names later removed from the index, so survivorship bias does not inflate the results, and it includes Interactive Brokers commissions and a limit-order buffer. The approach uses few parameters and was checked with walk-forward analysis, so you can see how the published idea holds up with real costs rather than taking the book on faith.

How it fits your trading

This is a solid foundation strategy. The logic is well-known and easy to understand, and the trend filter keeps it out of the worst situations, so it is a natural first mean-reversion system to run and to build a portfolio around. It works on liquid large-cap stocks and takes little time to manage, and it sits comfortably next to a trend or breakout strategy that profits in different conditions.

Specification

StyleMean reversionUniverseS&P 500 current & past stocksTimeframeDailySideLongAverage hold7 trading daysTrade frequency4.0 per monthEntry executionLimit orderExit executionLimit orderDataNorgate Data (US Stocks Platinum) SoftwareRealTest or PythonCommission$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.
Python programming logo for quantitative trading backtest
Python backtest code (.py)
Full Python script. Implements the exact same strategy rules for independent backtesting.

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 Short Term Mean Reversion Strategy?
A RealTest strategy that buys short-term pullbacks in S&P 500 stocks that are still in a confirmed uptrend, following the Connors and Alvarez methodology. By only buying dips inside a rising trend, it stays with strong stocks going through temporary weakness rather than ones that are breaking down. Tested on survivorship-free Norgate data with commissions modeled, and trading live since October 2024.
Why should this edge keep working?
A stock in a steady uptrend that dips for a few days is usually seeing normal profit-taking, not the end of its trend. Once that short-term selling clears, the stock tends to resume its uptrend. The strategy only buys these dips in stocks that are already trending higher, so it is buying temporary weakness in a strong name rather than one that is genuinely falling apart. Buying pullbacks within an uptrend is one of the most tested ideas in short-term mean reversion.
Do I need RealTest to run this strategy, or can I use Python?
No, you do not need RealTest if you use Python. This strategy includes a complete, standalone Python implementation (.py) alongside the RealTest (.rts) script and plain-text rules. You can run, backtest, and modify the strategy directly in Python (using libraries like pandas, NumPy, vectorbt, etc.) with your own data source. If you prefer a turnkey trading platform, RealTest is fully supported for one-click backtests and automated live execution via OrderClerk and Interactive Brokers.
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 October 2024. The equity curve shows the backtest from 2000 and real performance from that point on.
What's included in the download?
Complete RealTest .rts source code. Full Python implementation (.py script for independent backtesting). Plain-text trading rules document. 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. A metrics table lists the exact numbers side by side: Sharpe, Sortino, net profit and worst year, for the strategy and for SPY over the same period.
Can I modify the code?
Yes. You get the complete source code (both RealTest and Python) with a perpetual single-user license. You can freely adjust parameters, rewrite position sizing, combine rules with other strategies, or embed the logic into your own custom quant pipeline.
What market data do I need?
For RealTest, Norgate Data (US Stocks Platinum) is recommended for survivorship-free testing. For Python, you can use your own historical data (CSV/Parquet), Norgate, or free sources like Yahoo Finance for exploratory testing. The benchmark backtest metrics shown here use survivorship-free Norgate Platinum data.
Can I automate execution?
Yes. For RealTest users: daily signals are generated in RealTest and automated via OrderClerk directly to Interactive Brokers (automation course available). For Python users: you can generate signals directly in your Python workflow and route orders to Interactive Brokers (via the IBKR API / ib_insync) or any broker that supports an API.
Can I ask questions about the code or the strategy?
Yes. Email info@setupalpha.com and you will get an answer, before or after you buy.

Changelog

2024-10-09Rules finalised. Live tracking starts.

No rule changes since.

Portfolio growth since 2000
3,229.4%
SPY same period: 489.0%
$790one-time
Instant download
MetricStrategySPY
Sharpe0.940.48
ROR13.94%–
Sortino0.770.45
MAR0.73–
Net profit$3.2M$489k
Expectancy2.24%–
Max exposure151.78%100%
Worst year-9.9%-33.2%

Download the complete strategy now

Active Script - C:\REALTEST\Strategies\short_term_mean_reversion.rts
RealTest Short Term Mean Reversion Strategy full RealTest script
Python programming logo for quantitative trading backtest
Python backtest code (.py)
Full Python script. Implements the exact same strategy rules for independent backtesting.
RealTest Short Term Mean Reversion Strategy
$790one-time
Instant download