+ All Categories
Home > Documents > dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James...

dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James...

Date post: 25-Aug-2018
Category:
Upload: hakien
View: 214 times
Download: 0 times
Share this document with a friend
33
Dynamic Spread Trading Seung-Jean Kim James Primbs Stephen Boyd June 2008 Abstract This paper is concerned with a dynamic trading strategy, which involves multiple synthetic spreads each of which involves long positions in a basket of underlying se- curities and short positions in another basket. We assume that the spreads can be modeled as mean-reverting Ornstein-Uhlenbeck (OU) processes. The dynamic trading strategy is implemented as the solution to a stochastic optimal control problem that dynamically allocates capital over the spreads and a risk-free asset over a finite horizon to maximize a general constant relative risk aversion (CRRA) or constant absolute risk aversion (CARA) utility function of the terminal wealth. We show that this stochastic control problem is computationally tractable. Specifically, we show that the coefficient functions defining the optimal feedback law are the solutions of a system of ordinary differential equations (ODEs) that are the essence of the tractability of the stochastic optimal control problem. We illustrate the dynamic trading strategy with four pairs that consist of seven S&P 500 index stocks, which shows that the performance achieved by the dynamic spread trading strategy is significant and robust to realistic transaction costs. Key words: convergence trading, dynamic trading, mean reversion, pairs trading, statistical arbitrage, stochastic optimal control. 1 Introduction We consider an investment setting in which there are and n continuously traded risky secu- rities, whose prices are collected in the price vector P (t) R n , and a risk-free asset (i.e.,a money market account paying a fixed rate of interest). We are interested in the situation in which certain linear combinations S i (t)=Φ T i P (t), i =1,...,m, (1) * Information Systems Laboratory, Electrical Engineering Department, Stanford University, Stanford, CA 94305-9510 USA. Email: {sjkim,boyd}@stanford.edu Management Science and Engineering, Stanford University, Stanford, CA 94305-4026 USA. Email: [email protected] 1
Transcript
Page 1: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

Dynamic Spread Trading

Seung-Jean Kim∗ James Primbs† Stephen Boyd∗

June 2008

Abstract

This paper is concerned with a dynamic trading strategy, which involves multiplesynthetic spreads each of which involves long positions in a basket of underlying se-curities and short positions in another basket. We assume that the spreads can bemodeled as mean-reverting Ornstein-Uhlenbeck (OU) processes. The dynamic tradingstrategy is implemented as the solution to a stochastic optimal control problem thatdynamically allocates capital over the spreads and a risk-free asset over a finite horizonto maximize a general constant relative risk aversion (CRRA) or constant absolute riskaversion (CARA) utility function of the terminal wealth. We show that this stochasticcontrol problem is computationally tractable. Specifically, we show that the coefficientfunctions defining the optimal feedback law are the solutions of a system of ordinarydifferential equations (ODEs) that are the essence of the tractability of the stochasticoptimal control problem. We illustrate the dynamic trading strategy with four pairsthat consist of seven S&P 500 index stocks, which shows that the performance achievedby the dynamic spread trading strategy is significant and robust to realistic transactioncosts.

Key words: convergence trading, dynamic trading, mean reversion, pairs trading,statistical arbitrage, stochastic optimal control.

1 Introduction

We consider an investment setting in which there are and n continuously traded risky secu-rities, whose prices are collected in the price vector P (t) ∈ R

n, and a risk-free asset (i.e., amoney market account paying a fixed rate of interest). We are interested in the situation inwhich certain linear combinations

Si(t) = ΦTi P (t), i = 1, . . . , m, (1)

∗Information Systems Laboratory, Electrical Engineering Department, Stanford University, Stanford, CA94305-9510 USA. Email: {sjkim,boyd}@stanford.edu

†Management Science and Engineering, Stanford University, Stanford, CA 94305-4026 USA. Email:[email protected]

1

Page 2: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

with Φi ∈ Rn, are mean reverting such that Si can be well modeled as OU processes. Here, Si

can be simply the difference between the prices of two securities, i.e., their spread. Moregenerally, Si can be a (synthetic) spread, i.e., the spread between the values of two basketsof the underlying securities.

In the standard dynamic portfolio optimization setting, we model the prices of the under-lying risky securities as stochastic processes (e.g., geometric Brownian motion) and formulatethe optimal investment problem as a stochastic control problem that allocates capital directlyover the risk-free and risk assets to maximize an expected utility function. In this paper,we are interested in the stochastic optimal control problem of dynamically allocating capitalover the risk-free asset and the multiple spreads, to maximize an expected utility function ofthe terminal wealth, which we call dynamic (synthetic) spread trading. (This strategy indi-rectly determines the inventory levels of the underlying securities through the allocations onthe spreads.) Our main focus is on the optimal trading strategy and not on the estimationof the coefficient vectors Φi that specify the spreads. (The estimation part is related toestimating cointegration vectors in vector autoregressive models and beyond the scope ofthis paper. The reader is referred to Bossaerts (1988) or Johansen (1991) for more on theestimation part.)

We show that this stochastic control problem is computationally tractable for generalCRRA and CARA utility functions. Specifically, we characterize the optimal feedback lawin an affine feedback form and show that the coefficient functions defining the optimal feed-back law are the solutions of a system of ODEs that are the essence of the tractability of thestochastic optimal control problem. Interestingly, as in the standard dynamic portfolio opti-mization setting based on the GBM model, the optimal feedback for CRRA utility functionsis proportional to current wealth, while that for CARA utility functions is independent ofcurrent wealth.

We illustrate the dynamic spread trading strategy for CRRA utility functions, using adiscrete-time approximation that balances the holding of the underlying securities on a dailybasis. We apply this approximation to four pairs that consist of S&P 500 index stocks. Weassume that the fraction of wealth in the money market account can be used as collateral tofinance the long/short positions in the underlying stocks, and compute the (daily) marginrequirement for a broker/dealer, who can employ higher levels of leverage than individualinvestors. The results shows that, while meeting the margin requirement, the dynamictrading strategy can deliver a good performance, which is robust to realistic transactioncosts. The results also show that the return distribution of the dynamic spread tradingstrategy has a very acute peak around the mean, compared with a normally distributedrandom variable, i.e., it is is leptokurtic.

Related literature. The spread trading strategy described above can be viewed as ageneralization of pairs trading, a relative investment or convergence trading strategy thathas been widely used in practice. (It reduces to pairs trading when m = 1 and the singlesynthetic spread is the difference between the prices of two securities.) Once pairs of stocksthat are cointegrated are identified, we can easily turn them into a relative investment

2

Page 3: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

trading strategy: When the spread between their prices deviates significantly from the long-term average, this strategy is to short one security and buy the other, expecting profitwhen the spread converges. (The reader is referred to Vidyamurthy (2004) and Whistler(2004) for more on this strategy.) Gatev et al. (2006) demonstrate the effectiveness androbustness of pairs trading based on a simple thresholding rule, while taking into accountmicrostructure factors such as the bid-ask bounce, shortselling costs, and transaction costs.Mudchanatongsuk et al. (2008) derive the optimal feedback control law when the spread ofthe log-prices of two stocks follows an OU process. Mitchell et al. (2002) study limits ofarbitrage in the context of pairs trading, using a simple thresholding investment decisionrule. Boguslavsky and Boguslavskaya (2004) and Jurek and Yang (2007) derive the optimaltrading strategy for pairs trading. Elliott et al. (2005) propose a mean-reverting GaussianMarkov chain model for the spread observed in Gaussian noise which is used to determineappropriate investment decisions. The prior work does not take into account correlationsamong spreads and deals with only one spread.

