- Solve real problems with our hands-on interface
- Progress from basic puts and calls to advanced strategies

Posted July 21, 2025 at 12:37 pm
The post “Trading Mid-Frequency and RV like a Pro (Part 1): Identifying Mean-Reversion with Statistical Tests” was originally published on the Objectively Random Blog.
Mean reversion is one of the most important time-series features in finance. Most relative value trades require some form of mean-reversion. Most mid-frequency futures trading involves mean-reversion. Most market-making PnL is based on mean-reversion.
We all know what it is. And in fact, it is usually possible to identify mean-reverting series. The eyeball test just works. If it crosses zero enough times, it probably mean-reverts. It can’t wander. It can’t drift off. It should find its way back down again whenever it’s up, or find its way back up again whenever it’s down.
Eyeballs don’t scale, though, so it is always handy to have a statistical test.
For mean-reversion there are a few in common use:
The idea is if it mean reverts, the AR(1) coefficient will be negative, i.e.,
The extra terms with
This distribution is known as the Dickey-Fuller distribution, and it is a non-standard (and left-tailed) distribution, typically tabulated in statistical packages.
The resulting test is known as the Augmented Dickey Fuller Test. It is known as a unit-root test because the null-hypothesis
that one the roots of the characteristic polynomial is on the unit circle, similar to a Brownian motion.
In practice, since there are as many tests as there are lag-lengths k, automated ADF tests typically use a lag-length selection criterion, such as the Akaike Information Criterion (AIC) or the Bayesian Information Criterion (BIC), to select the lag-length k. Only after the lag-length is selected, the ADF test is performed.
The ADF test is known to have relatively low power, i.e., it is not very good at detecting mean-reversion when it exists (some truly mean-reverting series will be rejected).
The other standard test for mean-reversion is the Nyblom-Mäkaläinen test, available in most stats packages in its more common and general form, the KPSS test.
The standard version is based on a state-space model,
also known as the local level model, where
Typically we assume
We can see that
The Nyblom-Mäkaläinen test is a test for the null-hypothesis that the series is stationary, i.e., it does not have a unit root. This test was originally proposed by Nyblom and Mäkaläinen in 1983, and it is also known as the KPSS test, after Kwiatkowski, Phillips, Schmidt, and Shin who introduced a non-parametric (and more robust version of) it in 1992.
The test statistic is computed as follows: we estimate the state-space model, and then compute the residuals
We compute the partial sums
The KPSS test is a stationarity test because the null-hypothesis
The KPSS test is also known to have low power, i.e., it is not very good at detecting unit-roots when they exist (some truly non-stationary series will be accepted as being mean-reverting). Some practitioners consider using it in conjunction with the ADF test, although the results are mixed (see Maddala and Kim, 1998 for more).
The variance ratio test is based on the idea that if a series is mean-reverting, then the variance of multi-period returns, when scaled should be smaller than the variance of a random walk.
For a random walk, the variance of the
Although the variance ratio test is not as widely used as the ADF or KPSS tests, it is still a useful tool for testing mean-reversion in time-series data and in some ways more intuitive. For every horizon k, we can compute a variance ratio. If it is close to 1, then the series is likely a random walk. If it is less than 1, then the series is likely mean-reverting , at least at this horizon. If it is higher than one, it may be trending, again over that horizon.
And while Lo and Mackinlay tabulated the critical values, the variance ratio itself, can be related to returns on MR trading strategies – typically the lower the VR, the better then mean-reversion strategy. We see this in practice for instance, in trading illiquid FX crosses. Typically liquid crosses (vs EUR, USD or JPY) have a VR close to 1, while illiquid G10 crosses (e.g., CHF/NOK, GBP/SEK, CAD/AUD) have a VR well below 1, indicating strong(er) mean-reversion.

Source: Yahoo Finance
We note that, in the picture, the critical value is more for reference than for specific testing. This is clear when we fix the 30-day horizon (just as an example) and see that the lower the variance ratio, the better the Sharpe ratio of the mean-reversion strategy. The variance ratio is on the x-axis (unlike the previous picture), and we focus entirely on the 30-day horizon.

