Mean Reversion Strategies in Python (Course Review)

This post contains affiliate links. An affiliate link means Blackarbs may receive compensation if you make a purchase through the link, without any extra cost to you. Blackarbs strives to promote only products and services which provide value to my business and those which I believe could help you, the reader.

In this post I will be reviewing the course “Mean Reversion Strategies by Dr. E.P. Chan” (<—affiliate link, use discount code LONGSHORT for an additional 5% off at checkout). First off, for readers unfamiliar with the course author, Dr. Chan is a world renowned quant with decades of experience working with private and institutional clients. He is also the managing member of a hedge fund called QTS capital.

His research and publications have garnered widespread appreciation, over the years. Unfortunately for Python programmers most of his past research was done in Matlab. Matlab was a very popular tool for researchers at one point but has been overtaken by the ubiquity of the Python programming language. So when I read that he had created a course using Python I was excited to review it. 

In mean reversion strategies, the course author focuses on three categories of mean reversion systems. These are pairs trading, index arbitrage, and cross-sectional long-short strategies. 

However the primary focus of the course is pairs trading. I suspect this is because pairs trading is more accessible to retail traders, whereas index arbitrage and long-short strategies have institutional resource requirements.

Regardless, the course did an excellent job of building on the subject matter in an intuitive and understandable way. The concepts were explained in a manner that a layman can grasp which is an accomplishment in the quantitative education space.

For example the course details the calculation of the hedge ratio. Crucially he explains how the interpretation of the hedge ratio changes based on whether you use raw prices or log prices. While this may seem like a simple fact, these nuances are often obscured or overlooked in other sources.

What I appreciated most about this particular section of the course is that he addresses some of the implementation details that have become critical, as the strategy has gained in popularity and its performance has degraded. He covers at least six methods to handle cointegration breakdown.

The course also covers the famous cointegrated ADF test for identifying and trading pairs. He also explains the limitations of the traditional CADF test and why the Johansen test is a much more useful tool. 

Additionally, there is a demonstration on how to estimate half-life of the mean reversion of a pair. This can help the trader choose among pairs, by selecting those with the shortest half-life.

Index arbitrage and cross-sectional long-short strategies are briefly described with detailed explanations of the challenges to implementing these strategies. 


Overall I was pleased with the course, particularly the aforementioned methods to handle cointegration breakdown. The Python code examples are clear, and easy to follow, and there are additional PDF documents that explain key topics in further detail. I recommend Mean Reversion Strategies for Python coders who want a template to explore these concepts, and unfamiliar traders who want to learn about alternative strategies to trend following.

Traditionally pairs trading is intuitive, flexible, market neutral and uncorrelated with the major stock indices. These reasons are why the strategy continues to be popular, and why this course can add value to traders.

Be on the lookout for followup post where I implement and backtest a pairs trading strategy.

References