The techniques used in this paper to characterize the solution of the stochastic optimalcontrol problem with multiple spreads are quite standard: Guess a parametric form of thevalue function, i.e., the solution to the HJB equation that encodes the optimal feedbacklaw and derive a system of ODEs for the functions involved in the parametrization. Usingthese standard techniques, several researchers have solved a variety of dynamic portfolioselection problems (some of which involve OU processes). Kim and Omberg (1996) derivean analytical solution to the portfolio selection problem with a hyperbolic absolute riskaversion (HARA) utility function utility of the terminal wealth when the risk premiumis governed by an Ornstein-Uhlenbeck process. Herzog et al. (2008) describes an analyticalsolution to a dynamic portfolio optimization selection problem with a CRRA utility functionin which risky assets are modeled with a factor model based on Gaussian stochastic processes,which are used to model the assets time-varying expected returns. Schroder and Skiadas(1999) examine conditions under which dynamic portfolio choice problems reduce to solvinga system of ordinary differential equations. Campbell et al. (2004) derive an approximatesolution to a continuous-time intertemporal portfolio and consumption choice problem, in asetting in which the expected excess return on a risky asset follows an OU process, while theriskless interest rate is constant; the reader is also referred to Campbell and Viceira (2002).

Outline. In the next section, we give the continuous time formulation of the dynamicspread trading problem. In Section 3, we characterize the optimal spread trading strategyfor the CRRA and CARA utility functions. In Section 4, we illustrate the dynamic tradingstrategy with four spreads, while accounting for realistic transaction costs. We give ourconclusions in Section 5.

3

Page 4: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

2 Problem formulation

2.1 The model

The risk-free asset grows at a constant, continuously compounded rate of r > 0:

dB(t) = rB(t)dt.

The m spreads are modeled by a vector process S = (S1, . . . , Sm), where the component Si

is modeled as an Ornstein-Uhlenbeck process (Uhlenbeck and Ornstein 1930)

dSi(t) = κi(Si − Si(t))dt +

m∑

i=1

σijdZj(t),

where Z1, . . . , Zm are independent Wiener processes, Si is the long-term mean of the spreadSi, and κi > 0 is the rate of reversion. We can write the spread dynamics in the compactform

dS(t) = K(S − S(t))dt + σdZ(t) (2)

where Z = (Z1, . . . , Zm) is an m-dimensional vector Wiener process,

σ =

σ11 · · · σ1m...

. . ....

σm1 · · · σmm.

is the diffusion matrix, and K = diag(κ1, . . . , κm) is the diagonal matrix with diagonalentries κi.

We consider a self-financing portfolio (with no exogenous infusion of withdrawal of money)that consists of the m spreads and the risk-free asset. We use hi(t) to denote the number ofunits of spread i held at time t and define h(t) = (h1(t), . . . , hm(t)). We use W (t) to denotethe value of the portfolio held at t or the wealth. We can see that h(t)T S(t) is the total valueof the positions in the spreads (or their underlying securities) and W (t) − h(t)T S(t) is thedollar amount put in the risk-free asset. The wealth of the self-financing portfolio evolvesaccording to

dW (t) = h(t)T dS(t) + [W (t) − h(t)T S(t)]rdt

=[

r(W (t) − h(t)T S(t)) + h(t)T K(S − S(t))]

dt + h(t)T σdZ(t).

2.2 The problem

We assume that there are no transaction costs (short selling costs, bid-ask spreads, priceimpact, and so on). (Later we will include the effects of market frictions in assessing theperformance of the dynamic spread trading strategy we will describe shortly.)

4

Page 5: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

We consider the problem of finding a dynamic trading strategy that maximizes expectedutility at the final time T , E[u(W (T ))], which can be cast as the following stochastic optimalcontrol problem:

maximize E[U(W (T ))]subject to dS(t) = K(S − S(t))dt + σdZ(t),

dW (t) =[

r(W (t) − h(t)T S(t)) + h(t)T K(S − S(t))]

dt + h(t)T σdZ(t),S(0) = (S1(0), . . . , Sm(0)), W (0) = W0,

(3)

where the variable is the stochastic process h adapted to the filtration F(t) associated withthe Wiener processes under consideration and the problem data are K, σ, and S. In thisoptimal control problem, the first and second constraints describe the spread and wealthdynamics respectively, and the last constraints specify the initial wealth of our portfolio andspreads. Under suitable conditions on trading strategies, the existence and uniqueness ofsolution follow from standard results in stochastic control theory.

3 Dynamic trading with multiple spreads

In this section, we will derive the optimal trading strategies for two families of utility func-tions, one that consists of CRRA utility functions and the other that consists of CARAutility functions. Our focus will be on the derivation of the optimal feedback law, using thestandard technique based on the corresponding HJB equation, and not on the technical con-ditions for the existence and uniqueness of the optimal one. The existence and uniquenesscan be established rigorously, using the verification theorem for stochastic optimal control(Bjork 2004). The proof is based on standard arguments and so omitted.

3.1 The HJB equation

We start by defining the value function V as

V (t, W, S) = suph

E

[

U(W (T ))

S(t) = S, W (t) = W

]

,

where the supremum is taken over all F(t)-adapted stochastic processes. Here by abuse ofnotation, we denote the wealth and spreads at time t as W and S, respectively. We assumethat the value function is sufficiently regular so that the gradient and Hessian of the valuefunction V evaluated at (t, W, S) exists:

g =

Vt

VW

VS

∈ Rm+2, H =

Vtt VtW VtS

VWt VWW VWS

VSt VSW VSS

∈ R(m+2)×(m+2).

Here we omit the arguments and we denote the derivative of f with respect to x as fx.

5

Page 6: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

Under suitable technical conditions, the value function V solves the Hamilton-Jacobi-Bellman (HJB) equation

∂V

∂t+ sup

h

[

VW (r(W − hT S) + hT K(S − S)) + V TS K(S − S)

+1

2VWWhT Σh +

1

2Tr(σT VSSσ) + hT ΣVSW

]

= 0

with the final condition

V (T, W, S) =W 1−γ

1 − γ.

Here,Σ = σσT ∈ R

m×m.

(The reader is referred to Øksendal (1998) for the details.) The first-order condition for thesupremum is

h = − 1

VWW

Σ−1[

VW (K(S − S) − rS) + ΣVSW

]

.

The HJB equation becomes

∂V

∂t+ VW rW + V T

S K(S − S) +1

2Tr(σT VSSσ) − f(S, W ) = 0, (4)

where

f(S, W ) =1

2VWW

[

VW (K(S − S) − rS) + ΣVSW

]TΣ−1

[

VW (K(S − S) − rS) + ΣVSW

]

.

3.2 Dynamic trading with CRRA utility functions

We first consider the HJB (4) with CRRA utility functions. A CRRA utility function hasthe form

U(W ) =

W (T )1−γ

1 − γ, γ 6= 1, γ > 0,

log W, γ = 1,

where γ > 0 is the relative risk aversion parameter.The value function we guess has the form

V (t, W, S) =

W 1−γ

