Aureon
← indexstrategy buildJUL 22, 202618 min read

Building a Mean-Reversion Strategy From Scratch, Tested Honestly

Most strategy content presents the finished product: a set of rules, an attractive equity curve, and the implication that you could have had it too. What it omits is the process. The hypothesis that required narrowing, the first test that came back unremarkable, the point at which you have to decide whether a disappointing result means adjust the strategy or means you are about to overfit.

This piece is that process from start to finish. We build a mean-reversion strategy on liquid US equities, write the code, and test it honestly. The objective is not to hand over a system to trade. It is to demonstrate a repeatable method applicable to any hypothesis you hold, and to show what an honest result looks like, including the portions that do not flatter the strategy.

Everything here runs on free data using standard Python libraries.


Step 1: Start with a hypothesis, not an indicator

The most reliable way to build a poor strategy is to begin with an indicator and search for something it predicts. That sequence is backwards, and it produces exactly the behavior that leads to testing hundreds of parameter combinations until one fits.

Begin instead with a claim about why an edge should exist, an economic or behavioral reason that money is available. The rules follow as an attempt to express that claim in code.

Our hypothesis:

When a liquid, large-cap stock declines sharply over a short window without a change in the underlying business, a portion of that move is liquidity-driven and mechanical, reflecting forced selling, stop cascades, and short-term overreaction rather than information. That portion tends to partially revert over the following days.

This is a well-documented effect, short-term reversal, which is both encouraging and problematic. Encouraging because we are not inventing a pattern from noise. Problematic because a well-known effect is a crowded one, and any remaining edge is likely small and fragile after costs. We should expect a modest result rather than a spectacular one. Establishing that expectation in advance is what prevents us from torturing the data later to produce something impressive.

Note what the hypothesis excludes. It specifies liquid, large-cap names, where information moves quickly and mechanical flow represents a larger share of short-term price action, and it specifies short windows. That specificity is a feature. It constrains how many variations we are permitted to try.

Step 2: Define the rules before you see results

Write the rules now, while you have no idea whether they work. This is the single most effective defense against overfitting, because rationalizing a change becomes considerably harder once you have committed against it.

Universe: S&P 500 constituents, for liquidity and plausible slippage. See the survivorship note below, which matters more than it sounds.

Entry: Buy at the following day's open when a stock's 2-day return falls in the bottom decile of the universe that day.

Exit: Sell at the open 5 trading days later. Fixed holding period, no discretion.

Sizing: Equal weight across qualifying positions, maximum of 10 positions.

Costs: 5 basis points per side, covering commission plus a conservative slippage estimate on liquid large caps.

Four parameters in total: lookback of 2 days, threshold at the bottom decile, holding period of 5 days, position cap of 10. That is deliberately few. Every additional parameter multiplies the number of combinations available to search, and every combination is another opportunity to find something that worked by chance.

locked · premium

The rest is for members.

You’re reading the free preview. Premium unlocks the full file on every deep-dive:

  • 01the full methodology: costs, sizing, failure modes
  • 02the complete, runnable research notebook
  • 03every resource unlocked the day it ships

the dispatch

Get the next piece of research when it ships. No schedule filler.

want the full notebooks behind articles like this? go premium →