Mean-Reversion Backtester

Test a z-score mean-reversion rule on any crypto, stock or ETF against up to 5 years of daily data. Sharpe, CAGR, max drawdown and win rate — versus just holding. Free, instant, no signup.

Long-only. Signals use the prior close (no look-ahead), fills at the next close, 0.1% fee per side.

Does mean reversion actually work? I ran all 15 of these.

Same settings everywhere (20-day lookback, enter at z ≤ -1.0, exit at z ≥ 0.0), 5 years of daily closes, long-only, no leverage. No parameter fitting — this is the honest, out-of-the-box result:

TickerSharpeB&H SharpeCAGRB&H CAGRMax DDB&H Max DDTime in mkt
XLE1.600.9825.4%29.1%-11.7%-26.9%18%
NVDA1.221.4341.5%101.4%-34.1%-66.4%20%
AAPL1.120.8122.5%24.4%-16.2%-33.4%21%
MSFT0.860.6615.0%18.0%-13.3%-37.6%23%
AMZN0.830.5720.9%16.5%-33.4%-55.7%21%
SPY0.760.8810.0%17.6%-9.2%-25.4%21%
META0.610.5414.0%15.8%-21.6%-76.7%22%
TSLA0.510.4913.4%10.4%-53.0%-73.6%27%
GLD0.451.283.8%29.9%-8.0%-26.4%18%
QQQ0.420.856.1%21.8%-18.2%-35.6%21%
BTC-USD0.220.392.1%7.0%-44.9%-76.6%26%
SOL-USD0.030.61-12.4%12.6%-79.1%-96.3%28%
ETH-USD-0.050.20-9.9%-9.9%-61.2%-79.4%28%
TLT-0.12-0.80-2.2%-15.5%-24.7%-46.8%35%
DOGE-USD-0.280.15-21.9%-23.4%-72.1%-85.2%34%

The honest read: mean reversion beat buy&hold on Sharpe in only 7 of 15. It lost badly on everything that trended hard (NVDA, GLD, SOL, QQQ) — you cannot dip-buy your way through a melt-up you're 80% out of.

What it did do, on all 15 without exception, is cut the drawdown: median max drawdown -24.7% vs -55.7% for buy&hold, while holding the asset only ~22% of the time. On TLT it was the difference between -24.7% and -46.8%, and it was the only thing here that made money in a bear.

So it isn't a return engine, it's a risk engine — and the 8 tickers where it lost are exactly why one parameter set proves nothing. Run your own ticker above.

Full Optimization Report — $29

The free tool tests one parameter set. One set proves nothing — the question is whether the edge survives across parameters and out-of-sample. That's what the report answers, for the ticker you choose:

Delivered as a PDF + .py file to the email you pay with, within 24 hours. Tell me your ticker in the Stripe note field (or just pay — I'll email to ask).

Get the report for your ticker — $29

Questions people actually ask

Does mean reversion work on Bitcoin?

On 5 years of daily closes, a 20-day z-score rule on BTC-USD returned 2.1% a year against 7.0% for simply holding — so no, not on return. It did cut the worst drawdown from -76.6% to -44.9% while being in the market about a quarter of the time. Whether that trade is worth it depends entirely on whether you would actually have held through the -76%.

Is mean reversion better than buy and hold?

Across the 15 tickers above it won on Sharpe in 7 and lost in 8. The pattern is consistent: it wins on choppy, range-bound, or falling markets (XLE, TLT, AAPL) and loses on sustained trends (NVDA, GLD, SOL, QQQ), because a rule that sits in cash 80% of the time cannot participate in a melt-up. It reliably reduces drawdown; it does not reliably increase return.

What lookback and z-score thresholds should I use?

The defaults here are a 20-day lookback, entry at z ≤ -1.0 and exit at z ≥ 0.0, which are conventional rather than optimal. Tighter entries (z ≤ -2) trade rarely and can look spectacular on a handful of trades; longer lookbacks react slower but survive regime changes better. Change them in the form above and watch how much the Sharpe moves — that sensitivity is the single most useful thing this tool shows you.

Why does my backtest look amazing at one setting and terrible next to it?

Because you found a lucky cell, not an edge. A real edge shows up as a broad plateau of settings that all work roughly as well; a curve-fit shows up as one isolated spike surrounded by losses. If your best result collapses when you nudge the lookback by two days, it is noise. This is why a single backtest — including the one this page just ran for you — never settles the question.

What are the limitations of these results?

Daily closes only, so intraday stops and gaps are invisible. No slippage, no commissions, no borrow or funding costs, no taxes. Long only, fully invested when in a position, no leverage. Single tickers chosen after the fact, which carries survivorship bias. Yahoo Finance data, cached up to 6 hours. Everything here is hypothetical and none of it is financial advice.