cvx_ccv_stat_arb
cvx_ccv_stat_arb
Abstract We propose a new method for finding statistical arbitrages that can contain more assets than
just the traditional pair. We formulate the problem as seeking a portfolio with the highest volatility,
subject to its price remaining in a band and a leverage limit. This optimization problem is not convex,
but can be approximately solved using the convex-concave procedure, a specific sequential convex pro-
gramming method. We show how the method generalizes to finding moving-band statistical arbitrages,
where the price band midpoint varies over time.
Keywords Statistical arbitrage · moving-band · convex optimization · convex-concave procedure
1 Introduction
We consider the problem of finding a statistical arbitrage (stat-arb), i.e., a portfolio with mean-reverting
price. Roughly speaking, this means that the price of the portfolio stays in a band, and varies over it.
Such a stat-arb is traded in the obvious way, buying when the price is in the low part of the band and
selling when it is in the high part of the band. In financial markets, price movements are often perceived
as largely unpredictable. However, quantitative strategies, such as stat-arb trading, challenge this view
by exploiting subtle and often transient relationships between asset prices. Traditional stat-arbs focus on
portfolios consisting of two or possibly three underlying assets. When the portfolio contains two assets,
trading the stat-arb is called pairs trading. The assets in a pair are called co-moving assets. Pairs trading
involves identifying pairs of assets that have historically exhibited co-integrated price movements. When
the prices of these assets deviate from their typical relation, traders can position themselves to profit
from the expectation that the prices will revert to their historical relationship. This underlying principle
of mean reversion assumes that asset prices will fluctuate within a defined range over time, eventually
returning to equilibrium after periods of divergence. Pairs trading and similar strategies provide market
participants with a systematic and data-driven approach to profiting from inefficiencies, thereby playing
a crucial role in contemporary quantitative trading frameworks. Pairs can be found by exhaustive search
over all n(n − 1)/2 pairs of assets in a universe of n assets. When the weights of the two assets in pairs
trading are +1 and −1, the portfolio value is the spread (between the two prices).
In this paper we propose a new method for finding stat-arbs that can contain multiple (more than
two) assets, with general weights. The problem is formulated as a nonconvex optimization problem in
which we maximize the portfolio price variation subject to the price staying within a fixed band, along
Kasper Johansson B
Stanford University
E-mail: [email protected]
Thomas Schmelzer
Abu Dhabi Investment Authority
E-mail: [email protected]
Stephen Boyd
Stanford University
E-mail: [email protected]
with a leverage limit, over some training period. Although this approach requires maximizing a convex
function, we show how to approximately solve it using the convex-concave procedure (Shen et al., 2016;
Lipp and Boyd, 2016).
Our second contribution is to introduce the concept of a moving-band stat-arb. In this approach, the
price of the portfolio varies in a band that changes over time, centered at the recent average portfolio
price. (We refer to a traditional stat-arb as a fixed-band stat-arb.) We show that the same method we use
to find fixed-band stat-arbs can be used to find moving-band stat-arbs, despite the apparent complexity
of the average price also depending on the portfolio. Moving-band stat-arbs are traded in the same
obvious way as fix-band stat-arbs, buying when the price is in the low part of the band and selling
when it is in the high part of the band; but with moving-band stat-arbs, the center of the band changes
over time. Moving-band stat-arb trading resembles trading using Bollinger bands (Bollinger, 2002, 1992),
except that the bands are associated with the price of a carefully constructed portfolio, and not a single
asset. Our empirical studies show that moving-band stat-arbs out-perform fixed-band stat-arbs in terms
of profit, and remain profitable for longer out-of-sample periods.
Stat-arbs. Stat-arb trading strategies date back to the 1980s when a group of Morgan Stanley traders,
led by Nunzio Tartaglia, developed pairs trading (Pole, 2011; Gatev et al., 2006). This strategy involves
identifying pairs of assets whose price tends to move together, hence referred to as pairs trading. In
pairs trading, the spread, i.e., price difference between two assets, is tracked and positions entered when
this difference deviates from its mean. This trading strategy has enjoyed widespread popularity, with
its success substantiated by numerous empirical studies in various markets like equities (Avellaneda and
Lee, 2010), commodities (Nakajima, 2019; Vaitonis and Masteika, 2017), and currencies (Fischer et al.,
2019); see, e.g., (Gatev et al., 2006; Avellaneda and Lee, 2010; Perlin, 2009; Hogan et al., 2004; Krauss
et al., 2017; Caldeira and Moura, 2013; Huck, 2019; Dunis et al., 2010).
In the general setting, a stat-arb consists of multiple assets in a portfolio that exhibits a mean-reverting
behavior (Feng and Palomar, 2016, §10.5). Stat-arb trading is a widely used strategy in quantitative
finance. The literature on stat-arbs is extensive and generally splits into several categories: finding stat-
arbs, modeling the (mean-reverting) portfolio price, and trading stat-arbs. We give a brief review of these
here and refer the reader to (Krauss, 2017) for a comprehensive overview of the literature.
Finding stat-arbs. Probably the simplest approach to finding pairs of co-moving securities is the distance
approach. The distance pairs trading strategy finds assets whose (normalized) prices have moved closely
historically, in an exhaustive search through pairs of assets (Gatev et al., 2006). Assets whose prices
have a low sum of squared deviation from each other are considered for trading. The distance approach
is simple and intuitive, although it does not necessarily find good pairs (Krauss, 2017). The objective
itself is to minimize the distance between two asset prices, which does not directly relate to the desired
properties of a stat-arb, which crucially should also have a high variance. This paper addresses this issue
by directly optimizing for large fluctuations around the mean.
The co-integration approach is another popular method for finding co-moving securities. Co-integration
is an important concept in the econometrics literature (Johansen, 2000; Alexander and Dimitriu, 2005),
and dates back to Engle and Granger’s works in the 1980s (for which Granger was awarded the 2003
Nobel Memorial Prize in Economic Sciences) (Granger, 1983; Engle and Granger, 1987). The idea is that
the absence of stationarity in a multivariate time series may be explained by common trends, which would
make it possible to find linear combinations of assets that are stationary and hence mean-reverting. Thus,
the co-integration approach is based on identifying linear combinations of assets that result in a station-
ary time series (Krauss, 2017). In (Vidyamurthy, 2004), the most cited work on co-integration based
pairs trading, potential asset pairs are found based on statistical measures, which are then tested for
co-integration using an adapted version of the Engle-Granger test. Several co-integration based methods
have been proposed to extend the pairs trading strategy to more than two assets. For example, in (Zhao
and Palomar, 2018; Zhao et al., 2018, 2019) the authors consider a (non-convex) optimization problem
for finding high variance, mean-reverting portfolios. Their strategy is based on finding a portfolio of
spreads, defined by a co-integration subspace, and implemented using sequential convex optimization.
Their proposed optimization problem, i.e., maximizing variance subject to a mean-reversion criterion is
2
similar to our problem formulation. However, our problem differs significantly in that we do not rely on
any co-integration analysis or statistical testing. Rather, we directly optimize for a high variance portfolio
that is mean-reverting.
Asset pairs can also be found using machine learning methods. In (Sarmento and Horta, 2020), the
authors use unsupervised learning and propose a density-based clustering algorithms to cluster assets.
Then, within asset clusters, pairs of assets are chosen for trading depending on co-integration, as well as
mean-reversion tendency and frequency. Modern machine learning methods are also explored in (Krauss
et al., 2017), where the authors propose the use of deep neural networks, gradient-boosted trees, and
random forests for finding stat-arb portfolios. Another recent study of deep-learning stat-arb finding
is (Guijarro-Ordonez et al., 2021). Earlier work on using machine learning for finding stat-arbs includes,
e.g., (Dixon et al., 2015; Moritz and Zimmermann, 2014; Takeuchi and Lee, 2013; Huck, 2010, 2009).
Modeling the stat-arb spread. When a co-moving set of assets has been identified, the next step is to
model the portfolio price (or spread between the assets for a pair). Perhaps the most popular approach
is to model the spread using stochastic control theory. It is common to consider investments in a mean-
reverting spread and a risk-free asset and to model the spread as an Ornstein-Uhlenbeck process (Mud-
chanatongsuk et al., 2008; Jurek and Yang, 2007). Other methods include those borrowing tools from
time series analysis (Krauss, 2017). In (Elliott et al., 2005) the authors propose a mean-reverting Gaus-
sian Markov chain model for modeling the spread between two assets. Copulas have also been proposed
to model the joint distribution of the spread, both for pairs and for larger sets of assets (De Moura et al.,
2016; Stübinger et al., 2018; Krauss and Stübinger, 2017). In (De Moura et al., 2016) the authors suggest
modeling the spread using linear state space models.
Trading stat-arbs. We mention here a number of stat-arb trading methods, ranging from simple ones
based on the intuitive idea of buying when the price is low and selling when it is high, to more complex
ones based on learning the price statistics and using stochastic control. One simple method is based on
hysteresis, as used in a conventional thermostat. In this approach we buy (enter into a long position)
when the price drops below a threshold, and sell (switch to a short position) when the price goes above
another threshold. The thresholds are typically based on price bands, as discussed below. A variation
on this method sets the thresholds based on the standard deviation of the price, as proposed in (Gatev
et al., 2006). Another simple method is linear trading, where we take a position proportional to the
difference between the band midpoint price and the current price. This method can also be modified to
use volatility-based bands instead of fixed bands. (Such a trading policy is a simple Markowitz policy,
with the mean return given by the difference between the midpoint price and the current price.)
Other methods for trading stat-arbs follow directly from the spread models described above. When
the spread is modeled as an Ornstein-Uhlenbeck process, the optimal trading strategy is found by solving
a stochastic control problem (Mudchanatongsuk et al., 2008; Jurek and Yang, 2007; Bertram, 2010). In
(Yamada and Primbs, 2012; Primbs and Yamada, 2018; Yamada and Primbs, 2018) the authors model
the spread as an autoregressive process, a discretization of the Ornstein-Uhlenbeck process, and show
how to trade a portfolio of spreads under proportional transaction costs and gross exposure constraints
using model predictive control. With the copula approaches of (De Moura et al., 2016; Stübinger et al.,
2018; Krauss and Stübinger, 2017), the trading strategy is based on deviations from confidence intervals.
The machine learning methods of (Sarmento and Horta, 2020; Krauss et al., 2017; Guijarro-Ordonez
et al., 2021; Dixon et al., 2015; Moritz and Zimmermann, 2014; Takeuchi and Lee, 2013; Huck, 2010,
2009) also include trading strategies.
Exiting a stat-arb. A stat-arb will not keep its mean-reverting behavior forever. Hence, a strategy for
exiting a stat-arb, i.e., closing the position, is needed. One approach is to exit when the spread reaches
a certain threshold in terms of its standard deviation or in terms of a price band, as described below.
Another simple method is to exit after a fixed time-period, as was done in (Gatev et al., 2006).
A simple variation on any of these exit methods does not exit the position immediately when the exit
condition is first satisfied. Instead it reduces the position to zero slowly (e.g., linearly) over some fixed
number of periods.
3
Price-bands. Price-bands are popular in technical analysis, and are used to identify trading opportunities
based on the price of an asset relative to its recent price history (Lee et al., 2021). The most popular is
the Bollinger band (Bollinger, 1992). It is constructed by computing the M -day moving average (with
common choice M = 21) of the asset price, denoted µt at time t, and the corresponding price standard
deviation σt . The Bollinger band is then defined as the interval [µt − kσt , µt + kσt ], where k > 0 is a
parameter, typically taken to be k = 2. A price signal is extracted based on if the price is near the top or
bottom of the band. For a detailed description of the Bollinger band and other trading-bands, we refer
the reader to (Bollinger, 2002, 1992).
This paper proposes a new method for finding stat-arbs, with two main contributions. The first contri-
bution of our method is to formulate the search for stat-arbs as an optimization problem that intuitively
and directly relates to the desired properties of a stat-arb: its price should remain in a band (i.e., be
mean-reverting) and also should have a high variance. Since our method is based on convex optimization,
it readily scales to large universes of assets. It can and does find stat-arbs with ten or more assets, well
beyond our ability to carry out an exhaustive search.
Our second contribution is to introduce the concept of a moving-band stat-arb. While the idea of a
price band is widely known and used in technical analysis trading, the main difference is that we apply
it to carefully constructed portfolios (i.e., stat-arbs), instead of single assets.
Our focus is on finding both fixed-band and moving-band stat-arbs, and not on trading them. Our
numerical experiments use a simple linear trading policy, and a simple time-based exit condition. (We
have also verified that similar results are obtained using hysteris-based trading policies.) We also do not
address the question of how one might trade a portfolio of stat-arbs, the focus of a forth-coming paper.
1.3 Outline
The rest of the paper is organized as follows. In §2 we propose a new method for finding traditional stat-
arbs, i.e., with a fixed band. We extend this method to moving bands in §3. In §4 we present experiments
on real data, and in §5 we conclude the paper.
We formulate the search for a stat-arb s as an optimization problem. The condition that pt varies over a
band is formulated as −1 ≤ pt − µ ≤ 1, where µ is the midpoint of the band. Here we fix the width of the
price band as 2; s and µ can always be scaled so this holds. We express the desire that pt vary frequently
over the band by maximizing its volatility. Since s, p, and µ can all be multiplied by −1 without any
effect on the constraints or objective, we can assume that µ ≥ 0 without loss of generality.
4
We arrive at the problem
PT 2
maximize t=2 (pt − pt−1 )
subject to −1 ≤ pt − µ ≤ 1, pt = sT Pt , t = 1, . . . , T (1)
|s|T P̄ ≤ L, µ ≥ 0,
with variables s ∈ Rn , p ∈ RT , and µ ∈ R, where the absolute value in the last constraint is elementwise.
The problem data are the vector price time series Pt , t = 1, . . . , T , and the positive parameter L.
Note that |s|T P̄ is the average total position of the portfolio, sometimes called its leverage, so the
constraint |s|T P̄ ≤ L is a leverage constraint; it limits the total position of the portfolio. The leverage
is a weighted ℓ1 norm of s, and so tends to lead to sparse s, i.e., a portfolio that concentrates in a few
assets, a typical desired quality of a stat-arb. The problem (1) is a nonconvex optimization problem,
since the objective is a convex function, and we wish to maximize it; we will explain below how we can
approximately solve it.
While our formulation of the stat-arb optimization problem (1) makes sense on its own, we can further
motivate it by looking at the profit obtained using a simple trading policy. Suppose we hold quantity
qt ∈ R of the portfolio, i.e., we hold the portfolio qt s ∈ Rn (in shares). We assume that q0 = qT = 0,
i.e., we start and end with no holdings. In period t we buy qt − qt−1 and pay pt (qt − qt−1 ). The total
profit is then
T
X −1
qt (pt+1 − pt ). (2)
t=1
We will relate this to our objective in (1) above, with the simple trading policy
qt = µ − pt , t = 1, . . . , T − 1, (3)
which we refer to as a linear trading policy since the holdings are a linear function of the difference
between the band midpoint and the current price. This trading policy holds nothing when pt = µ, i.e.,
the price is in the middle of the band. When the price is low, pt = µ − 1, we hold qt = +1, and when it
is high, pt = µ + 1 we hold qt = −1.
With the simple linear policy (3) and the boundary conditions q0 = qT = 0, the profit (2) is, after
some algebra,
T
1X (p1 − µ)2 − (pT − µ)2
(pt − pt−1 )2 + .
2 t=2 2
The first term is one half our objective. The second term is between −1/2 and 1/2, since (pT − µ)2 and
(p1 − µ)2 are both between 0 and 1. Thus the profit is at least
T
!
1 X
(pt − pt−1 )2 − 1 . (4)
2 t=2
This shows that our objective is the profit of the simple linear policy (3), scaled by one-half, plus a
constant. In particular, if the objective of the problem (1) exceeds one, the simple linear policy makes a
profit.
Convex-concave procedure. We solve the problem (1) approximately using sequential convex program-
ming, specifically the convex-concave procedure (Shen et al., 2016; Lipp and Boyd, 2016). Let k de-
note the iteration, with sk the portfolio and pkt the portfolio price in the kth iteration. In each it-
eration P
of the convex-concave procedure, we linearize the objective, replacing the quadratic function
T
f (p) = t=2 (pt − pt−1 )2 with the affine approximation
5
where c is a constant (i.e., does not depend on p). This linearization is a lower bound on the true
objective, i.e., we have f (p) ≥ fˆ(p; pk ) for all p. For completeness we note that
2(p1 − p2 )
t=1
(∇f (p))t = 2(2pt − pt−1 − pt+1 ) t = 2, . . . , T − 1
2(pT − pT −1 ) t = T.
Cleanup phase. The leverage constraint |s|T P̄ ≤ L encourages sparse solutions, but in some cases the
convex-concave procedure converges to a portfolio with a few small holdings. To achieve even sparser
portfolios, we can carry out a clean-up step once the convex-concave procedure has converged. We first
determine the subset of assets for which si is zero or small, as measured by its relative weight in the
portfolio, i.e., i for which
|si |P̄i ≤ η|s|T P̄ ,
where η is a small positive constant such as 0.05. We then solve the problem again, this time with the
constraint that all such si are zero. This takes just a few convex-concave iterations, and can be repeated,
which results in sparse portfolios in which every asset has weight at least η.
Implementation. To make the optimization problem better conditioned, we scale the prices Pt so that
(after scaling) P̄ = 1, the vector with all entries one. Thus after scaling, the leverage |s|T P̄ becomes
the ℓ1 norm of s. We also scale the gradient (or objective) to be on the order of magnitude one. These
scalings do not affect the solution, but make the method less vulnerable to floating point rounding errors.
Initialization. The final portfolio found by the convex-concave procedure, plus the cleanup phase, depends
on the initial portfolio s1 . It can and does converge to different final portfolios for different starting
portfolios. With a random initialization we can find multiple stat-arbs for the same universe. (We also get
some duplicates when the method converges to the same final portfolio from different initial portfolios.)
We have found that uniform initialization of the entries of s1 in the interval [0, 1] works well in practice.
Thus, from one universe and data set, we can obtain multiple stat-arbs.
In the fixed-band stat-arb problem (1) µ is constant, so the midpoint of the trading band does not
vary with time. In this section we describe a simple but powerful extension in which the stat-arb band
midpoint changes over time. One simple (and traditional) choice is to define µt as the mean of the trailing
prices pt , for example the mean over the last M periods,
t
1 X
µt = pτ .
M
τ =t−M +1
(This requires knowledge of the prices P0 , P−1 , . . . , P−M +1 .) In this formulation, µt is also a function of
s, the portfolio, but it is a known linear function of it. Any other linear expression for the average recent
price could be used, e.g., exponentially weighted moving average (EWMA). A moving-band stat-arb is
a portfolio s in which the price pt stays in a moving band with width two and midpoint µt , and also has
high variance.
6
Trading policy. The simple linear trading policy (3) can be modified in the obvious way, as
qt = µt − pt , t = 1, . . . , T − 1. (6)
with variables s ∈ Rn , p1 , . . . , pT , and µ1 , . . . , µT . (The latter two sets of variables are simple linear
functions of s.) In this problem we have an additional parameter M , the memory for the band midpoint.
Note that in the fixed-band stat-arb problem (1), µ is a scalar variable that we freely choose; in
the moving-band stat-arb problem (7), µt varies over time, and is itself a function of s. Despite this
complication, the moving-band stat-arb problem (7) can be approximately solved using exactly the same
convex-concave method as the fixed-band stat-arb problem (1); the only difference is in the convex
constraints.
4 Numerical experiments
We illustrate our method with an empirical study on historical asset prices. Everything needed to repro-
duce the results is available online at
https://github.com/cvxgrp/cvxstatarb.
Data set. We use daily data of the CRSP US Stock Databases from the Wharton Research Data Services
(WRDS) portal (WRDS, 2023). The data set consists of adjusted prices of 15405 assets from January
4th, 2010, to December 30th, 2023, for a total of 3282 trading days.
Monthly search for stat-arbs. Starting December 23, 2011, and every 21 trading days thereafter, until
July 6th, 2022, we use the convex-concave method with 10 different random initial portfolios. From these
10 stat-arbs we add the unique ones, defined by the set of assets in the stat-arb, to our current set of
stat-arbs. All together we solve fixed-band and moving-band problems 1270 times.
Parameters. We set L = $50 for the fixed-band stat-arb and L = $100 for the moving-band stat-arb.
For the moving-band stat-arb, we take M = 21 days, i.e., we use the trailing month average price as the
midpoint, a value commonly used for Bollinger bands (Bollinger, 1992, 2002). We note that our results
are not very sensitive to the choices of L and M , and that choosing a larger L for the moving-band than
for the fixed-band stat-arb is reasonable since we expect the price of a portfolio to vary less around its
short-term moving midpoint than around a fixed midpoint.
Trading policy. We use the simple linear trading policies defined in (3) and (6) for the fixed-band and
moving-band stat-arbs, respectively. We use a simple time-based exit condition, where we trade a stat-arb
for T max trading days, and then exit the position uniformly (linearly) over the next T exit trading days.
This means we take
where αt = (t + 1 − T max )/T exit . We use parameter values T max = 63 for the fixed-band stat-arb and
T max = 125 for the moving-band stat-arb, and T exit = 21 for both. We also exit a stat-arb if the value
of the stat-arb plus a cash account drops below a given level, as described below.
7
4.2 Simulation and metrics
Portfolio net asset value. The net asset value (NAV) of the portfolio, including the cash account, at time
t is then
Vt = Ct + qt pt .
(Note that V0 = C0 .) The profit at time t is
Vt − Vt−1 = qt pt + Ct − qt−1 pt−1 − Ct−1 = qt (pt − pt−1 ) − ϕt ,
which agrees with the profit formula (2), after accounting for transaction and holding costs.
NAV based termination. If the NAV goes below 25% of C0 , we liquidate the stat-arb portfolio. We do
this for two reasons. First, we do not want the portfolio to have negative value, i.e., to go bust. Second,
this constraint ensures that the short positions are always fully collateralized by the long positions plus
the cash account, with a margin of at least half of our initial investment. All of our metrics include early
termination stat-arbs.
Trading and shorting costs. Our numerical experiments take into account transaction costs, i.e., we buy
assets at the ask price, which is the (midpoint) price plus one-half the bid-ask spread, and we sell assets
at the bid price, which is the price minus one-half the bid-ask spread. Note that while we do not take
into account transaction cost in our simple trading policy, we do in simulation and accounting. We use
0.5% as a proxy for the annual shorting cost of assets, which is well above what is typically observed in
practice for liquid assets (D’avolio, 2002; Geczy et al., 2002; Kim and Lee, 2023; Drechsler and Drechsler,
2014). (We also note that the method is robust against shorting costs; the results are consistent even
when shorting costs exceed 10% per annum.)
where T = T max + T exit is the number of trading days in the evaluation period. The return at time t is
Vt − Vt−1
rt = , t = 1, . . . , T.
Vt−1
We report several standard metrics based on the daily returns rt . The average return is
T
1X
r= rt ,
T t=1
8
Fig. 1: Distribution of the number of assets per fixed-band stat-arb.
√
which we multiply by 250 to annualize. The annualized Sharpe ratio is the ratio of the annualized
average return to the annualized risk. Finally, the maximum drawdown is
Vt2
max 1− ,
1≤t1 <t2 ≤T Vt1
Stat-arb statistics. After solving the fixed-band stat-arb problem 1270 times, we found 539 unique stat-
arbs. These stat-arbs contained between 2 and 11 assets, with a median value of 6, as shown in figure 1.
Over time the number of active stat-arbs ranges up to 30, with a median value of 16, as shown in figure 2.
Out of the 539 stat-arbs, 17 (around 3%) were terminated before the end of the evaluation period, due
to the NAV falling below 25% of the initial investment.
9
Profitability
Fraction of profitable stat-arbs 68%
Annualized return
Average 2%
Median 18%
75th percentile 34%
25th percentile -5%
Annualized risk
Average 35%
Median 21%
75th percentile 38%
25th percentile 13%
Annualized Sharpe ratio
Average 0.81
Median 1.01
75th percentile 1.87
25th percentile -0.21
Maximum drawdown
Average 17%
Median 10%
75th percentile 19%
25th percentile 5%
Metrics. Table 1 summarizes metrics related to the profitability of the fixed-band stat-arbs.
Of the 539 stat-arbs, 68% were profitable. The average annualized return is 2%, with an average
annualized risk of 35%, and an average annualized Sharpe ratio of 0.81. The maximum drawdown was
on average 17% over the four-month trading period for each stat-arb.
10
Fig. 3: A fixed-band stat-arb strategy that made money. Top. Price. Bottom. Cumulative profit.
Example stat-arbs. We show the detailed evolution of two stat-arbs, one that made money and one that
lost money, in figures 3 and 4, respectively. These were chosen to have average returns around the 70th
and 25th percentiles of the return distribution across our 539 stat-arbs. As expected both stat-arbs are
very profitable in-sample. The first one continues to be profitable out-of-sample.
The first one, which made money, contained the assets
Amgen
Walgreens
Anadarko Petroleum
Yum! Brands
Energy Transfer LP
Alexion Pharmaceuticals.
11
Fig. 4: A fixed-band stat-arb strategy that lost money. Top. Price. Bottom. Cumulative profit.
Target
Vanguard
Deutsche Bank
The Charles Schwab Corporation
Alexion Pharmaceuticals
The Archer-Daniels-Midland Company
12
Fig. 5: Distribution of the number of assets per moving-band stat-arb.
Stat-arb statistics. We found 711 unique moving-band stat-arbs (compared with 539 fixed-band stat-
arbs). These stat-arbs contained between 1 and 11 assets, with a median value of 5. The full distribution
is shown in figure 5. The number of active moving-band stat-arbs over time is shown in figure 6. The
median number of active stat-arbs is 40. This is considerably larger than the number of active fixed-band
stat-arbs since we find more of them, and they are active (by our choice) almost twice as long. None out
of the 711 moving-band stat-arbs were terminated before the end of the evaluation period, due to the
NAV falling below 25% of the initial investment.
Metrics. Table 2 summarizes the profitability of the moving-band stat-arbs. A large majority (79%) of
the stat-arbs are profitable. The average annualized return was 16%, with an average annualized risk of
20%, and an average annualized Sharpe ratio of 0.84. The maximum drawdown was on average 12% over
the seven-month trading period for each stat-arb.
13
Profitability
Fraction of profitable stat-arbs 79%
Annualized return
Average 16%
Median 12%
75th percentile 24%
25th percentile 3%
Annualized risk
Average 20%
Median 15%
75th percentile 25%
25th percentile 9%
Annualized Sharpe
Average 0.84
Median 0.87
75th percentile 1.51
25th percentile 0.21
Maximum drawdown
Average 12%
Median 9%
75th percentile 15%
25th percentile 5%
Comparison with fixed-band stat-arbs. Our first observation is that far fewer of the moving-band stat-arbs
were terminated early due to low NAV than the fixed-band stat-arbs, despite their running for a period
almost twice as long. Comparing tables 1 and 2 we see that the metrics for fixed-band stat-arbs are more
variable, with a larger range in each of the metrics. The moving-band stat-arbs are more profitable than
the fixed-band stat-arbs, but the difference is not large.
Example stat-arbs. Two stat-arbs, picked to represent roughly the 70th and 15th percentiles of the return
distribution across the 711 stat-arbs, are illustrated in figures 7 and 8, respectively. Again, both stat-arbs
are profitable in-sample, and the first one continues to be profitable out-of-sample.
The first one, which made money, contained the assets
Morgan Stanley
Monsanto
Walgreens
Accenture Plc
ArcelorMittal
Pioneer Natural Resources
The second one, which lost money, contained the assets
Lockheed Martin
ServiceNow
Gilead Sciences
NXP Semiconductors
14
Fig. 7: A moving-band stat-arb strategy that made money. Top. Price. Middle. Price relative to the trailing mean. Bottom.
Cumulative profit.
15
Fig. 8: A moving-band stat-arb strategy that lost money. Top. Price. Middle. Price relative to the trailing mean. Bottom.
Cumulative profit.
16
5 Conclusions and comments
We have formulated the problem of finding stat-arbs as a nonconvex optimization problem which can be
approximately solved using the convex-concave procedure. We have introduced moving-band stat-arbs,
which combine ideas from statistical arbitrage and price band trading.
Our empirical study on historical data shows that moving-band stat-arbs perform better than fixed-
band stat-arbs, and remain profitable for longer out-of-sample periods. Our empirical study uses very
simple trading and exit policies; we imagine that with more sophisticated ones such as those cited above,
the results would be even better. Our focus in this paper is on finding stat-arbs, and not on trading
them.
Variations and extensions. We mention here several ideas that we tried out, but were surprised to find
did not improve the empirical results.
– Asset screening. We construct stat-arbs using assets only within an industry or sector.
– Validation. We split past asset prices into a training and a test set. We find candidate stat-arbs using
the training data and then test them on the test data. We then only trade those with good test
performance.
– Incorporating transaction costs in the trading policy. We modify the linear policy to take into account
transaction costs. (Our simulations take trading cost into account, but our simple linear trading
policy does not.)
– Hysteresis-based trading. We use a hysteresis-based trading policy, which can help reduce transaction
costs compared to the linear policy.
Trading a portfolio of stat-arbs. We have focussed on finding individual stat-arbs. A next obvious topic
is how to trade a portfolio of stat-arbs. This will be addressed in an upcoming paper by the authors. We
simply note here that the results presented in this paper are all for single stat-arbs, and so fall somewhere
in between individual assets and a full portfolio.
Not applicable.
Not applicable.
Funding
Stephen Boyd was partially funded by the Office of Naval Research and ACCESS – AI Chip Center for
Emerging Smart Systems. Kasper Johansson was partially funded by the Sweden America Foundation.
The data and code used in this paper are available from the Wharton Research Data Services (WRDS)
portal (WRDS, 2023). The code used to generate the results is available at https://github.com/
cvxgrp/cvxstatarb.
Competing interests
17
Authors’ contributions
The manuscript was mainly written and edited by K.J. and S.B. The technical implementations, such
as coding algorithms and setting up reproducible environments were done by K.J. and T.S. All authors
read and approved the final manuscript.
Acknowledgments
The idea of using the convex-concave procedure to find fixed-band stat-arbs is from initial unpublished
work by Stephen Boyd and Jonathan Tuck. We thank Ron Kahn and Mark Mueller for detailed reviews
of the paper and many helpful comments and suggestions. We gratefully acknowledge support from the
Office of Naval Research. This work was partially supported by ACCESS – AI Chip Center for Emerging
Smart Systems. Kasper Johansson was partially funded by the Sweden America Foundation.
References
Alexander, C. and Dimitriu, A. (2005). Indexing and statistical arbitrage. The Journal of Portfolio
Management, 31(2):50–63.
Avellaneda, M. and Lee, J. (2010). Statistical arbitrage in the US equities market. Quantitative Finance,
10(7):761–782.
Bertram, W. (2010). Analytic solutions for optimal statistical arbitrage trading. Physica A: Statistical
mechanics and its applications, 389(11):2234–2243.
Bollinger, J. (1992). Using Bollinger bands. Stocks & Commodities, 10(2):47–51.
Bollinger, J. (2002). Bollinger on Bollinger bands. McGraw-Hill New York.
Boyd, S. and Vandenberghe, L. (2004). Convex optimization. Cambridge university press.
Caldeira, J. and Moura, G. (2013). Selection of a portfolio of pairs based on co-integration: A statistical
arbitrage strategy. Available at SSRN 2196391.
D’avolio, G. (2002). The market for borrowing stock. Journal of financial economics, 66(2-3):271–306.
De Moura, C. E., Pizzinga, A., and Zubelli, J. (2016). A pairs trading strategy based on linear state
space models and the Kalman filter. Quantitative Finance, 16(10):1559–1573.
Dixon, M., Klabjan, D., and Bang, J. (2015). Implementing deep neural networks for financial market
prediction on the Intel Xeon Phi. In Proceedings of the 8th Workshop on High Performance Compu-
tational Finance, New York, NY, USA. Association for Computing Machinery.
Drechsler, I. and Drechsler, Q. (2014). The shorting premium and asset pricing anomalies. Technical
report, National Bureau of Economic Research.
Dunis, C., Giorgioni, G., Laws, J., and Rudy, J. (2010). Statistical arbitrage and high-frequency data
with an application to Eurostoxx 50 equities. Liverpool Business School.
Elliott, R., Van Der Hoek, J., and Malcolm, W. (2005). Pairs trading. Quantitative Finance, 5(3):271–
276.
Engle, R. and Granger, C. (1987). Co-integration and error correction: Representation, estimation, and
testing. Econometrica, 55(2):251–276.
Feng, Y. and Palomar, D. (2016). A signal processing perspective on financial engineering. Foundations
and Trends® in Signal Processing, 9(1–2):1–231.
Fischer, T., Krauss, C., and Deinert, A. (2019). Statistical arbitrage in cryptocurrency markets. Journal
of Risk and Financial Management, 12(1):31.
Gatev, E., Goetzmann, W., and Rouwenhorst, G. (2006). Pairs trading: Performance of a relative-value
arbitrage rule. The Review of Financial Studies, 19(3):797–827.
Geczy, C., Musto, D., and Reed, A. (2002). Stocks are special too: An analysis of the equity lending
market. Journal of Financial Economics, 66(2-3):241–269.
Granger, C. (1983). Co-integrated variables and error-correcting models. PhD thesis, Discussion Paper
83-13. Department of Economics, University of California.
Guijarro-Ordonez, J., Pelger, M., and Zanotti, G. (2021). Deep learning statistical arbitrage. arXiv
preprint arXiv:2106.04028.
18
Hogan, S., Jarrow, R., Teo, M., and Warachka, M. (2004). Testing market efficiency using statisti-
cal arbitrage with applications to momentum and value strategies. Journal of Financial economics,
73(3):525–565.
Huck, N. (2009). Pairs selection and outranking: An application to the S&P 100 index. European Journal
of Operational Research, 196(2):819–825.
Huck, N. (2010). Pairs trading and outranking: The multi-step-ahead forecasting case. European Journal
of Operational Research, 207(3):1702–1716.
Huck, N. (2019). Large data sets and machine learning: Applications to statistical arbitrage. European
Journal of Operational Research, 278(1):330–342.
Johansen, S. (2000). Modelling of co-integration in the vector autoregressive model. Economic Modelling,
17(3):359–373.
Jurek, J. and Yang, H. (2007). Dynamic portfolio selection in arbitrage. In EFA 2006 Meetings Paper.
Kim, D. and Lee, B. (2023). Shorting costs and profitability of long–short strategies. Accounting &
Finance, 63(1):277–316.
Krauss, C. (2017). Statistical arbitrage pairs trading strategies: Review and outlook. Journal of Economic
Surveys, 31(2):513–545.
Krauss, C., Do, X., and Huck, N. (2017). Deep neural networks, gradient-boosted trees, random forests:
Statistical arbitrage on the S&P 500. European Journal of Operational Research, 259(2):689–702.
Krauss, C. and Stübinger, J. (2017). Non-linear dependence modelling with bivariate copulas: Statistical
arbitrage pairs trading on the S&P 100. Applied Economics, 49(52):5352–5369.
Lee, J., Lee, J., and Prékopa, A. (2021). Price-bands: A technical tool for stock trading. Fintech with
Artificial Intelligence, Big Data, and Blockchain, pages 221–246.
Lipp, T. and Boyd, S. (2016). Variations and extension of the convex–concave procedure. Optimization
and Engineering, 17:263–287.
Moritz, B. and Zimmermann, T. (2014). Deep conditional portfolio sorts: The relation between past and
future stock returns. LMU Munich and Harvard University Working paper.
Mudchanatongsuk, S., Primbs, J., and Wong, W. (2008). Optimal pairs trading: A stochastic control
approach. In 2008 American control conference, pages 1035–1039. IEEE.
Nakajima, T. (2019). Expectations for statistical arbitrage in energy futures markets. Journal of Risk
and Financial Management, 12(1):14.
Perlin, M. (2009). Evaluation of pairs-trading strategy at the Brazilian financial market. Journal of
Derivatives & Hedge Funds, 15:122–136.
Pole, A. (2011). Statistical arbitrage: algorithmic trading insights and techniques. John Wiley & Sons.
Primbs, J. and Yamada, Y. (2018). Pairs trading under transaction costs using model predictive control.
Quantitative Finance, 18(6):885–895.
Sarmento, S. and Horta, N. (2020). A Machine Learning Based Pairs Trading Investment Strategy.
Springer.
Shen, X., Diamond, S., Gu, Y., and Boyd, S. (2016). Disciplined convex-concave programming. In 2016
IEEE 55th Conference on Decision and Control (CDC), pages 1009–1014. IEEE.
Stübinger, J., Mangold, B., and Krauss, C. (2018). Statistical arbitrage with vine copulas. Quantitative
Finance, 18(11):1831–1849.
Takeuchi, L. and Lee, Y. (2013). Applying deep learning to enhance momentum trading strategies in
stocks. In Technical Report. Stanford University Stanford, CA, USA.
Vaitonis, M. and Masteika, S. (2017). Statistical arbitrage trading strategy in commodity futures market
with the use of nanoseconds historical data. In Information and Software Technologies, pages 303–313,
Cham. Springer International Publishing.
Vidyamurthy, G. (2004). Pairs Trading: quantitative methods and analysis, volume 217. John Wiley &
Sons.
WRDS (2023). Wharton research data services. https://wrds-web.wharton.upenn.edu/wrds/.
Yamada, Y. and Primbs, J. (2012). Model predictive control for optimal portfolios with co-integrated
pairs of stocks. In 2012 IEEE 51st IEEE Conference on Decision and Control (CDC), pages 5705–5710.
IEEE.
Yamada, Y. and Primbs, J. (2018). Model predictive control for optimal pairs trading portfolio with
gross exposure and transaction cost constraints. Asia-Pacific Financial Markets, 25:1–21.
Zhao, Z. and Palomar, D. (2018). Mean-reverting portfolio with budget constraint. IEEE Transactions
on Signal Processing, 66(9):2342–2357.
19
Zhao, Z., Zhou, R., and Palomar, D. (2019). Optimal mean-reverting portfolio with leverage constraint
for statistical arbitrage in finance. IEEE Transactions on Signal Processing, 67(7):1681–1695.
Zhao, Z., Zhou, R., Wang, Z., and Palomar, D. (2018). Optimal portfolio design for statistical arbitrage
in finance. In 2018 IEEE Statistical Signal Processing Workshop (SSP), pages 801–805. IEEE.
20