1 − γexp(ST A(t)S + b(t)T S + c(t)), γ 6= 1, γ > 0,

log W + ST A(t)S + b(t)T S + c(t), γ = 1.(5)

with the functions A : [0, T ] → Rm×m, b : [0, T ] → R

m, and c : [0, T ] → R. The functionssatisfy the final conditions

A(T ) = 0 ∈ Rm×m, b(T ) = 0 ∈ R

m, c(T ) = 0 ∈ R.

6

Page 7: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

If the value function is indeed of this form, then the optimal feedback law is

h(t) =

W (t)

γ

[

Σ−1K(S − S(t)) − rS(t) + 2A(t)S(t) + b(t)]

, γ 6= 1, γ > 0,

W (t)Σ−1[

K(S − S(t)) − rS(t)]

, γ = 1.(6)

Here, the three functions A, b, and c can be found via solving a system of ODEs, as willbe derived shortly. In the logarithmic case, the optimal feedback law is time-invariant anddepends only on the current wealth and spreads.

The special case of logarithmic utility (γ = 1)

In the logarithmic utility case, the optimal feedback law does not depend on the functionsA, b, and c. In this case, the functions A, b, and c satisfy the ODEs

A(t) = A(t)T K + KT A(t) − 1

2(K + rI)T Σ−1 (K + rI) , (7)

b(t) = −2A(t)T KS + KT b(t) − rΣ−1KS, (8)

c(t) = −r − b(t)T KS − Tr(A(t)Σ) − 1

2ST KT Σ−1KS. (9)

The derivation is deferred to the appendix. These equations are linear, so we can readilyfind their analytic solutions. We omit the details.

The general case of γ 6= 1

We now turn to the case when γ 6= 1. The matrix-valued function A solves a matrix Riccatidifferential equation of the form

A(t) + A(t)T XA(t) − A(t)T Y − Y T A(t) − Q = 0, (10)

with

X =2

γΣ, Y =

1

γ(K − r(γ − 1)I), Q = η (K + rI)T Σ−1 (K + rI) ,

and

η =(1 − γ)2

2(γ2 − γ)=

γ − 1

2γ.

The functions b and c solve the ODEs

b(t) + 2A(t)T KS + [2A(t)T Σ − KT ]b(t) − 2η [2ΣA(t) − K − rI]T Σ−1[KS + Σb(t)] = 0 (11)

and

c(t) + ζ + b(t)T KS +1

2b(t)T Σb(t) + Tr(A(t)Σ) − η(Σb(t) + KS)T Σ−1(Σb(t) + KS) = 0,(12)

7

Page 8: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

with ζ = (1 − γ)r. The derivation is deferred to the appendix.Unlike the special case of logarithmic utility, we cannot solve these ODEs analytically.

This system of ODEs has an interesting property: Once A is computed numerically, wecan analytically solve the other two ODEs, since they are linear. The Riccati differentialequation (10) can be solved efficiently; there has been an extensive amount of work onnumerical methods for solving matrix Riccati differential equations (see, e.g., Kenney andLeipnik (1985) and Martn-Herran (1999)).

Decomposition

The dynamic optimal trading law (6) can be decomposed as

h(t) = hmyopic(t) + htemp(t),

where

hmyopic(t) =W (t)

γ

[

Σ−1K(S − S(t)) − rS(t)]

is the myopic component which is independent of the time horizon considered and

htemp(t) =W (t)

γ[2A(t)S(t) + b(t)]

is the intertemporal component that depends on the time horizon (and other problem data).The intertemporal component hedges against or speculates on the mean-reverting charac-teristics of the spreads. As t approaches the terminal time T , the intertemporal componentvanishes. (Jurek and Yang (2007) give an extensive discussion on the economic interpretationof each component for the single spread case.)

Dynamic spread trading and inventory control

In terms of the inventory levels I(t) ∈ Rn of the underlying n risky assets, the optimal

feedback law can be implemented as

I(t) = Φh(t)

where Φ = [Φ1 · · · Φm] ∈ Rn×m is the matrix whose columns are the coefficient vectors that

specify the mean-reverting relations in (1). The ith entry, Ii(t), of I(t) specifies the numberof shares of asset i in the inventory at time t with a long position in asset i correspondingto Ii(t) > 0, and a short position in asset i corresponding to Ii(t) < 0.

The dynamic spread trading strategy is a long/short strategy that dynamically changesthe inventory levels to exploit the mean-revering characteristics of the linear combinationsof the underlying securities specified in (1). It is not necessarily market neutral or dollarneutral in a strict sense, but we can choose the coefficient vectors Φi that specify the spreadsto limit market and sector exposures.

8

Page 9: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

3.3 Dynamic trading with CARA utility functions

We turn to dynamic spread trading with a general CARA utility function. A CARA utilityfunction has the form

u(W ) = −1

γe−γW , (13)

where the parameter γ > 0 describes the risk aversion of the investor. In the same spirit asbefore, we can also solve the HJB equation (4) with a general CARA utility function u.

The value function we postulate has the form

V (t, W, S) = −1

γeS(t)T A(t)S(t)+b(t)T S(t)+c(t)W (t)+d(t), (14)

where A : [0, T ] → Rm×m, b : [0, T ] → R

m, and c, d : [0, T ] → R. The next step is to derivethe ODEs for the functions A, b, c, and d which ensure that this value function solves theHJB equation (4) with the terminal condition

V (T, W, S) = −1

γe−γW .

In view of the terminal condition, these functions should satisfy the final conditions

A(T ) = 0 ∈ Rm×m, b(T ) = 0 ∈ R

m, c(T ) = −γ ∈ R, d(T ) = 0 ∈ R.

We can derive the ODEs for the functions A, b, c, and d. The ODE for A is a matrixRiccati differential equation of the form

A(t) − A(t)T K − kT A(t) − 1

2[2ΣA(t) − K − rI]TΣ−1[2ΣA(t) − K − rI] = 0. (15)

The function b, c, and d solve the ODEs

b(t) −Kb(t) + 2A(t)T KS + 2A(t)T Σb(t) − (2ΣA(t) −K − rI)T Σ−1(KS + Σb(t)) = 0, (16)

c(t) + rc(t) = 0, (17)

and

d(t) = −[

b(t)T KS +1

2b(t)T Σb(t) − 1

2[KS + Σb(t)]T Σ−1[KS + Σb(t)]

]

, (18)

respectively. The derivation is deferred to the appendix.We can analytically solve the ODE for c to obtain

c(t) = −γe−γ(t−T ).

Once the matrix Riccati differential equation for the matrix-valued function A is numericallysolved, the linear ODE for b can be solved easily. It is then straightforward to compute dfrom b by integrating both sides of (18). These ODEs have unique solutions, so the value

9

Page 10: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

function (14) indeed solves the HJB equation (4). Then, it is straightforward to show thatthe feedback law defined in (6) is optimal for the stochastic optimal control problem withthe CARA utility function (13).

The optimal feedback law can be written as

h(t) =1

γe−γ(t−T )Σ−1

[

(K(S − S) − rS(t)) + Σ[2A(t)S(t) + b(t)]]

.

The optimal trading law is very similar to that for the CRRA utility function case; onesignificant difference is that unlike that for the CRRA utility function case, it is independentof current wealth, which is a well-known property of CARA utility functions.

4 Experimental results

