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

Posted August 20, 2025 at 11:29 am
Read Part I of this series to discover common use cases for mean reversion: Trading Mid-Frequency and RV like a Pro (Part 1): Identifying Mean-Reversion with Statistical Tests.
Mean reversion trading can be as simple as forecasting the level (or spread) we want to trade, and allocating relative to the forecast, i.e., in the simple case of an AR(1) model (or Ornstein-Uhlenbeck process), we have a model such as
where is the price level (or spread) at time and , is the backward differences, is the long-term mean, is the autoregressive coefficient, and is a white noise error term (although we may have other terms in the model, such as a trend, or a seasonal, or some AR terms to capture the short-run dynamics).
In such a model, if we recast it as
where , we can see that the model is mean-reverting if , and it mean reverts to the long-run level , with the speed of mean reversion.
With this model we can forecast the level as:
where and are the estimated coefficients from the model, (i.e., they are just found via the OLS regression of on ). As we mentioned, we could have also considered adding more AR terms, or a trend or a seasonal component.
No matter how complex the model, it is possible to forecast one (as we have done above) or more periods ahead, by recursively applying the model or “bootstrapping” the forecast. We note however that forecast quality often deteriorates as we forecast further ahead.
In all of our discussions, we will assume that returns are just the PnL of the underlying asset. We could have assumed that they were log-returns, returns, etc. It matters most in how we describe or scale our holdings since in the end whatever strategy we come up with should have PnL denominated in USD.
We define a strategy as a set of rules that determines how we allocate at time t given our forecast of the level (or spread) for time t + 1. A (self-financing)strategy will have a PnL at time T of:
where, the strategy returns at time t are given by the holdings at time t multiplied by the return at time t + 1, i.e.,
The holdings at time t should depend on our expectations at time t of expected returns over the following period(s). (In more exact terminology, we would say they are adapted to the filtration at time t, which is the information available at time t). Given that we let our returns be just PnL, our holdings are denominated in USD notional, and if we scale them by the point-value of the given asset, we can think of them as the number of units of the asset we hold at time t.
One standard (and economically justifiable) method for forming a strategy, given the forecasts, is known as mean-variance optimization (MVO). In the simplest case, we assume that we want to maximize the utility of our holdings, which is a function of the expected return and the risk (variance) of the returns.:
Where:
In the single-asset case the solution is not very interesting, but in the multi-asset case, it leads to portfolio allocation, used throughout the fund management industry, and is especially good for motivating the benefits of diversification. As we shall see, this framework is also one of the only ones which balances between risk and return, net of costs.
One standard method for trading given forecasts and fixed transaction costs is to apply a single-period Mean-Variance Optimization (MVO) framework and explicitly incorporates fixed transaction costs or slippage costs (i.e., assuming we can trade at the top of book – executing at the best bid or best ask without moving the market). We should note that we will use the term “transaction costs” to be synonymous with “slippage costs” in this post. In many contexts, transaction costs refer to fixed costs (custodial fees, brokerage fees, commissions, etc), while slippage costs refer to the difference between the expected price and the actual price at which a trade is executed, often due to market impact. We will instead use the term “transaction costs” to refer to both fixed and slippage costs, as they both impact the optimal trading strategy.
Asset Price Dynamics: AR(1) Process
As we have mentioned above, we model the change in the asset price, pt, using a first-order autoregressive (AR(1)) process, which captures mean reversion:
Where pt: The price of the asset at time t.
One-Period Ahead Return & Risk
Given the price at time t, the conditional expected return and variance for the next period (t + 1) are:
The strategy involves defining a no-trade zone around the frictionless optimal allocation. A trade is executed only when the current holding falls outside this zone. Let be the holding before a potential trade at time , and let be the fixed transaction cost per unit traded (i.e., ). The investor’s risk aversion is given by . The utility function to be maximized at each time step is:
Where:
Optimal trading with fixed costs leads to trading up to a no-trade zone around the frictionless (i.e., no transaction cost) optimal allocation. If the current holding is outside this zone, a trade is executed to bring the holding back into the zone. If the current holding is already within the zone, no trade is executed.
The no-trade zone is an interval defined by a lower (buy) boundary and an upper (sell) boundary.
The width of this no-trade zone is constant: .
Effectively, we will not trade unless the changed expected return is great enough to cover the transaction costs.
The optimal allocation, , is determined by the following rules:
We can encapsulate the above rules in a simple set of formulas using the clip function (e.g., in Pandas) given that or in code we have it as
L_p_t = (beta * (p_t - mu) - c) / (gamma * sigma**2) U_p_t = (beta * (p_t - mu) + c) / (gamma * sigma**2) h_t = np.clip(h_t-, L_p_t, U_p_t)
For anything but the smallest trade size it is unrealistic to assume that we can trade at the top of book without moving the market. In practice, larger trades will impact the market price, leading to non-linear transaction costs. This section discusses how to adapt the MVO framework to account for market impact costs, which are typically convex in nature. Consequently, we wish to extend the single-period Mean-Variance Optimization (MVO) framework to include non-linear transaction costs, specifically market impact. Unlike fixed costs which lead to a “no-trade” zone, convex market impact costs result in a strategy of continuous and smooth trading. (the continuous trading is also known as “partial adjustment” or “gradual trading” and is sometimes a reason why some traders will not use these models).
We augment the standard MVO utility by subtracting a cost term that is a function of the trade size. Let:
The general utility function, , to be maximized at each time step is:
The convexity of the cost function for ensures that the marginal cost of trading increases with trade size, which incentivises smaller, more frequent trades over large, abrupt ones. Most commonly is set to (or close to that by most market participants) while economists tend to like the power of because it can be grounded in the Kyle Model (as well as leading to closed-form solutions). These lead to different optimal trading strategies.
As mentioned above, this model is frequently used in academic literature and is supported by empirical analysis of trade data, often referred to as the “square-root impact law.”
Utility Function
Characterizing the Optimal Solution
To find the optimal holding , we take the derivative of the utility function with respect to and set it to zero. This results in a non-linear equation:
Strategy and Intuition:
This model is popular in economic theory due to its mathematical tractability, which allows for a clean, closed-form solution, as well as its theoretical grounding in the Kyle model of market microstructure (which assume noise traders and informed traders, and the resulting impact of trades on the market price, see references). Most market participants will use the square-root impact law.
Utility Function
Characterizing the Optimal Solution
The quadratic nature of the cost function makes the first-order condition a linear equation in , which is easily solved.
Solving for yields, plugging in the expected return:
Strategy and Intuition:
This solution has a very elegant and intuitive structure. If we define the frictionless target holding as , we can rewrite the solution as:
.
Conclusion
In this post, we have discussed how to trade mean-reversion strategies after identifying the level or spread to trade. We have covered two main approaches: one with fixed transaction costs and another with market impact costs. The fixed costs approach leads to a no-trade zone, which has some practical benefit since most strategies are killed by over-trading, while the market impact approach results in continuous trading strategies. The latter can be modeled with either a |turnover|3/2 or |turnover|2 cost structure, each leading to different optimal trading behaviors. The choice of model depends on the specific characteristics of the asset being traded and the trader’s preferences regarding risk and transaction costs. In practice, traders often use a combination of these models, adjusting parameters based on empirical data and market conditions to optimize their trading strategies.
New research continues to explore more complex models and multi-period trading strategies, although in practice, most traders will use a single-period model, perhaps with adjustments for the specific asset class and the alpha decay of their given strategy.
Further results
We have also discussed the optimal trading strategies in the context of mean-reversion trading, including the use of fixed costs and market impact costs. Continued work in optimal trading rules, incorporating both transaction costs and multi-period optimizations (see, for example Boyd et al and Garleanu-Pedersen). While stops are known to be value-destroying (see Kaminski-Lo), they can be used to limit losses in practice, especially in the context of mean-reversion strategies, and optimal stop-loss and take-profit levels can be derived from the mean-reversion model (see de Prado & Lipton).
Meanwhile practical trading rules can also incorporate parameter uncertainty, and the possibility of model breakdown. In the next post, we will discuss model breakdown, and how to detect it using statistical tests, as well as how to adapt trading strategies to account for model breakdown.
Allocation with Fixed Costs
Market Impact Costs & Optimal Execution
Multiperiod Trading Strategies
Mean-Reverting Trading Strategies and Stop-Losses / Take-Profits
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.
Trading Mid-Frequency and RV like a Pro (Part 1): Identifying Mean-Reversion with Statistical Tests
Copyright © 2025 Dr. Nick Firoozye; All rights reserved.
A blog about quantitative finance, machine learning, and algorithmic trading, with naive forays into philosophy, science and programming.
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.
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!