Educational research only
Hypothesis
Buying when RSI(14) closes below 30 and selling when it closes above 70 produces positive risk-adjusted returns after realistic transaction costs, across a broad equity universe.
Methodology
Point-in-time universe of 500 US equities reconstructed for each year, including delisted instruments, to avoid survivorship bias.
Daily bars, 2004–2024. Signal computed on the close, executed at the next open. Costs modelled as 1bp commission plus half-spread plus a square-root market impact term.
Equal-weight positions with a 5% per-position cap. Evaluated with walk-forward: three-year in-sample optimisation windows, one-year out-of-sample evaluation, rolled annually.
The parameter grid covered RSI period (7, 14, 21) and thresholds (20/80, 25/75, 30/70) — nine combinations, and that count is reported alongside the results because it determines how much of the best result is selection.
Dataset
Daily OHLCV for 500 US equities, 2004–2024, with point-in-time index membership including delisted securities. Roughly 2.4 million rows.
Experiment setup
Polars for the signal computation, DuckDB for the point-in-time universe joins, and the Backtest Lab harness for execution and cost modelling. The full notebook and the universe reconstruction script are linked above.
Discussion
Why this question keeps coming back#
RSI is the most-taught indicator in retail trading education, and almost none of that teaching includes a cost-aware, survivorship-corrected, out-of-sample test. The claim is repeated because it is intuitive, not because it has been checked.
Educational research only
This is a study, not advice. Nothing here recommends any trade or instrument. Backtested results are hypothetical and past performance does not indicate future results.
The cost story in one table#
| Configuration | Gross Sharpe (OOS) | Net Sharpe (OOS) | Turnover (annual) |
|---|---|---|---|
| RSI 14, 30/70 | 0.54 | 0.18 | 11.2× |
| RSI 21, 25/75 | 0.41 | 0.22 | 6.8× |
| RSI 7, 20/80 | 0.62 | 0.09 | 19.4× |
The pattern is consistent and it is the actual finding of this study: the more responsive the parameters, the better the gross result and the worse the net one. Any evaluation that omits costs will systematically select the worst real configuration.
What would change the conclusion#
A version of this test that included a volatility filter, position sizing by conviction, or a liquidity screen might well produce a different answer. Those are separate hypotheses and they need separate tests — adding them to this one after seeing these results is exactly the multiple-testing problem this study is trying to be honest about.
Results
The baseline rule (RSI 14, 30/70) produced a Sharpe ratio of 0.18 out of sample after costs, against 0.71 in sample. Retention of 25%.
Before costs, the out-of-sample Sharpe was 0.54. Costs consumed roughly two thirds of the gross result, because the rule trades frequently.
The best of the nine parameter combinations reached 0.31 out of sample — but given nine tests on the same data, that figure carries an expected selection premium of roughly the size of the gap.
Interpretation
The signal is not nothing, and it is not tradeable on its own.
There is a real, weak mean-reversion effect in the data, consistent with the literature. It is small enough that transaction costs consume most of it and small enough that it is inside the noise band once you account for having tested nine variants.
The more interesting result is the composition. Nearly all the gross return came from the highest-volatility quintile of the universe, where spreads are widest — which is why the cost drag is so severe. The signal is strongest exactly where it is most expensive to act on. That is a pattern worth remembering, because it recurs across simple technical rules.
The honest summary: RSI is a reasonable input to a larger model and a poor standalone strategy.
Nothing here is a recommendation to trade.
Limitations
Daily bars only; an intraday implementation might capture the effect before costs erode it, or might not — this does not test that.
No short-side borrow costs modelled, which flatters the short leg.
US equities only, 2004–2024. That is roughly two full market cycles, which is a small number of independent observations.
The nine-variant grid is small, but it is not one test. The reported best result should be discounted accordingly.
Reproducibility
The notebook runs end to end in about 12 minutes on a laptop. Data files, the universe reconstruction script and a pinned environment are in the repository. Random seeds are fixed; results are deterministic.
If you rerun this and get a materially different number, the most likely cause is a survivorship-biased universe — that difference alone typically moves the Sharpe by 0.1 to 0.2.
Found something different when you reran this? That is the point — the notebook and data are linked above. Corrections are published as updates rather than quietly edited.
Related work
Backtest Metrics Calculator
Paste a return series and get the risk-adjusted metrics that matter, with the assumptions stated. Educational only.
Algorithmic Trading Backtest Lab
A backtesting framework with transaction costs, slippage, walk-forward analysis and survivorship-bias handling — designed to stop a strategy looking better than it is. Educational research only.
Why Most Backtests Lie
Backtests fail in a consistent direction — optimistic. Here are the five structural reasons, with a detection method for each. Educational research only.