How to Create a Mean Reversion Strategy
Build the kind of mean reversion model used at quantitative firms using basic statistics and mathematics instead of machine learning.
Run Python, change assumptions, inspect results, and learn how research becomes into a profitable trading strategy
returns = df['close'].pct_change()
signal = model.predict(features)
p_value = test(edge).pvalue
# test, challenge, refine
Choose how you learn
Own a focused research notebook for life, or subscribe for the complete MemLabs curriculum, every premium notebook, competitions, exercises, and new releases.
Buy individually
£50
per premium notebook
One payment with lifetime access to the notebook you choose.
Choose a notebookMemLabs All Access
£200/month
Every notebook and course
Access the entire platform and everything released while you are subscribed.
Notebook library
Every notebook is editable, executable, and designed around a real quantitative question.
Build the kind of mean reversion model used at quantitative firms using basic statistics and mathematics instead of machine learning.
An example of researching a basic statistical anomaly using high-school statistics.
Explore different models that can adapt to changes in the distribution of price returns (regime changes).
Train an XGBoost model on calendar features, validate its predictions, and test whether the apparent edge remains after fees.
Learn how an in-sample relationship can fail to generalise by comparing Bitcoin returns across training and testing periods.
Launch a configured Python notebook directly in your browser.
Change the code, assumptions, features, and execution model.
Inspect the evidence and decide whether the result is robust enough to matter.