Source: Yahoo Finance
We note that, in the strategy picture, we have not considered trading costs or slippage, which can be significant for mean-reversion strategies.
Mean-reversion strategies are ubiquitous. However, due to the fact that mean-reversion is a fast phenomenon, transaction costs can be significant.
In terms of a trading strategy, we can think of a mean-reversion strategy as follows.
Typical strategy weights may involve scaling into a long or a short linear relative to the distance from the mean, or capping and flooring the weights to avoid excessive exposure. Also it is possible to just buy or sell a fixed number of units, when the deviation meets a certain threshold.
Mean-reversion strategies can be applied to levels of a series, to spreads between two series, or to the residuals of a regression between two series. In the latter case, the regression is typically a linear regression, but it can also be a more complex regression, such as a polynomial regression or a spline regression.
Mean-reversion is quite common in pairs trading and relative value trading. Examples include:
In a trading framework, mean-reversion can be thought of as a strategy, effectively a type of model. In the Fundamentals of Algorithmic Trading, we discuss the trading framework in terms of a signal or feature (also known as a factor in the world of Factor-based trading), a model, and a strategy. Each of these forms part of the trading framework, and they are all interlinked.
This chart describes the general flow of a trading framework, from data source to data to feature, etc, where the signal or feature is the input to the model, and the model is the input to the strategy. Sometimes steps are joined together leading to increased efficiency (but increased program complexity!). Sometimes steps are skipped for speed (or done in parallel, e.g., storing the data in a database). The picture does not describe the differences between live-trading and replay or back-testing, but the steps are similar.

We have not gone into a lot of detail, for instance in execution algorithms, accessing the book, desired position, estimating market impact, choosing order type, placing orders, monitoring them, and allocating fills, etc. The same can be said of each of the steps in the chart, which can be quite complex. We give an overview in the Fundamentals course, and consider in far more detail in the Algorithmic Trading Certificate.
While mean-reversion (and the related concept of cointegration, underpinning many pairs-trading and other stats-arb strategies) is a particularly important time-series feature, financial time-series in general have a variety of common aspects which are touched on in the appendix: Financial Time-Series Appendix.
In later posts, we talk about some stylised properties of financial time-series. In particular, the lack of stationarity, or more specifically, the local stationarity, means that mean-reversion must be monitored. In fact, many MR strategies break in time. The levels change, the relationship in spread change, everything changes.
This affects risk management, as well as monitoring the performance of the strategy. In the theoretical world of mean-reversion, stop-losses only hurt performance, but in practice they may be necessary to avoid large losses.
Addressing this is possible using a number of different methods, but most studied include Regime-switching models, and change-point detection methods, as well as (using a slightly different approach), multi-modal models, such as Gaussian Mixture Models, or K-means/K-NN. We will focus on change-point detection, given its similarities to an external statistical risk monitoring system, which can be used to alter estimation techniques and scale strategies. We will discuss this in future blog posts. It is also discussed in the Algorithmic Trading Certificate.
All of this is meant to fit together into forming profitable trading strategies (if it’s not going to be profitable, why do it?). In the course as well we talk more about the properties of certain MR strategies, such as the draw-downs (which are often brutal but brief) etc, and how to scale the strategies as part of a broader portfolio.
statsmodels and R’s tseries package.vratiotest and R vrtest, but only in some github repos for Python.Finally, I am working on a book on Algorithmic Trading, together with Dr Brian Healy, which will cover the topic in much more detail, including the statistical tests, the trading strategies, and the implementation in far more detail.
Information posted on IBKR Campus that is provided by third-parties does NOT constitute a recommendation that you should contract for the services of that third party. Third-party participants who contribute to IBKR Campus are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results.
This material is from Algo Trading Ltd on WBS Training and is being posted with its permission. The views expressed in this material are solely those of the author and/or Algo Trading Ltd on WBS Training and Interactive Brokers is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to buy or sell any security. It should not be construed as research or investment advice or a recommendation to buy, sell or hold any security or commodity. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.
Futures are not suitable for all investors. The amount you may lose may be greater than your initial investment. Before trading futures, please read the CFTC Risk Disclosure. A copy and additional information are available at ibkr.com.
There is a substantial risk of loss in foreign exchange trading. The settlement date of foreign exchange trades can vary due to time zone differences and bank holidays. When trading across foreign exchange markets, this may necessitate borrowing funds to settle foreign exchange trades. The interest rate on borrowed funds must be considered when computing the cost of trades across multiple markets.
The order types available through Interactive Brokers LLC's trading platforms are designed to help you limit your loss and/or lock in a profit. Market conditions and other factors may affect execution. In general, orders guarantee a fill or guarantee a price, but not both. In extreme market conditions, an order may either be executed at a different price than anticipated or may not be filled in the marketplace.
Trading in digital assets, including cryptocurrencies, is especially risky and is only for individuals with a high risk tolerance and the financial ability to sustain losses. Eligibility to trade in digital asset products may vary based on jurisdiction.
Join The Conversation
For specific platform feedback and suggestions, please submit it directly to our team using these instructions.
If you have an account-specific question or concern, please reach out to Client Services.
We encourage you to look through our FAQs before posting. Your question may already be covered!