To illustrate the dynamic trading strategy described above, we apply it to four pairs thatconsist of several S&P 500 index stocks. In the set of empirical results shown below, theestimation and trading tasks are completely separated, meaning that once the model pa-rameters are estimated with a data set over an estimation period they are fixed throughoutthe trading period and no online parameter update is done. Although online update oftenleads to an improved performance, we report here the results that illustrate most closely thedynamic trading strategy.

4.1 The setup

The dynamic trading strategy specified by solving a stochastic control problem is theoreticaland cannot be implemented in the original form; in real trading, we cannot trade continu-ously. In our experimental study, we use a discrete-time approximation of the continuoustrading strategy specified by solving a stochastic control problem. We adjusted the portfolio(of the risk-free asset and spreads) daily. (We point out that it is possible to implementa discrete-time approximation on a shorter or longer time scale.) Transaction costs areexplicitly accounted for, while shortselling costs are not.

The assets and pairs

The underlying securities considered in our experimental are given in Table 1. (These stocksconstitute S&P 500 index stocks, and so are highly liquid.) The risk-free return is taken asr = 4% per annum.

The securities are paired as shown in Table 2, to construct the spreads. Out of the fourpairs, HD/LOW and F/GM are widely known among practitioners of pairs trading. Theother two need some explanation. PBG is the world’s largest bottler of Pepsi-Cola beveragesand has the exclusive right to manufacture, sell and distribute Pepsi-Cola beverages in manystates of the USA and many other countries. It is therefore natural to expect that theprices of PEP and PBG tend to move together. Masco Corporation is in the manufacturing

10

Page 11: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

index company ticker symbol1 Home Depot HD2 Lowe’s Companies, Inc. LOW3 PepsiCo, Inc. PEP4 Pepsi Bottling Group, Inc. PBG5 Ford Motor Company F6 General Motors Corporation GM7 Masco Corporation MAS

Table 1: Stocks used in our numerical study.

pair ticker symbols of constituent stocks estimated cointegrating vector1 HD and LOW (1,−1.2655)2 PEP and PBG (1,−1.8264)3 F and GM (1,−0.3362)4 HD and MAS (1,−1.3056)

Table 2: Pairs and estimated cointegrating relations.

and distribution of branded consumer products for homes and families, and Home Depotaccounts for a large portion of its sales (more than a quarter). For the same reason, it is notsurprising that the stock prices of HD and MAS tend to move together. Since HD appearsin both pair 1 and pair 4, their spreads (the differences between appropriately scaled priceswhose proportions are to be estimated from historical data) are highly correlated.

The whole period considered in our numerical study is from the first trading date in June2002 to the last trading data in May 2008. (The whole horizon consists of 1444 tradingdays.) We use the early four-year data (from June 2002 through May 2006, called theestimation period), to estimate the model parameters in the trading algorithm and then usethe remaining data set (from June 2006 through May 2008, called the trading period) tovalidate the dynamic trading algorithm. From now on, t = 1 corresponds to the start date ofthe estimation period and t = Nestim corresponds to the last date of the estimation period.The total number of trading days is Ntrading, so the trading period is from t = Nestim + 1to t = Nestim + Ntrading. For the moment, we fix the horizon sizes to Ntrading = 4 · 251 andNtrading = 2 ·251. (Later we will change the sizes, to examine their effects on the performanceof the dynamic trading strategy.)

