Mean Reversion Comparison to Python Code
Today’s Change (Mar 17, 2026)
—
A symphony is an automated trading strategy — Learn more about symphonies here
About
A mean-reversion, regime-based strategy that uses SPY’s 200-day trend and TQQQ’s 10-day RSI to allocate between UVXY, TQQQ, SPY, and cash with equal weights; no frequent rebalancing; aims to profit from reversion while using a volatility hedge in extreme momentum moments.
How the strategy works in plain language:
1) Check the market regime by looking at SPY’s price today versus its 200-day moving average. If SPY is above the 200-day line, the market is considered in an uptrend. If SPY is below, the market is not in a clear uptrend.
2) In an uptrend: look at TQQQ’s short-term momentum. If TQQQ’s 10-day RSI is above 79 (very strong short-term strength), shift into UVXY to add a hedge against a potential pullback. If RSI is not above 79, stay with TQQQ (more exposure to tech equities).
3) In a downtrend: again use the RSI(10) on TQQQ. If RSI > 79, switch to SPY (safer, broad-market exposure). If RSI ≤ 79, stay with TQQQ.
4) Cash is allocated on a 50/50 basis to the chosen exposure and cash. There’s no frequent rebalancing; changes only occur when the rules trigger, using a small corridor width to avoid churn.
5) The goal is to exploit mean-reversion tendencies while limiting risk with hedging when momentum is extreme, but be aware this uses highly leveraged and volatile ETFs with significant risk.
Out-of-sample, this regime-aware strategy aims to beat the S&P with stronger risk-adjusted returns: Sharpe ~1.36, Calmar ~1.58, and ~92% annualized return, driven by mean-reversion and hedging. Note: drawdowns can reach ~58% in stressed markets.
Loading backtest data...
Invest in this strategy
OOS Start Date
Oct 20, 2022
Trading Setting
Threshold 10%
Type
Stocks
Category
Mean reversion, cash-equal, leveraged etfs, regime-based allocation, volatility hedge