We used adjusted close prices, namely, the closing prices day adjusted for all applica-ble splits and dividend distributions, which were downloaded from Yahoo finance (http://finance.yahoo.com/). (The data are adjusted using appropriate split and dividend mul-tipliers, in accordance with Center for Research in Security Prices (CRSP) standard.) Weuse PABC(t) to denote the close price of the stock whose ticker symbol is ABC. We assumethat the dynamic spread trading strategy purchases or sells the stocks at the adjusted closeprices.

11

Page 12: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

Figure 1 shows time plots of adjusted close prices of the stocks grouped together accordingto the pairing described above for the period of June 2002 to May 2008. It is obvious fromthe plots that the constituent stocks of each pair tend to move together.

Spread construction

To construct spreads from the four pairs, we need to determine how many shares of thesecond constituent stock are to be sold, while buying one share of the first one. To do so,we regressed the price of the first constituent stock onto that of the other one with the pricedata over a period. For instance, the ratio βHD/LOW for the HD/LOW pair minimizes theroot mean square (RMS) error

Nestim∑

t=1

(PHD(t) − βPLOW(t))2.

(This ordinary least squares (OLS) method is described in Engle and Granger (1987) in thecontext of cointegrating vector estimation.) The estimate ratios found via the OLS withNestim = 4 · 251 are

βHD/LOW = 1.2655,

βPEP/PBG = 1.8264,

βF/GM = 0.3302,

βHD/MAS = 1.3056.

For instance, the first cointegrating relation means that we need to sell 1.2655 shares of LOW,while buying one share of HD, to minimize the RMS error (over the estimation period).

The corresponding four spreads are

S1(t) = PHD(t) − βHD/LOWPLOW(t),

S2(t) = PPEP(t) − βPEP/PBGPPBG(t)

S3(t) = PF(t) − βF/GMPGM(t)

S4(t) = PHD(t) − βHD/MASPMAS(t).

Figure 2 shows the time plots of the spreads over the whole period including the tradingperiod. The cointegrating relations do not appear to break down over the trading period.

Model calibration

We calibrated a mean-reverting model to the spreads observed over the four-year estimationperiod. For calibration purposes, we derive the discrete-time vector autoregressive (VAR)representation of the vector OU process (2):

S(t + 1) = (I − ∆tK(S − S(t)) +√

∆tσZ(t),

12

Page 13: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

where ∆t = 1/251 .For the estimation of parameters in the VAR model given above, we used ARfit, a Mat-

lab package for the estimation of parameters and eigenmodes of multivariate autoregressivemodels (Neumaier and Schneider 2001a,b). The estimated model parameters using the dataset over the estimation period are

ˆS =

0.09640.11110.01620.2653

∈ R4, K =

4.5710 0 0 00 3.5519 0 00 0 2.3895 00 0 0 5.2002

∈ R4×4,

and

Σ =

48.6848 −2.2723 0.2250 24.1554128.7793 0.2836 0.8678

8.4051 −0.094868.4779

∈ R4×4.

(Only the upper triangular part is shown because the matrix is symmetric.) We can see thatthe first and last spreads are highly correlated (since HD is common in both pairs). Thespreads of the other two pairs PEP/PBG and F/GM tend to move independently of eachother and of these correlated pairs (HD/LOW and HD/MAS). We point out that it is possibleto recover a maximum likelihood estimate (MLE) of the parameters in the continuous-timemodel from discretely sampled data points, since OU processes are Gaussian; see, e.g.,Bergstrom (1984). But we found that the MLE was rather unstable.

13

Page 14: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

ts

yearyear

yearyearpri

ce[$

]

pri

ce[$

]

pri

ce[$

]

pri

ce[$

]

1/031/03

1/031/03

1/041/04

1/041/04

1/051/05

1/051/05

1/061/06

1/061/06

1/071/07

1/071/07

1/081/08

1/081/08

0

10

20

30

40

50

0

20

40

60

80

100

0

10

20

30

40

50

0

10

20

30

40

50

Figure 1: Time plots of stock prices for the period of June 2002 to May 2008. Topleft: PHD(t) (solid) and PLOW(t) (dashed). Top right: PPEP(t) (solid) and PPBG(t)(dashed). Bottom left: PF(t) (solid) and PGM(t) (dashed). Bottom right: PHD(t)(solid) and PMAS(t) (dashed). The vertical dotted line divides the whole period intoestimation period (June 2002 to May 2006) and trading period (June 2006 to May2008).

14

Page 15: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

yearyear

yearyearsp

read

[$]

spre

ad[$

]

spre

ad[$

]

spre

ad[$

]

1/031/03

1/031/03

1/041/04

1/041/04

1/051/05

1/051/05

1/061/06

1/061/06

1/071/07

1/071/07

1/081/08

1/081/08

-15

-10

-5

0

5

10

15

-6-6

-6

-4-4

-4

-2-2

-2

00

0

22

2

44

4

66

6

Figure 2: Time plots of four spreads for the period of June 2003 to May 2008.Top left: PHD(t) − 1.266PLOW(t). Top right: PF(t) − 1.826PGM(t). Bottom left:PPEP(t) − 0.330PPBG(t). Bottom right: PHD(t) − 1.306PMAS(t). The coefficients areestimated from price data over the estimation period from June 2002 through May2006.

15

Page 16: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

4.2 Performance assessment

We consider a scenario in which the investor with a CRRA utility function applies thedynamic spread trading strategy to the four spreads in Table 2 with ten million dollar initialcapital and wants to withdraw his investment after T years. Using the solution methoddescribed above, we compute the functions A, b, and c that specify the optimal feedbackcontrol law with T years, via solving the ODEs (10) and (11) with the problem data givenabove. We set the investment horizon as T = 2 (years), which is the same as the tradinghorizon size. (Later we will show how its choice affects the overall performance of the dynamicspread trading strategy.)

We describe the optimal feedback law in terms of the daily close prices of the 7 underlyingstocks:

h(t) =W (t)

γ

[

Σ−1K(

ˆS − ΦT P (t))

− rS(t) + 2A(t)ΦT P (t) + b(t)]

∈ R4,

where

ΦT =

1 −βHD/LOW 0 0 0 0 00 0 1 −βPEP/PBG 0 0 00 0 0 0 1 −βF/GM 01 0 0 0 0 0 −βHD/MAS

describes the four estimated cointegrating relations among the stocks described above. Thisfeedback control law controls the inventory levels of the 7 underlying stocks as

I(t) = Φh(t) ∈ R7.

The ith entry, Ii(t), of I(t) specifies the inventory level of asset i. We assume that the initialinventory levels of the stocks are zero, meaning that the initial capital is put into the moneymarket account.

Performance metrics

We will compare the following four quantities: annualized risk and return (over the trad-ing period), annualized Sharpe ratio (SR) relative to the 4% risk-free rate, and maximumdrawdown (MD). The maximum drawdown at time t is the largest drawdown of the wealthexperienced by the trading strategy up to time t:

MDD(t) =W (t)

sups≤t W (s).

The maximum drawdown is the maximum cumulative loss from a peak to the followingtrough:

MD = supt=Nestim,...,Ntrading

MDD(t).

16

Page 17: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

Effects of transaction costs on the performance

Several researchers have demonstrated that pairs trading could outperform significantlybenchmark indexes without taking into account transaction costs. An obvious question toask is whether the strategy would continue to outperform the indices (or even yield positivereturns) when realistic transaction costs are accounted for.

The change of the inventory level of stock i from time t to the next trading day incurspurchasing or selling |Ii(t + 1) − Ii(t)| shares. If the cost to buy or sell one share of stock iis ηi, then the transaction cost due to the changes of the inventory levels of the 7 stocks is

T (t) =7

i=1

ηi|Ii(t + 1) − Ii(t)|Pi(t).

The cumulative transaction cost at time t is the sum of transaction costs till time t:

C(t) =t

s=Nestim

T (s).

We assume that the transaction costs are the same for the 7 stocks:

ηi = η.

We vary η from 20 basis points (bps) to 50. Figure 3 shows the wealth growth over thetrading period for different levels of transaction cost. The final wealth depends very muchon transaction cost. When it is below 35 basis points, this strategy outperformed signif-icantly the S&P 500 index which yielded an annualized return of below 6% and a SR of0.2 over the same period. Several empirical studies show that for S&P 500 index stocks,the average transaction cost is below 35bps Gatev et al. (2006). This figure shows thateven the straightforward implementation of the dynamic trading strategy without taking anappropriate measure for transaction costs appears to deliver a significant performance.

Table 3 summarizes the performance of the dynamic trading strategy with different trans-action cost levels. The maximum drawdown is relatively low, compared with that of the S&P500 index over the same period (around 18%). The realized SR exceeds one when the av-erage transaction cost is below 30 bps. So long as the transactio cost was below 35 bps, itsignificantly outperformed the S&P 500 index, whose performance over the same period issummarized in Table 4.

The dynamic trading strategy balances the inventory levels of the 7 stocks daily, whichincurs significant transaction costs. Figure 4 shows the plots of the cumulative wealth, W (t)and the cumulative transaction cost, C(t) for two values of the average transaction cost forS&P 500 index stocks. In the case of 25 basis points, the cumulative transaction cost overthe two-year trading period is comparable to the amount of wealth increased over the sameperiod. In the case of 35 basis points, the cumulative transaction cost easily exceeds even theinitial capital. In summary, the dynamic trading strategy with even a modest risk aversionparameter exhibits an extremely high turnover rate.

From now on, we focus on the case of η = 25. The results shown below are not significantlyaffected by the transaction cost, so long as it is within the range of 20 to 35.

17

Page 18: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

PSfrag

time

rela

tive

wea

lth

1/2007 1/20080.5

1.0

1.5

2.0

2.5 20 bps

25 bps

30 bps

35 bps

40 bps

45 bps

50 bps

Figure 3: Cumulative return (geometric compounding of daily returns) of the dy-namic trading strategy with γ = 70 and the four spreads in Table 2 over the tradingperiod versus transaction cost.

transactioncost (bps)

annualizedreturn [%]

annualizedrisk [%]

annualizedSR

maximumdrawdown [%]

20 56.61 32.20 1.43 16.7525 46.64 32.20 1.23 17.4330 37.30 32.21 1.02 18.1135 28.54 32.22 0.82 18.7840 20.34 32.23 0.61 19.4445 12.66 32.25 0.41 20.1150 5.46 32.26 0.20 21.09

Table 3: Performance of the dynamic trading strategy with γ = 70 and the fourspreads in Table 2 as transaction cost increases from 20 bps to 50 bps.

annualizedreturn [%]

annualizedrisk [%]

annualizedSR

maximumdrawdown [%]

4.98 15.84 0.14 18.6

Table 4: Performance of the S&P 500 index over the period from June 2006 throughMay 2008.

18

Page 19: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

year

[107

]$

0

0.5

1.0

1.5

2.0

2.5

wealth

cumulative transactioncost

2.5

year

[107

]$

1/2007 1/20080

0.5

1.0

1.5

2.0

wealthwealth

cumulative transactioncost

cumulative transactioncost

Figure 4: Time plots of wealth and cumulative transaction cost. Top: average trans-action cost for S&P 500 index stocks is 25 basis points. Bottom: average transactioncost for S&P 500 index stocks is 35 basis points.

19

Page 20: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

standard deviation of daily returns [%]

mea

nof

dai

lyre

turn

s[%

]

1 1.5 2 2.5 30

0.1

0.2

0.3

Figure 5: Risk and return with varying risk aversion parameter. Dashdot curve: onepair (HD/LOW). Dashed curve: two pairs (HD/LOW and PEP/PBG). Dotted curve:three pairs (HD/LOW, PEP/PBG, and F/GM). Solid curve: four pairs (HD/LOW,PEP/PBG, F/GM, HD/MAS).

Risk-return profile versus the number of spreads

Figure 5 shows how the risk-return profile of the dynamic trading strategy varies as thenumber of spreads included varies from one to four. We can see that the performance is im-proved, as the number of spreads increases from one to two. For other possible combinationsof the four pairs in Table 2, we observed a similar result. As can be seen from this figure,the risk aversion parameter does not significantly affect the realized SR. As γ decreases, therealized risk and return as well as the margin requirement increase, regardless of the numberof spreads used.

20

Page 21: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

PSfrag

return in percentage-10 -5 0 5 10 150

5

10

15

20

25

30

35

Figure 6: Histogram of daily returns achieved by the dynamic trading strategy withγ = 70 for the trading period from June 2006 to May 2008.

Shapes of return distributions

Figure 6 shows the histogram of the return distribution for γ = 70 when the average transac-tion cost is 25 bps. It is clear that the return distribution is far from Gaussian. The skewnessof the distribution is 0.86, which means that i.e., the right tail is longer than the left one.The kurtosis is 7.22, which means that the daily return distribution is leptokurtic, i.e., it hasa very acute peak around the mean, compared with a normally distributed random variable.For a wide range of risk aversion parameters, we observed that the return distribution isleptokurtic and skewed to the right.

21

Page 22: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

Margin requirement

Figure 8 shows the allocations of wealth over the risk-free asset and risky assets. Here,1 − h(t)T S(t)/W (t) is the fraction of wealth put in the risk-free asset and h(t)T S(t)/W (t)is the fraction of wealth put in the stocks (which can be negative). This figure shows thatover the trading period, the strategy always takes a short position in aggregate in the riskyassets.

The dynamic trading strategy is a type of long/short strategy, so the margin requirementis more complicated than long-only strategies. As in Khandani and Lo (2007), we computethe margin requirement for a broker/dealer, who is not subject to Regulation T (that specifiesthe maximum initial credit extension by brokers/dealers that may be given to investors insecurities) and hence can employ higher levels of leverage than individual investors. Weassume a scenario in which the fraction of wealth in the money market account can be usedas collateral to finance the long/short positions in the underlying 7 stocks. The amount ofinvestment in the long or short position in stock i is |Pi(t)Ii(t)|. The total exposure is thesum

∑7i=1 |Pi(t)Ii(t)|. Using the leverage ratio of θ:1, the margin requirement at time t is

given by

MR(t) =1

θ

7∑

i=1

|Pi(t)Ii(t)|.

(This leverage ratio means that if θ = 8, then the margin to maintain a portfolio of riskysecurities with 100 million dollar total exposure is 12.5 million.)

Figure 7 shows the time plot of the margin requirement computed with θ = 8 (whichis the same regulatory leverage factor as one used in Khandani and Lo (2007) to computethe margin requirement for market-neutral long/short portfolios). The relative risk-aversionparameter is taken as γ = 70. The figure shows that the margin requirement is alwaysmet. When the relative risk-aversion parameter is below a threshold (around 40 in thesetting described above), the margin requirement based on the 8:1 ratio is not always met.We conclude that margin requirements prevent the investor from being too aggressive inexploiting the mean-revering behavior of the spreads.

Inventory levels

Figure 9 shows how the number of units of each of the four spreads varies over the tradingperiod. We can see from the figure that the allocations on the four spreads are well diversified.

Figure 10 shows the time plots of the inventory levels for the stocks in the pairs divided bythe current wealth, I(t)/W (t). This figure shows that the dynamic trading strategy changesthe inventory levels often abruptly (since it does not account for transaction costs). At thepeak, the daily transaction volume due to the dynamic strategy accounts for more than 1%of the volume of a stock. The high volume means that the dynamic trading strategy is nothighly scalable. If the initial wealth were 100 million dollars, then at the peak the dailytransaction volume due to the dynamic strategy would account for more than 10% of thevolume of a stock, which calls special attention to price impact which is not modeled in thepresent numerical study.

22

Page 23: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

year1/2007 1/2008

-1.0

-0.5

0

0.5

1.0

1.5

2.0

Figure 7: Relative allocation of wealth on the money market account and thefour spreads. Solid curve: the fraction of wealthy in the money market account,1 − h(t)T S(t)/W (t). Dashed curve: the fraction of wealth in the four spreads,h(t)T S(t)/W (t).

year

[$]

1/2007 1/20080

0.5 · 107

1.0 · 107

1.5 · 107

2.0 · 107

2.5 · 107

3.0 · 107

Figure 8: Daily margin requirement. Solid curve: amount of money in the moneymarket account W (t) − h(t)T S(t). Dashed curve: time plot of margin requirementMR(t).

23

Page 24: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

yearyear

yearyear

HD/LOW PEP/PBG

F/GM HD/MAS

1/20071/2007

1/20071/2007

1/20081/2008

1/20081/2008

-0.1-0.1

-0.1-0.1

-0.05-0.05

-0.05-0.05

00

00

0.050.05

0.050.05

0.10.1

0.10.1

Figure 9: Time plots of relative allocations on spreads, h(t)/W (t). Top left:HD/LOW. Top right: PEP/PBG. Bottom left: F/GM. Bottom right: HD/MAS.

24

Page 25: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

year

shar

es[1

06]

1/2007 1/2008

-1

0

1HD

year

shar

es[1

06]

1/2007 1/2008

-1

0

1LOW

year

shar

es[1

06]

1/2007 1/2008

-1

0

1PEP

year

shar

es[1

06]

1/2007 1/2008

-1

0

1PBG

year

shar

es[1

06]

1/2007 1/2008

-1

0

1F

year

shar

es[1

06]

1/2007 1/2008

-1

0

1GM

year

shar

es[1

06]

1/2007 1/2008

-1

0

1MAS

Figure 10: Time plots of inventory levels. Top left: HD/LOW. Top right: PEP/PBG.Bottom left: G/GM. Bottom right: HD/MAS.

25

Page 26: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

stockmaximum daily inventory

level change [shares]average daily inventory

level change [shares]average transaction

volumes [shares]HD 3.51 · 105 1.54 · 104 1.23 · 107

LOW 3.97 · 105 1.78 · 104 8.31 · 106

PEP 1.48 · 105 0.55 · 104 4.57 · 106

PBG 2.68 · 105 0.99 · 104 1.12 · 106

F 3.89 · 105 1.22 · 104 3.37 · 107

GM 1.30 · 105 0.41 · 104 1.23 · 107

MAS 4.93 · 105 2.03 · 104 3.05 · 106

Table 5: Maximum inventory level changes and average transaction volumes over thetrading period (from June 2006 through May 2008).

Transaction volumes and scalability

At time t (or the tthe trading date from the start of the trades), the daily inventory levelstock i changes from I(t−1) to Ii(t). The daily inventory level change of stock i is therefore

Mi(t) = |Ii(t) − I(t − 1)|.

As can be seen from Figure 10, the inventory levels of the stocks often change abruptly overthe trading period.

Table 5 shows the maximum daily inventory level changes as well as the average dailyinventory level changes over the trading period (with Ntrading = 4 · 251 and Ntrading = 2 · 251days). For comparison, it also shows the average transaction volumes of the stocks over thesame period. with the average transaction volumes of the stocks. The average daily inventorylevel changes are below one percent of the average daily transaction volumes, so the inventorylevel changes would not have price impact on average. For PBG and MAS (which are lessliquid compared with the other 5 stocks), however, their daily inventory level changes thedynamic trading strategy requires are often not small, compared with their average dailytransaction volumes. For these stocks, price impact due to the large transaction volumes ofthe dynamic trading strategy will often be noticeable.

As the capital deployed in the spreads and risk-free asset increases, daily transactionvolumes increase proportionately. Although the S&P 500 index stocks used in our numericalstudy are quite liquid, the size of a fund that can be effectively run by the dynamic spreadtrading strategy is limited. To make the trading strategy more scalable, it is necessary totake into account price impact in the stochastic control formulation.

Effects of estimation horizon size and terminal time

Two important parameters in the dynamic spread trading strategy to be chosen are theestimation horizon size and terminal time. The choice of the estimation horizon size affectsthe accuracy of the estimate of the model parameters: when it is too small or large, the

26

Page 27: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

estimation error can be significant due to the small sample problem of the (possibly) time-inhomogeneous characteristics of the spreads. (Another source of estimation error is modelmis-specification, which we do not address in this paper.) The choice of the terminal timecontrols the significance of the intertemporal component relative to the myopic componentover the trading period.

Thus far, the estimation horizon size has been fixed to four years. We vary the parameterfrom two years to four years, while fixing the last date of the estimation period and the startdate of the trading period to the same values. (For instance, when the estimation horizonsize is two years, we use the stock data over the period of June 2004 to June 2006 to estimatethe cointegrating relations and model parameters.) Table 6 summarizes the results. Whenthe window size is below 3 years, the estimation error appears to be significant, so theperformance is degraded accordingly.

Thus far, the terminal time (at which the wealth is evaluated) has been the same asthe last trading date. We next examine how the choice of the terminal time affects theperformance, as it varies from 2 years to 5 years. Table 7 summarizes the results. As theterminal time increases, the return increases at the expense of increased risk. The SR remainsalmost the same, regardless of the terminal time. The maximum drawdown increases almostproportionately as the risk level increase. In summary, as T increases, the effect of theintertemporal component becomes more significant, and the realized risk and return tend toincrease.

Summary

We have thus far carried out an extensive numerical study for the dynamic spread tradingstrategy with four pairs. The results show that the trading strategy could deliver a goodperformance under realistic transaction costs. However, its large daily transaction volumesmean that it is not highly scalable.

The experimental results shown above should be interpreted with caution. The mean-reverting relationship on which the dynamic trading strategy and its good performance isbased may break down in the future. Unlike Siamese twin stocks (e.g., Royal Dutch/Shelland Unilever NV/PLC) that should respond almost identically to news regarding intrinsicvalue due to their nearly identical risk exposures, the mean-reverting statistical patterns inthe four pairs might be very vulnerable to shocks. In cases when many of the statisticalpatterns break simultaneously, the dynamic spread trading strategy may suffer significantlosses.

27

Page 28: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

estimation horizonsize [years]

annualizedreturn [%]

annualizedrisk [%]

annualizedSR

maximumdrawdown [%]

2 52.5 52.6 0.99 28.42.5 60.3 54.2 1.07 25.43 58.3 46.3 1.14 22.6

3.5 56.1 39.2 1.23 16.74 55.5 39.1 1.22 22.1

Table 6: Effects of estimation horizon size on the performance of the dynamic spreadtrading strategy over the two-year trading period (from June 2006 through May 2008).

terminal time[years]

annualizedreturn [%]

annualizedrisk [%]

annualizedSR

maximumdrawdown [%]

2 46.6 32.2 1.23 17.42.5 51.5 36.0 1.23 20.03 55.5 39.1 1.22 22.1

3.5 58.8 41.7 1.22 23.94 61.5 43.8 1.22 25.4

4.5 63.8 45.6 1.22 26.65 65.7 47.0 1.23 27.7

Table 7: Effects of trading horizon size on the performance of the dynamic spreadtrading strategy over the two-year trading period (from June 2006 through May 2008).

28

Page 29: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

5 Conclusions

In this paper, we have described a dynamic long/short trading strategy that exploits themean-revering characteristics of certain combinations of those. This strategy is not nec-essarily market neutral or dollar neutral in a strict sense. We should point out that inestimating the coefficient vectors that specify the spreads, we can take into explicit accountmarket and/or sector exposures.

Although our (small-scale) experiments using a straightforward implementation of theoptimal feedback law (without taking any measures towards reducing the effects of trans-action costs) show its good performance under realistic transaction costs, trading profitsappear to be significantly eroded by transaction costs. We would like to include transactioncosts in the stochastic control formulation of dynamic spread trading. The correspondingHJB equation is not analytically solvable, so the optimal feedback law should be computednumerically. In the standard portfolio optimization setting with geometric Brownian motion,David and Norman (1990) and Liu (2004) show that there is an inaction region where notrading is performed. It is an interesting question whether the optimal feedback control lawfor dynamic spread trading under transaction costs has an inaction region. We also wouldlike to develop a numerical method for solving the HJB equation.

Another interesting research direction is related to the wealth effect in convergence trad-ing. Xiong (2001) studies convergence trading with one spread and logarithmic utility in acontinuous-time equilibrium model and shows that when an unfavorable shock causes con-vergence traders to suffer capital losses, they liquidate their positions, amplifying the originalshock. and, in extreme circumstances, causing them to be destabilizing in that they trade inexactly the same direction as noise traders. It is an interesting question whether the benefitof diversification (over the multiple spreads) can mitigate the wealth effect in trading withmultiple spreads.

Acknowledgments

This material is based upon work supported by the Focus Center for Circuit & System Solu-tions (C2S2), by the Precourt Institute on Energy Efficiency, by Army award W911NF-07-1-0029, by NSF award 0529426, by NASA award NNX07AEIIA, by AFOSR award FA9550-06-1-0514, and by AFOSR award FA9550-06-1-0312.

29

Page 30: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

A Derivation

A.1 Derivation of the ODEs for CRRA utility functions

We derive the ODEs in Section 3.2.

The case of γ = 1

In this case, the first and second derivatives of the value function (5) are given by

Vt(t, W, S) = ST A(t)S + b(t)T S + c(t),

VW (t, W, S) = W−1,

VS(t, W, S) = 2A(t)S + b(t),

VWW (t, W, S) = −W−2,

VWS(t, W, S) = 0,

VSS(t, W, S) = 2A(t).

The HJB equation (4) then becomes

ST A(t)S + b(t)T S + c(t) + r + [2A(t)S + b(t)]T K(S − S) + Tr(σT A(t)σ)

+1

2[(K(S − S) − rS)]T Σ−1[(K(S − S) − rS)] = 0.

Since this equation holds for any S ∈ Rm, the three ODEs (7)–(9) must hold for the functions

A, b, and c.

The case of γ 6= 1

In this case, the first and second derivatives of the value function (5) are given by

Vt(t, W, S) = V (t, W, S)[

ST A(t)S + b(t)T S + c(t)]

,

VW (t, W, S) = (1 − γ)W−1V (t, W, S),

VS(t, W, S) = V (t, W, S) [2A(t)S + b(t)] ,

VWW (t, W, S) = (γ2 − γ)W−2V (t, W, S),

VWS(t, W, S) = (1 − γ)W−1V (t, W, S) [2A(t)S + b(t)] ,

VSS(t, W, S) = V (t, W, S) [2A(t)S + b(t)] [2A(t)S + b(t)]T + 2V (t, W, S)A(t).

The HJB equation (4) is then equivalent to

1

2VWW

[

VW (K(S − S) − rS) + ΣVSW

]TΣ−1

[

VW (K(S − S) − rS) + ΣVSW

]

= ηV (t, W, S)g(t, S)TΣ−1g(t, S),

30

Page 31: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

whereg(t, S) = K(S − S) − rS + Σ(2A(t)S + b(t)).

Therefore,

ST A(t)S + b(t)T S + c(t) + (1 − γ)r + [2A(t)S + b(t)]T K(S − S)

+1

2Tr

(

σT[

(2A(t)S + b(t)) (2A(t)S + b(t))T + 2A(t)]

σ)

− ηg(t, S)TΣ−1g(t, S) = 0.

Since this equation holds for every S ∈ Rm, the three ODEs (10)–(12) must hold for the

functions A, b, and c.

A.2 Derivation of the ODEs for CARA utility functions

In this case, the first and second derivatives of the value function (5) are given by

Vt(t, W, S) = V (t, W, S)[

ST A(t)S + b(t)T S + c(t) + d(t)]

,

VW (t, W, S) = c(t)V (t, W, S),

VS(t, W, S) = V (t, W, S) [2A(t)S + b(t)] ,

VWW (t, W, S) = c(t)2V (t, W, S),

VWS(t, W, S) = c(t)V (t, W, S) [2A(t)S + b(t)] ,

VSS(t, W, S) = V (t, W, S) [2A(t)S + b(t)] [2A(t)S + b(t)]T + 2V (t, W, S)A(t)

The associated HJB equation is then equivalent to

V (t, W, S)

[

ST A(t)S + b(t)T S + c(t) + d(t) + c(t)rW + [2A(t)S + b(t)T K(S − S)

+1

2Tr

(

σT (2A(t) + [2A(t)S + b(t)][2A(t)S + b(t)]T )σ)

−1

2[K(S − S) − rS + Σ(2As + b)]T Σ−1[K(S − S) − rS + Σ(2As + b)]

]

= 0.

Since this equation holds for every S ∈ Rm and W ∈ R, the four ODEs (15)–(18) must hold

for the functions A, b, c, and d.

31

Page 32: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

References

A. Bergstrom. Continuous time stochastic models and issues of aggregation over time. InZ. Griliches and M. Intriligator, editors, Handbook of Econometrics, volume 2, pages 1145–1212. North-Holland, Amsterdam, 1984.

T. Bjork. Arbitrage Theory in Continuous Time. Oxford University Press, second edition,2004.

M. Boguslavsky and E. Boguslavskaya. Arbitrage under power. Risk, 17(6):69–73, 2004.

P. Bossaerts. Common nonstationary components of asset prices. Journal of EconomicDynamics and Control, 12:347–364, 1988.

J. Campbell and L. Viceira. Strategic Asset Allocation. Oxford University Press, 2002.

J. Campbell, G. Chacko, J. Rodriguez, and L. Viceira. Strategic asset allocation in acontinuous-time VAR model. Journal of Economic Dynamics and Control, 28(1):2195–2214, 2004.

M. David and A. Norman. Portfolio selection with transaction costs. Mathematics of Oper-ations Research, 15(4):676–712, 1990.

R. Elliott, J. van der Hoek, and W. Malcolm. Pairs trading. Quantitative Finance, 5(3):271276, 2005.

R. Engle and C. Granger. Co-integration and error correction: Representation, estimationand testing. Econometrica, 55(2):251–276, 1987.

E. Gatev, W. Goetzmann, and K. Rouwenhorst. Pairs trading: Performance of a relative-value arbitrage rule. Review of Financial Studies, 19(3):797–827, 2006.

F. Herzog, G. Dondi, H. Geering, and L. Schumann. Continuous-time multivariate strategicasset allocation, 2008. Working paper.

S. Johansen. Estimation and hypothesis testing of cointegration vectors in gaussian vectorautoregressive models. Econometrica, 59(6):15511580, 1991.

J. Jurek and H. Yang. Dynamic portfolio selection in arbitrage, 2007. Working paper.

C. Kenney and R. Leipnik. Numerical integration of the differential matrix Riccati equation.IEEE Transactions on Automatic Control, 30(10):962–970, 1985.

A. Khandani and A. Lo. What happened to the quants in august 2007? Journal of InvestmentManagement, 5(4):5–54, 2007.

T. Kim and E. Omberg. Dynamic nonmyopic portfolio behavior. Review of Financial Studies,9:141–1611, 1996.

32

Page 33: dynamic spread trading - Semantic Scholar · Dynamic Spread Trading Seung-Jean Kim∗ James Primbs† Stephen Boyd∗ June 2008 Abstract This paper is concerned with a dynamic trading

H. Liu. Optimal consumption and investment with transaction costs and multiple riskyassets. Journal of Finance, 59(1):89–338, 2004.

G. Martn-Herran. Symplectic methods for the solution to riccati matrix equations relatedto macroeconomic models. Computational Economics, 13(1):61–91, 1999.

M. Mitchell, T. Pulvino, and E. Stafford. Limited arbitrage in equity markets. Journal ofFinance, 57(2):551–584, 2002.

S. Mudchanatongsuk, J. A. Primbs, and W. Wong. Optimal Pairs Trading: A StochasticControl Approach. In Proceedings of the American Control Conference, Seattle, WA, June2008.

A. Neumaier and T. Schneider. Estimation of parameters and eigenmodes of multivariateautoregressive models. ACM Transactions on Mathematical Software, 27(4):27–57, 2001a.

A. Neumaier and T. Schneider. Algorithm 808: ARfit – a Matlab package for the estimationof parameters and eigenmodes of multivariate autoregressive models. ACM Transactionson Mathematical Software, 27(4):5865, 2001b.

B. Øksendal. Stochastic Differential Equations: An Introduction with Applications. Springer,fifth edition, 1998.

M. Schroder and C. Skiadas. Optimal consumption and portfolio selection with stochasticdifferential utility. Journal of Economic Theory, 89(1):68–126, 1999.

G. Uhlenbeck and L. Ornstein. On the theory of Brownian motion. Physical Review, 36(5):823–841, 1930.

G. Vidyamurthy. Pairs Trading – Quantitative Methods and Analysis. John Wiley & Sons,Inc., 2004.

M. Whistler. Trading Pairs – Capturing Profits and Hedging Risk with Statistical ArbitrageStrategies. John Wiley & Sons, Inc., 2004.

W. Xiong. Convergence trading with wealth effects: An amplification mechanism in financialmarkets. Journal of Financial Economics, 62(2):247–292, 2001.

33


Recommended