*Article* **A Singular Stochastic Control Approach for Optimal Pairs Trading with Proportional Transaction Costs**

**Haipeng Xing**

Department of Applied Mathematics and Statistics, Stony Brook University, Stony Brook, NY 11794, USA; haipeng.xing@stonybrook.edu; Tel.: +1-631-632-1892

**Abstract:** Optimal trading strategies for pairs trading have been studied by models that try to find either optimal shares of stocks by assuming no transaction costs or optimal timing of trading fixed numbers of shares of stocks with transaction costs. To find optimal strategies that determine optimally both trade times and number of shares in a pairs trading process, we use a singular stochastic control approach to study an optimal pairs trading problem with proportional transaction costs. Assuming a cointegrated relationship for a pair of stock log-prices, we consider a portfolio optimization problem that involves dynamic trading strategies with proportional transaction costs. We show that the value function of the control problem is the unique viscosity solution of a nonlinear quasi-variational inequality, which is equivalent to a free boundary problem for the singular stochastic control value function. We then develop a discrete time dynamic programming algorithm to compute the transaction regions, and show the convergence of the discretization scheme. We illustrate our approach with numerical examples and discuss the impact of different parameters on transaction regions. We study the out-of-sample performance in an empirical study that consists of six pairs of U.S. stocks selected from different industry sectors, and demonstrate the efficiency of the optimal strategy.

**Keywords:** free-boundary problem; pairs trading; stochastic control; trading strategies; transaction costs; transaction regions

### **1. Introduction**

Pairs trading is one of proprietary statistical arbitrage tools used by many hedge funds and investment banks. It is a short-term trading strategy that first identifies two stocks whose prices are associated in a long-run equilibrium and then trades on temporary deviations of stock prices from the equilibrium. Though pairs trading is a simple market neutral strategy, it has been used and discussed extensively by industrial practitioners in the last several decades; see detailed discussion in Vidyamurthy (2004), Whistler (2004), Ehrman (2006), Lai and Xing (2008), and references therein.

Besides its wide practice in financial industry, pairs trading also draws much attention from academic researchers. For instance, Gatev et al. (2006) examined the risk and returns of pairs trading using daily data collected from the U.S. equity market and concluded that the strategy in general produces profit higher than transaction costs. To investigate the pairs trading strategy analytically, Elliott et al. (2005) modeled the spread of returns as a mean-reverting process and proposed a trading strategy based on the model. This motivates subsequent researchers to formulate pairs trading rules as stochastic control problems for an Ornstein–Uhlenbeck (OU) process and a correlated stock price process. In particular, Mudchanatongsuk et al. (2008) assumed the log-relationship between a pair of stock prices follows a mean-reverting process, and considered a self-financing portfolio strategy that only allows positions that were long in one stock and short in the other with equal dollar amounts. They then formulated a portfolio optimization based stochastic control problem and obtained the optimal solution to this control problem in closed form via the corresponding Hamilton–Jacobi–Bellman (HJB) equation. Relaxing the

**Citation:** Xing, Haipeng. 2022. A Singular Stochastic Control Approach for Optimal Pairs Trading with Proportional Transaction Costs. *Journal of Risk and Financial Management* 15: 147. https:// doi.org/10.3390/jrfm15040147

Academic Editor: David Allen

Received: 14 February 2022 Accepted: 12 March 2022 Published: 23 March 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

equal dollar constraint, Tourin and Yan (2013) extended Mudchanatongsuk et al. (2008)'s approach and study pairs trading strategies with arbitrary amounts in each stock without any transaction costs.

Instead of deriving optimal weights of stocks in pairs trading, another line of study on pairs trading strategies fixes the number of traded shares for each stock during the entire trading process and considers only the optimal timing of trades in the presence of fixed or proportional transaction costs. Specifically, Leung and Li (2015) studies the optimal timing to open or close the position subject to fixed transaction costs and the effect of stop-loss level under the OU process by constructing the value function directly. Zhang and Zhang (2008), Song and Zhang (2013), and Ngo and Pham (2016) studied the optimal pairs trading rule that is based on optimal switching among two (buy and sell) or three (buy, sell, and flat) regimes with a fixed commission cost for each transaction, and solve the problem by finding viscosity solutions to the associated HJB equations (quasi-variational inequalities). Lei and Xu (2015) studied the optimal pairs trading rule of entering and exiting the asset market in finite horizon with proportional transaction cost for two convergent assets. Note that, although transaction costs are considered in these strategies, since the number of traded shares of stocks are fixed during the entire trading period, these strategies are still far from traders' practical experience in reality.

The above study on optimal pairs trading focuses either on optimal trading shares without transaction costs or optimal trading times with fixed trading shares in the presence of transaction costs. To relax the assumption of fixed trading shares in the latter study, this paper uses a singular stochastic control approach to study the joint effect of optimal trading shares and optimal trading times in pairs trading process with proportional transaction costs. For convenience, we assume the same diffusion and Urnstein–Uhlenbeck processes for one stock and its spread with the other stock as those in Mudchanatongsuk et al. (2008). However, different from Mudchanatongsuk et al. (2008) who used a trading rule which requires to short one stock and long the other in equal dollar amounts, we consider a delta-neutral rule under which the ratio of traded shares for two stocks is fixed and this fixed ratio is determined by the cointegration relationship of two stocks. Hence, when the number of shares of one stock is determined, based on the rule of delta neutral, the number of shares for the other stock is also determined. Besides the weight of shares need to be optimally chosen, we also assume a proportional transaction cost for each trade and hence the optimal times of trading also needs to be decided.

With the above assumptions, we solve the optimal pair trading problem by the singular stochastic control approach in Davis et al. (1993). As the overall transaction cost based on the above assumption depends on both trading times and the numbers of shares in each trade, we compute the terminal utility of wealth over a fixed horizon and formulate the problem of choosing optimal trading times and the number of shares as a singular stochastic control problem. We derive the Hamilton–Jacobi–Bellman equations for this problem, and show that the value function of the problem is the unique viscosity solution of a quasi-variational inequality. We further argue that the quasi-variational inequality is equivalent to a free boundary problem so that the state space consisting of one stock price and its spread with the other stock can be naturally divided into three transaction regions: long the first stock and short the second, short the first and long the second, and no transaction. The implied transaction regions can help us determine not only optimal times of each transaction, but also the optimal number of shares in each transaction. To compute the boundaries of these transaction regions, we develop a numerical algorithm that is based on discrete time dynamic programming to solve the equation for the negative exponential utility function, and show that the numerical solution converges to the unique continuous-time solution of the problem.

To demonstrate the advantage of joint consideration of optimal shares and optimal trading times in pair trading, we carry out both simulation and empirical studies. Specifically, we study the time-varying transaction regions (or trading boundaries) for a specific set of model parameters, and investigate the impact of variations of model parameters on

transaction regions and performance of the optimal strategy. For comparison purposes, we also consider a benchmark strategy based on the deviation of the spread from its long-term mean and is popular among practitioners. In both simulation studies and real data analysis, we show that the optimal trading strategy performs better than the benchmark strategy.

The rest of the paper is organized as follows. Section 2 first formulates the model and then derive the Hamilton–Jacobi–Bellman equations associated with the singular stochastic control problems. It shows the existence and uniqueness of the viscosity solution for the variational inequalities, which are equivalent to the portfolio optimization problem, and reduces the problem into a free boundary problem. Section 2 also considers the optimal trading problem with exponential utility functions. In Section 3, we discretize the free boundary problem and propose a discrete time dynamic programming algorithm. We also demonstrate that the solution of the discretized problem converges to the viscosity solution of the variational inequalities. Sections 4 and 5 provide simulation and empirical studies of the model and the optimal trading strategy, and compare its performance with a benchmark trading strategy. Some concluding remarks are given in Section 6.

### **2. A Pairs Trading Problem with Proportional Transaction Costs**

### *2.1. Model Specification*

Consider a pair of two stocks *P* and *Q*, and let *p*(*t*) and *q*(*t*) denote their prices at time *t*, respectively. We assume that the price of stock *P* follows a geometric Brownian motion,

$$dp(t) = \mu p(t)dt + \sigma p(t)dB(t),\tag{1}$$

where *μ* and *σ* are the drift and the volatility of stock *P*, and *B*(*t*) is a standard Brownian motion defined on a filtered probability space and specified later. Denote *x*(*t*) the difference of the logarithms of the two stock prices, i.e.,

$$\mathbf{x}(t) = \log q(t) - \log p(t) = \log(q(t)/p(t)).\tag{2}$$

We assume that the spread follows an Ornstein–Uhlenbeck process

$$d\mathbf{x}(t) = \mathbf{x}(\theta - \mathbf{x}(t))dt + \nu dW(t),\tag{3}$$

where *κ* > 0 is the speed of mean reversion, and *θ* is the long-term equilibrium level to which the spread reverts. We assume that (*B*(*t*), *W*(*t*)) is a two-dimensional Brownian motion defined on a filtered probability space (Ω, <sup>F</sup>*t*, ), and the instantaneous correlation coefficient between *B*(*t*) and *W*(*t*) is *ρ*, i.e.,

$$E[dW(t)dB(t)] = \rho dt.\tag{4}$$

The above assumptions are same as those in Mudchanatongsuk et al. (2008). With these assumptions, we can express the dynamics of *q*(*t*) as

$$d\eta(t) = \left[\mu + \kappa(\theta - \mathbf{x}(t)) + \frac{1}{2}\nu^2 + \rho\nu\nu\right]q(t)dt + \sigma q(t)dB(t) + \nu q(t)dW(t). \tag{5}$$

In the presence of proportional transaction costs, the investor pays 0 < *ζ <sup>p</sup>*, *ζ<sup>q</sup>* < 1 and 0 < *ηp*, *η<sup>q</sup>* < 1 of the dollar value transacted on purchase and sale of the underlying stocks *P* and *Q*. Denote *Lp*(*t*) and *Mp*(*t*) two nondecreasing and non-anticipating processes and represent the cumulative number of shares of stock *P* bought or sold, respectively, within the time interval [0, *t*], 0 ≤ *t* ≤ *T*. Let *yp*(*t*) be the number of shares held in stock *P*, i.e., *yp*(*t*) = *Lp*(*t*) − *Mp*(*t*), and similarly, we define *Lq*(*t*), *Mq*(*t*), and *yq*(*t*) = *Lq*(*t*) − *Mq*(*t*) for stock *Q*. Denote *g*(*t*) the dollar value of the investment in bond which pays a fixed risk-free rate of *r*. Then, the investor's position in two stocks and the bond is driven by

$$dy\_p(t) = dL\_p(t) - dM\_p(t), \qquad dy\_q(t) = dL\_q(t) - dM\_q(t) \tag{6}$$

and

$$dg(t) = r\lg(t)dt + b\_p p(t)dM\_p(t) - a\_q q(t)dL\_q(t) + b\_q q(t)dM\_q(t) - a\_p p(t)dL\_p(t), \quad (7)$$

where *ai* = 1 + *ζ<sup>i</sup>* and *bi* = 1 − *η<sup>i</sup>* for *i* = *p*, *q*.

We then need to choose a rule to determine the number of shares of stocks *P* and *Q* bought or sold at time *t*. Note that, Mudchanatongsuk et al. (2008) assumed no transaction cost and considered the strategy that always shorts one stock and longs the other in equal dollar amount, i.e., *p*(*t*)*dLp*(*t*) + *q*(*t*)*dMq*(*t*) = 0 or *p*(*t*)*dMp*(*t*) + *q*(*t*)*dLq*(*t*) = 0 at time *t*. Lei and Xu (2015) and Ngo and Pham (2016) considered a delta-neutral strategy that always long one share of a stock and short one share of the other stock, i.e., *dyp*(*t*) = −*dyq*(*t*) = 1 or *dyp*(*t*) = −*dyq*(*t*) = −1 at time *t*. Here, we also consider a delta-neutral strategy that requires the total of positive and negative delta of two assets is zero, hence it suggests that the number of shares of stock *P* bought (or sold) at time *t* are same as the number of shares of stock *Q* sold (or bought), i.e.,

$$dL\_p(t) = dM\_\emptyset(t), \qquad dM\_p(t) = dL\_\emptyset(t). \tag{8}$$

Equation (8) implies that

$$dy\_q(t) = -dy\_p(t)$$

at any time *t*. Comparing to Lei and Xu (2015) and Ngo and Pham (2016), we remove the constraint *dyp*(*t*) = −*dyq*(*t*) = 1 or −1 and allow *yp*(*t*) = −*yq*(*t*) to be a control variable. Using Equations (5) and (8), the dynamics of *g*(*t*) in Equation (7) can be simplified as

$$d\lg(t) = r\lg(t)dt - \left(a\_{\mathcal{P}} - b\_{\mathcal{q}}e^{\mathbf{x}(t)}\right)p(t)dL\_{\mathcal{P}}(t) + \left(b\_{\mathcal{P}} - a\_{\mathcal{q}}e^{\mathbf{x}(t)}\right)p(t)dM\_{\mathcal{P}}(t). \tag{9}$$

The process (*Lp*(*t*), *Mp*(*t*)) together with our delta-neutral strategy provides us an admissible trading strategy. For convenience, we denote T (*g*0) the set of admissible trading strategies that an investor starts at time zero with amount *g*<sup>0</sup> of the investment in bond and zero holdings in two stocks (i.e., *yp*(0) = *yq*(0) = 0), which indicates that the numbers of shares held in stocks *P* and *Q* at time *t* are *yp*(*t*) and −*yp*(*t*), respectively. For notational convenience, we omit the subscript of *yp*(*t*) and denote *yp*(*t*) as *y*(*t*) in our discussion. Then, Equations (1), (3), (6) and (9) compose the market model in the time interval [0, *T*], which describes a stochastic process of (*p*(*t*), *<sup>x</sup>*(*t*), *yp*(*t*), *<sup>g</sup>*(*t*)) in <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> .

Denote the terminal value of the pairs trading portfolio by *J*(*x*(*T*), *p*(*T*), *y*(*T*)). Note that, under our assumption, *y*(*T*) indicates that the investor's positions in stocks *P* and *Q* are *y*(*T*) and −*y*(*T*), respectively, then the liquidated value of the portfolio is

$$f(p(T), \mathbf{x}(T), y(T)) = A\_+(p(T), \mathbf{x}(T))y(T)\mathbf{1}\_{\{y(T) \ge 0\}} + A\_-(p(T), \mathbf{x}(T))y(T)\mathbf{1}\_{\{y(T) < 0\}}, \tag{10}$$

where

$$A\_+(p, \mathbf{x}) = (b\_p - a\_q e^{\mathbf{x}}) p\_\prime \qquad A\_-(p, \mathbf{x}) = (a\_p - b\_q e^{\mathbf{x}}) p\_\prime$$

Furthermore, if the investment in bond at terminal time *T* is *g*(*T*), the terminal wealth of the investor is given by *g*(*T*) + *J*(*p*(*T*), *x*(*T*), *y*(*T*)). Suppose that the investor's utility *<sup>U</sup>* : −→ is a concave and increasing function with *<sup>U</sup>*(0) = 0. We assume that the investor's goal is to maximize the expected utility of terminal wealth under the market model (1), (3), (6) and (9),

$$V(t, p, \mathbf{x}, \mathbf{y}, \mathbf{g}) = \sup\_{(L\_p(t), M\_p(t)) \in \mathcal{T}(\mathbf{g}\_0)} \mathbb{E}\left\{ \mathcal{U}(\mathbf{g}(T) + J(p(T), \mathbf{x}(T), \mathbf{y}(T)) | p(t) = p, \mathbf{y} \right\} \tag{11}$$

$$\mathbf{x}(t) = \mathbf{x}, \mathbf{y}\_t = \mathbf{y}, \mathbf{g}(t) = \mathbf{g} \right\}. \tag{12}$$

Furthermore, given trading strategies (*Lp*, *Mp*), the total trading cost incurred over [*t*, *T*] can be expressed as

$$\begin{aligned} \mathbb{C}(\mathcal{L}\_p, M\_p; t, T) &= \int\_t^T \boldsymbol{\varepsilon}^{r(T-u)} A\_- (p(u), \boldsymbol{x}(u)) dL\_p(u) - \int\_t^T \boldsymbol{\varepsilon}^{r(T-u)} A\_+ (p(u), \boldsymbol{x}(u)) dM\_p(u) \\ &- \mathbb{I}(p(T), \boldsymbol{x}(T), \boldsymbol{y}(T)). \end{aligned} \tag{12}$$

and the total profit over [*t*, *T*] is −*C*(*Lp*, *Mp*; *t*, *T*).

### *2.2. The Hamilton-Jacobi-Bellman Equations and Free Boundary Problems*

We now derive the Hamilton–Jacobi–Bellman (HJB) equations, associated with the stochastic control problems, for the utility maximization problem (11). Consider a class of trading strategies such that *Lp*(*t*) and *Mp*(*t*) are absolutely continuous processes, given by

$$L\_{\mathcal{P}}(t) = \int\_0^t l(u) du, \qquad M\_{\mathcal{P}}(t) = \int\_0^t m(u) du,$$

where *l*(*u*) and *m*(*u*) are positive and uniformly bounded by *ξ* < ∞. Then, (1), (3), (6) and (9) provides us a system of stochastic differential equations with controlled drift, and the Bellman equation for a value function denoted by *V<sup>ξ</sup>* is

$$\mathcal{L}\_{1,\boldsymbol{\rho}}V^{\boldsymbol{\xi}} + \sup\_{0 \le l\_t, m\_t \le \boldsymbol{\xi}} \left\{ \left[ \mathcal{L}\_{1,\boldsymbol{\rho}}V^{\boldsymbol{\xi}} \right] l\_t - \left[ \mathcal{L}\_{1,\boldsymbol{\rho}}V^{\boldsymbol{\xi}} \right] m\_t \right\} = 0,$$

for (*t*, *<sup>p</sup>*, *<sup>X</sup>*, *<sup>y</sup>*, *<sup>g</sup>*) <sup>∈</sup> [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> , in which the operators <sup>L</sup>, <sup>B</sup>, and <sup>S</sup> are defined as

$$\mathcal{L}\_{1,b} := \frac{\partial}{\partial t} + \kappa(\theta - \mathbf{x})\frac{\partial}{\partial \mathbf{x}} + \mu p \frac{\partial}{\partial p} + r g \frac{\partial}{\partial g} + \frac{1}{2} \nu^2 \frac{\partial^2}{\partial \mathbf{x}^2} + \rho \nu \upsilon p \frac{\partial^2}{\partial p \partial \mathbf{x}} + \frac{1}{2} \sigma^2 p^2 \frac{\partial^2}{\partial p^2},$$

$$\mathcal{L}\_{1,b} := \frac{\partial}{\partial y} - \left(a\_p - b\_q \boldsymbol{\epsilon}^{x(t)}\right) p(t) \frac{\partial}{\partial g},$$

$$\mathcal{L}\_{1,\boldsymbol{\epsilon}} := \frac{\partial}{\partial y} - \left(b\_p - a\_q \boldsymbol{\epsilon}^{x(t)}\right) p(t) \frac{\partial}{\partial g}.$$

The optimal trading strategy is then determined by considering the following three possible cases:

(i) buying stock *P* and sell stock *Q* at the same rate *l*(*t*) = *ξ* (i.e., *m*(*t*) = 0) when

$$
\mathcal{L}\_{1,b} V^{\mathbb{Z}} \ge 0, \qquad \mathcal{L}\_{1,s} V^{\mathbb{Z}} \gg 0; \tag{13}
$$

(ii) selling stock *P* and buy stock *Q* at rate *m*(*t*) = *ξ* (i.e., *l*(*t*) = 0) when

$$
\mathcal{L}\_{1,b} V^{\frac{\pi}{5}} < 0, \qquad \mathcal{L}\_{1,s} V^{\frac{\pi}{5}} \le 0; \tag{14}
$$

(iii) doing nothing (i.e., *l*(*t*) = *m*(*t*) = 0) when

$$
\mathcal{L}\_{1,b}V^{\mathbb{F}} \le 0, \qquad \mathcal{L}\_{1,s}V^{\mathbb{F}} \ge 0. \tag{15}
$$

Note that the case <sup>L</sup>1,*bV<sup>ξ</sup>* <sup>&</sup>gt; 0 and <sup>L</sup>1,*sV<sup>ξ</sup>* <sup>&</sup>lt; 0 can not occur, as all value functions are increasing functions of *g*.

The above argument shows that the optimization problem (11) is a free boundary problem in which the optimal trading strategy is defined by the inequalities (i), (ii), and (iii) for a given value function. Besides, the state space [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> is partitioned into *buy*, *sell*, and *no-transaction* regions for stock *P*, which are characterized by inequalities (13), (14) and (15), respectively. For sufficiently large *ξ*, the state space remains divided into a *buy region* B, a *sell region* S, and a *no-transaction region* N for stock *P*, which

are correspondingly the *sell region*, the *buy region*, and the *no transaction region* for stock *Q* due to Equation (8). Obviously, the buy and sell regions for stock *P* are disjoint, as it is not optimal to buy and sell the same stock at the same time. We denote the boundaries between the no-transaction region N and the buy and sell regions B and S as *∂*B and *∂*S, respectively.

Let *ξ* → ∞, the class of admissible trading strategies becomes T (*g*0). We can guess that the state space is still divided into three regions, a region of buying *P* and selling *Q*, a region of selling *P* and buying *Q*, and a no-transaction region. Then, the optimal trading strategy requires an immediate move to the boundaries of buy or sell regions, if the state is in the buy region B or the sell region S. Actually, we can obtain equations that each of the value functions should satisfy as follows.

(i) In region B of buying *P* and selling *Q*, the value function remains constant along the path of the state, dictated by the optimal trading strategy, and therefore, for *δy* ≥ 0

$$V(t, p, \mathbf{x}, y, \mathbf{g}) = V(t, p, \mathbf{x}, y + \delta y, \mathbf{g} - (a\_p - b\_q e^{\mathbf{x}}) p\delta y),\tag{16}$$

where *δy* is the number of shares of stock *P* bought and stock *Q* sold by the investor. *δy* can be any positive value up to the number required to take the state to *∂*B, so letting *δy* → 0 in (16) yields

$$
\mathcal{L}\_{1,b}V = 0.\tag{17}
$$

(ii) Similarly, in region S of selling *P* and buying *Q*, the value function obeys the following equation for *δy* ≥ 0

$$V(t, p, \mathbf{x}, y, \mathbf{g}) = V(t, p, \mathbf{x}, y - \delta y, \mathbf{g} + (b\_p - a\_q e^x) p\delta y),\tag{18}$$

where *δy* is the number of shares of stock *P* sold and stock *Q* bought by the investor. *δy* can be any positive value up to the number required to take the state to *∂*S, so letting *δy* → 0 in (18) yields

$$
\mathcal{L}\_{1,s}V = 0.\tag{19}
$$

(iii) In the no-transaction region, the value function obeys the same set of equations obtained for the class of absolutely continuous trading strategies, and therefore the value function is given by

$$
\mathcal{L}\_{1,\rho}V = 0,\tag{20}
$$

and the pair of inequalities, shown above in (15), also hold. Note that, due to the continuity of the value function, if it is known in the no-transaction region, it can be determined in both the buy and sell regions by (17) and (19), respectively.

In the buy region B, L1,*sV* < 0, and, in the sell region S, L1,*bV* > 0. Additionally, from the two pairs of inequalities (13) and (14), we may conjecture that L1,*oV* in (20) is negative in both the buy region B and the sell region S. Therefore, the above set of equations can be summarized as the following fully nonlinear partially differential equations (PDE):

$$\min\left\{-\mathcal{L}\_{1,b}V, \mathcal{L}\_{1,s}V, -\mathcal{L}\_{1,o}V\right\} = 0\tag{21}$$

for (*t*, *<sup>p</sup>*, *<sup>X</sup>*, *<sup>y</sup>*, *<sup>g</sup>*) <sup>∈</sup> [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> . Note that the above discussion also yields the following free boundary problem for the singular stochastic control value function:

$$\begin{cases} \begin{array}{rcl} \mathcal{L}\_{1,b}V &=& 0 \\ \mathcal{L}\_{1,s}V &=& 0 \\ \mathcal{L}\_{1,\rho}V &=& 0 \\ V(T,p,\mathbf{x},\mathbf{y},\mathbf{g}) &=& \mathcal{U}(\mathbf{g}+\mathbf{J}(p,\mathbf{x},\mathbf{y})) \end{array} \end{cases} \text{ in } \mathcal{S}$$

We next show that the value function given by (11) is a constrained viscosity solution of the variational inequality (21) on [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> , and it is the unique bounded constrained viscosity solution of (21). The proof is given in the Appendix A.

**Theorem 1.** *The value function V*(*t*, *p*, *x*, *y*, *g*) *is a constrained viscosity solution of* (21) *on* [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> *.*

**Theorem 2.** *Let u be a bounded upper semicontinuous viscosity subsolution of* (21)*, and v a bounded from below lower semicontinuous viscosity supersolution of* (21)*, such that u*(*T*, **x**) ≤ *<sup>v</sup>*(*T*, **<sup>x</sup>**) *for all* **<sup>x</sup>** <sup>∈</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> *. Then u* <sup>≤</sup> *v on* [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> *.*

### *2.3. Optimal Trading with Exponential Utility Functions*

We next assume that the investor has the negative exponential utility function

$$\mathcal{U}(z) = 1 - \exp(-\gamma z),\tag{23}$$

where *γ* is the constant absolute risk aversion (CARA) parameter such that −*U*(*z*) *U* (*z*) = *γ*. For Equation (21), this utility function can reduce much of computational effort and is easy to interpret. Note that for the utility function (23), the definition of the value function (11) can be expressed as

$$V(t, p, \mathbf{x}, \mathbf{y}, \mathbf{g}) = 1 - \exp\left(-\gamma g e^{r(T-t)}\right) H(t, p, \mathbf{x}, \mathbf{y}),\tag{24}$$

where *H*(*t*, *p*, *x*, *y*) is a convex nonincreasing continuous function in *y* and defined by

$$\begin{aligned} \left(H(t, p, \mathbf{x}, y)\right)\_{\mathbf{x}} &= \inf\_{\mathbf{L}, p(\mathbf{t}), \mathcal{M}\_p(\mathbf{t}) \in \mathcal{T}(\varrho\_0)} \mathbb{E}\left\{ \exp[-\gamma I(p(\mathbf{T}), \mathbf{x}(T), y(T))] \, \middle|\, p(\mathbf{t}) = p, \mathbf{x}(\mathbf{t}) = \mathbf{x}, y(\mathbf{t}) = y \right\} \\ &= \mathbf{1} - V(\mathbf{t}, p, \mathbf{x}, y, \mathbf{0}). \end{aligned}$$

Plug (24) into (21), and define the following operators for *<sup>H</sup>*(*t*, *<sup>p</sup>*, *<sup>x</sup>*, *<sup>y</sup>*) on [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> ,

$$
\mathcal{L}\_{2,o}H = \frac{\partial H}{\partial t} + \kappa(\theta - x)\frac{\partial H}{\partial x} + \mu p \frac{\partial H}{\partial p} + \frac{1}{2}\nu^2 \frac{\partial^2 H}{\partial x^2} + \rho \nu \sigma p \frac{\partial^2 H}{\partial p \partial x} + \frac{1}{2}\sigma^2 p^2 \frac{\partial^2 H}{\partial p^2},
$$

$$
\mathcal{L}\_{2,b}H = \frac{\partial H}{\partial y} + \gamma \epsilon^{r(T-t)} A\_{-}(p, x)H,
$$

$$
\mathcal{L}\_{2,s}H = \frac{\partial H}{\partial y} + \gamma \epsilon^{r(T-t)} A\_{+}(p, x)H.
$$

Then (21) is transformed into the following PDE for *H*(*t*, *p*, *x*, *y*)

$$\min \left\{ \mathcal{L}\_{2,b}H, -\mathcal{L}\_{2,s}H, \mathcal{L}\_{2,\rho}H \right\} = 0 \tag{25}$$

with the following boundary conditions

$$H(T, p, \mathbf{x}, y) = \exp\left\{-\gamma J(p, \mathbf{x}, y)\right\}.$$

Correspondingly, the free boundary problem (22) becomes

$$\begin{cases} \begin{array}{lcll} \mathcal{L}\_{2,\rho}H &=& 0 \\ \mathcal{L}\_{2,b}H &=& 0 \\ \mathcal{L}\_{2,s}H &=& 0 \\ H(T,p,\mathbf{x},\mathbf{y}) &=& \exp\left\{-\gamma I(p,\mathbf{x})\right\} \end{array} & \begin{array}{lcll} \mathcal{Y} & \in \left[\mathcal{Y}\_{b}(t,p,\mathbf{x}),\mathcal{Y}\_{s}(t,p,\mathbf{x})\right] \\ \mathcal{Y} & \in \mathcal{Y}\_{b}(t,p,\mathbf{x}) \\ \mathcal{Y} & \mathcal{Y}\_{s}(t,p,\mathbf{x}) \end{array} \\ \end{cases} \tag{26}$$

in which *Yb*(*t*, *p*, *x*) and *Ys*(*t*, *p*, *x*) are the buy and sell boundaries for stock *P*, respectively. Note that the function *<sup>H</sup>*(*t*, *<sup>p</sup>*, *<sup>x</sup>*, *<sup>y</sup>*) is evaluated in the four-dimensional space [0, *<sup>T</sup>*] <sup>×</sup> <sup>×</sup> <sup>×</sup> . Furthermore, this suggests that while (*t*, *ut*, *wt*) is inside the no-transaction region, the dynamics of *h*(*t*, *u*, *w*, *y*) are driven by two-dimensional standard Brownian motions

{*zt*, *t* ≥ 0} and {*wt*, *t* ≥ 0} with correlation *ρ*. In the buy and sell regions, it follows from (26) that

$$\begin{aligned} H(t, p, \mathbf{x}, y) &= \exp\{-\gamma e^{r(T-t)} A\_{-}(p, \mathbf{x}) [y - \mathbf{Y}\_b(t, p, \mathbf{x})] \} H(t, p, \mathbf{x}, \mathbf{Y}\_b(t, p, \mathbf{x})), \quad y \le \mathbf{Y}\_b(t, p, \mathbf{x}), \\ H(t, p, \mathbf{x}, y) &= \exp\{-\gamma e^{r(T-t)} A\_{+}(p, \mathbf{x}) [y - \mathbf{Y}\_s(t, p, \mathbf{x})] \} H(t, p, \mathbf{x}, \mathbf{Y}\_s(t, p, \mathbf{x})), \quad y \ge \mathbf{Y}\_b(t, p, \mathbf{x}). \end{aligned}$$

### **3. Discretization and a Numerical Algorithm**

The solution of the PDE (21) or (25) can be obtained by turning the stochastic differential Equations (1), (3), (6) and (9) into Markov chains and then applying the discrete time dynamic programming algorithm. The discrete state is = (*χ*, -, , *ϑ*, ), whose elements denote time, price of stock *P*, spread, number of shares of stock *P*, and amount in the bank in a discrete space. The value function, denoted by , are given a value at the final time by using the boundary conditions for the continuous value functions over the discrete subspace (-, , *ϑ*, ), and then they are estimated by proceeding backward in time by using the discrete time algorithm. As in the continuous time case, this algorithm is the same for both value functions and is derived below for a value function denoted by *δ*(*χ*, -, , *ϑ*, ), where *ρ* is a discretization parameter, which depends on the discrete time interval *tδ*. If *t<sup>δ</sup>* and the resolution of the *ϑ*-axis *ϑδ* are sent to zero, then the above discrete value function converges to a viscosity subsolution and a viscosity supersolution of the PDE (21). Therefore, all the discrete value functions converge to their continuous counterparts; this is due to the uniqueness of the viscosity solution.

Consider an evenly spaced partition of the time interval [0, *T*]: *χ* = {*δ*, 2*δ*, ... , *nδ*}, where *δ* = *T*/*n*, and two evenly spaced partitions of the space intervals = {0, ± <sup>√</sup>*δ*, <sup>±</sup><sup>2</sup> <sup>√</sup>*δ*, ... , } and = {0, ± <sup>√</sup>*δ*, <sup>±</sup><sup>2</sup> <sup>√</sup>*δ*, ... , }. The grid is defined by via the following transformation,

$$\mathbb{p}\_{i} = \exp\left( (\mu - \frac{1}{2}\sigma^{2})T + \mathbb{x}\_{i}\sigma\sqrt{T} \right). \tag{27}$$

Note that the SDE (3)implies that the asymptotic distribution of *X*(*t*)is Normal(*θ*, *ν*2/(2*κ*)), we define grid by

$$\mathbf{x}\_{j} = \theta + \frac{\nu}{\sqrt{2\kappa}} \mathbf{w}\_{j}. \tag{28}$$

Denote *χ<sup>i</sup>* = *iδ* for *i* = 1, ... , *n* − 1. The dynamics (1) and (3) of *P*(*t*) and *X*(*t*) implies the following transition density for (-(*χi*), (*χi*)),

$$
\begin{pmatrix} \mathbf{p}(\boldsymbol{\chi}\_{i+1}) \\ \mathbf{x}\_{\boldsymbol{\chi}\_{i+1}} \end{pmatrix} \begin{pmatrix} \mathbf{p}(\boldsymbol{\chi}\_{i}) \\ \mathbf{x}\_{\boldsymbol{\chi}\_{i}} \end{pmatrix} \sim N \left( \begin{pmatrix} \log \mathbf{p}(\boldsymbol{\chi}\_{i}) + (\boldsymbol{\mu} - \frac{1}{2} \sigma^{2}) \delta \\ (1 - \delta \kappa) \mathbf{x}(\boldsymbol{\chi}\_{i}) + \delta \kappa \theta \end{pmatrix} \prime \begin{pmatrix} \delta \sigma^{2}, \delta \rho \sigma \boldsymbol{\nu} \\ \delta \rho \sigma \boldsymbol{\nu}, \delta \boldsymbol{\nu}^{2} \end{pmatrix} \right). \tag{29}
$$

We also note that the discrete time equation for the amount in the bank (*χ*) is

$$\lg(\chi\_{i+1}) = \lg(\chi\_i) \exp(r\delta).$$

Given the grid defined above, the discrete time dynamic programming principle is invoked, and the following discretization scheme is proposed for PDE (21):

$$\begin{split} \mathbb{V}^{\delta}(\chi\_{i\prime}\mathbb{p}(\chi\_{i}), \mathbb{x}(\chi\_{i}), \theta, \mathbb{g}(\chi\_{i})) &= \max \left\{ \\ \mathbb{V}^{\delta}(\chi\_{i\prime}\mathbb{p}(\chi\_{i}), \mathbb{x}(\chi\_{i}), \theta + \mathbb{g}\_{\prime}\mathbb{g}(\chi\_{i}) - (a\_{p} - b\_{q}e^{\mathbb{x}(\chi\_{i})})\mathbb{p}(\chi\_{i})\mathbb{g}), \\ \mathbb{V}^{\delta}(\chi\_{i\prime}\mathbb{p}(\chi\_{i}), \mathbb{x}(\chi\_{i}), \theta - \mathbb{g}\_{\prime}\mathbb{g}(\chi\_{i}) + (b\_{p} - a\_{q}e^{\mathbb{x}(\chi\_{i})})\mathbb{p}(\chi\_{i})\mathbb{g}), \\ \mathbb{E}\left\{\mathbb{V}^{\delta}\left(\chi\_{i+1\prime}\mathbb{p}(\chi\_{i+1}), \mathbb{x}(\chi\_{i+1}), \theta, \mathbb{g}(\chi\_{i+1})\right)\right\} \right\}. \end{split} \tag{30}$$

where *ξ* > 0 is a real constant and *i* = 0, ... , *n* − 1. This scheme is based on the principle that the investor's policy is the choice of the optimum transaction. We next show that, as the discretization parameter *<sup>δ</sup>* <sup>→</sup> 0, the solution *<sup>δ</sup>* of (30) converges to the value function *V*, or, equivalently, to the unique constrained viscosity solution of (21).

**Theorem 3.** *The solution <sup>δ</sup> of* (30) *converges locally uniformly as <sup>δ</sup>* <sup>→</sup> <sup>0</sup> *to the unique continuous constrained viscosity solution of* (21)*.*

For the exponential utility function *U*(*z*) = 1 − exp(−*γz*), the value function *V* can be expressed as (24), and its discretization scheme is given by

$$\mathbb{V}^{\delta}(\chi\_i, \mathbb{p}(\chi\_i), \mathbf{z}(\chi\_i), \theta, \mathbf{g}(\chi\_i)) = 1 - \exp\left(-\gamma \mathbf{g}\left(\chi\_i\right) e^{r(T-\chi\_i)}\right) \mathbb{H}^{\delta}(\chi\_i, \mathbb{p}(\chi\_i), \mathbf{z}(\chi\_i), \theta).$$

Then, the discretization scheme (30) can be reduced to

$$\begin{split} \mathbb{H}^{\delta}(\chi\_{i}\mathbf{p}\,(\chi\_{i}),\mathbf{z}(\chi\_{i}),\boldsymbol{\theta}) &= \min \left\{ \, \mathrm{F}\_{\mathbb{P}}(\mathbf{p}\,(\chi\_{i}),\mathbf{z}(\chi\_{i}),\xi) \cdot \mathrm{H}^{\delta}(\chi\_{i},\mathbf{p}\,(\chi\_{i}),\mathbf{z}(\chi\_{i}),\boldsymbol{\theta}+\xi), \\ \mathrm{F}\_{\mathbb{P}}(\mathbf{p}\,(\chi\_{i}),\mathbf{z}(\chi\_{i}),\xi) \cdot \mathrm{H}^{\delta}(\chi\_{i},\mathbf{p}\,(\chi\_{i}),\mathbf{z}(\chi\_{i}),\boldsymbol{\theta}-\xi), \; \mathrm{E}\left\{ \mathrm{H}^{\delta}(\chi\_{i+1},\mathbf{p}\,(\chi\_{i+1}),\mathbf{z}(\chi\_{i+1}),\boldsymbol{\theta}) \right\} \right\}. \end{split} \tag{31}$$

where

$$F\_{\mathbb{P}}(\mathbb{p}(\chi\_i), \mathbb{x}(\chi\_i), \xi) = \exp\left\{\gamma \xi A\_-(\mathbb{p}(\chi\_i), \mathbb{x}(\chi\_i)) e^{r(T-\chi\_i)}\right\},$$

$$F\_{\mathbb{x}}(\mathbb{p}(\chi\_i), \mathbb{x}(\chi\_i), \xi) = \exp\left\{-\gamma \xi A\_+(\mathbb{p}(\chi\_i), \mathbb{x}(\chi\_i)) e^{r(T-\chi\_i)}\right\}.$$

### **4. Simulation Studies**

*4.1. Buy and Sell Regions*

We use the numerical algorithm proposed in Section 2 to studies the buy and sell boundaries of the pairs trading strategy. Our study focuses on two aspects of the problem. The first is the property of buy and sell boundaries (or no transaction regions) for a given set of model parameters, and the other is the impact of different model parameters on the shape of buy and sell boundaries. Without loss of the generality, we assume the time horizon *T* = 1 and *p*(0) = 1 in all our simulation studies.

We first consider a baseline scenario. The parameter values in the baseline scenario are *μ* = 0.2, *σ* = 0.4, *θ* = 0.1, *κ* = 1, *ν* = 0.15, *ρ* = 0.5,*r* = 0.01, *γ* = 5 and *ζ <sup>p</sup>* = *ζ<sup>q</sup>* = *ξ <sup>p</sup>* = *ξ<sup>q</sup>* = 0.0005. For convenience, we label the setting of the baseline parameter values as Scenario 1 or (S1). We discretize the state space (*t*, *p*, *x*, *y*, *g*) and use the developed Markov chain approximation to solve the discretized optimization problem. Figure 1 shows the buy and sell surfaces of (S1) at time *t* = 0.05, 0.35, 0.65, and 0.95. To better read the figure, we also show in Figures 2 and 3 the buy and sell boundaries of (S1) at prices *p* = 0.845, 1.095, 1.400, 2.108, and *x* = 0.023, 0.092, 0.157, 0.266, respectively. These points are chosen such that they correspond to the 24%, 48%, 72%, and 96% quantiles of the distribution of *p*(*T*) and asymptotic distribution of *x*(*t*), respectively. We find the following from these figures. First, at a given time and a given price level, the no transaction region becomes narrower when the spread gets larger, and the no transaction region moves from the negative to the positive when the spread turns from the negative to the positive. For example, at *t* = 0.05 and *p*(*t*) = 0.845, the no transaction region changes from [−9.4, −8.0] at *x*(*t*) = 0.023 to [−4.6, −3.4] at *x*(*t*) = 0.092, [−0.7, 0.2] at *x*(*t*) = 0.157, and [3.2, 3.7] at *x*(*t*) = 0.266. Second, at a given time and a given spread level, the no transaction region becomes narrower when the price *p*(*t*) gets larger, and the no transaction region moves up when the price becomes larger. For instance, at *t* = 0.05 and *x*(*t*) = 0.023, the no transaction region changes from [−9.4, −8.0] at *p*(*t*) = 0.845 to [−6.8, −5.6] at *p*(*t*) = 1.095, [−4.9, −3.9] at *p*(*t*) = 1.400, and [−2.7, −2.0] at *p*(*t*) = 2.108. Note that the movement of the no transaction region with respect to price change but with a fixed spread level is relatively smaller than that with respect to spread change but with a fixed price level. Third, when time ellipses from 0 to 1, the no transaction region moves upward. For instance, at the fixed price-spread level (*p*(*t*), *x*(*t*)) = (1.095, 0.092), the no transaction intervals at

*t* = 0.05, 0.35, 0.65 and 0.95 are [−2.6, −1.6], [−2.1, −1.2], [−1.5, −0.7], and [−0.8, −0.2], respectively.

**Figure 1.** Buy and sell boundaries of the baseline scenario (S1) at different times.

We then discuss the impact of different parameter values on the buy and sell boundaries (or no transaction regions). Besides the parameter values in (S1), we now consider other 18 sets of parameter values, labeled as Scenarios 2–19. In each of Scenarios 2–19, all parameters values are same as those in (S1) except one parameter is changed as the specification; see Table 1 that summarizes parameter values in all 19 scenarios. For example, Scenario 2 uses parameter values *μ* = 0.1 and assume all other parameters *σ*, *θ*, *κ*, *ν*, *ρ*,*r*, *γ* and *ζ <sup>p</sup>* = *ζ<sup>q</sup>* = *ξ <sup>p</sup>* = *ξ<sup>q</sup>* have same values as those in (S1). We discretize the state space (*t*, *p*, *x*, *y*, *g*), and use the developed Markov chain approximation to solve the discretized optimization problem for Scenarios 2–19.

**Figure 2.** Buy and sell boundaries of at prices *Pt* = 0.845 (**top left**), 1.095 (**top right**), 1.400 (**bottom left**), and 2.108 (**bottom right**) and different times.

**Figure 3.** Buy and sell boundaries of at spread *Xt* = 0.023 (**top left**), 0.092 (**top right**), 0.157 (**bottom left**), and 0.266 (**bottom right**) and different times.

To compare the buy and sell boundaries (or no transaction regions) among different scenarios, we plot the buy and sell boundaries over time at four fixed points (*p*(1) , *x*(1)) = (0.9, 0.09), (*p*(2) , *x*(2))=(0.9, 0.12), (*p*(3) , *x*(3))=(1.5, 0.09), and (*p*(4) , *x*(4))=(1.5, 0.12), respectively. Figures 4–12 demonstrate variations of the buy and sell boundaries over time for different values of *μ*, *σ*, *θ*, *κ*, *ν*, *ρ*, *r*, *γ*, *ζp*(= *ζ<sup>q</sup>* = *ξ<sup>p</sup>* = *ξq*), respectively. In each figure, we plot the buy and sell boundaries for (*p*(*i*) , *x*(*i*)), *i* = 1, 2, 3, 4 on the top left, top right, bottom left, and bottom right, respectively, we also use the solid (dashed, dotted) lines to represent the baseline value (the smaller value, the larger value) of the parameter under comparison. Figure 4 suggests that when *μ* increases, the buy and sell boundaries move downward at all four points. Figure 5 indicates that when *σ* increases, the buy and sell boundaries move upward at (*p*(1) , *x*(1)) and (*p*(2) , *x*(2)), but move downward at (*p*(3) , *x*(3)) and (*p*(4) , *x*(4)). Figure 6 shows that, when *θ* increases, the buy and sell boundaries move downward at all four points. Figure 7 indicates that, when *κ* increases, the buy and sell boundaries move downward, and the magnitude of such movement is larger at (*p*(1) , *x*(1)) than the other three points. Figure 8 shows that, when *ν* increases, the buy and sell boundaries move upward at (*p*(*i*) , *x*(*i*)), *i* = 1, 2, 3, but move downward at (*p*(4) , *x*(4)). Figure 9 suggests that, when the correlation *ρ* changes from the negative to the positive, the buy and sell boundaries move downwards at (*p*(1) , *x*(1)) and (*p*(2) , *x*(2)), but move upward at (*p*(3) , *x*(3)) and (*p*(4) , *x*(4)). Figure 10 indicates that variations of interest rate *r* have little impact on the buy and sell boundaries. Figure 11 shows that, when the risk aversion parameter *γ* increases, the buy and sell boundaries move upward at (*p*(*i*) , *x*(*i*)), *i* = 1, 2, 3, but move downward at (*p*(4) , *x*(4)). Figure 12 suggests that, when the transaction cost increases, the center of the no transaction region seems to not change, but the region gets wider.

**Table 1.** Parameter values of different scenarios.


**Figure 4.** Buy and sell boundaries of at fixed prices (*p*(*i*), *x*(*i*)), *i* = 1, 2, 3, 4 for *μ* = 0.1 (dashed), 0.2 (solid), 0.3 (dotted).

**Figure 5.** Buy and sell boundaries of at fixed price (*p*(*i*), *x*(*i*)), *i* = 1, 2, 3, 4 for *σ* = 0.2 (dashed), 0.4 (solid), 0.6 (dotted).

**Figure 6.** Buy and sell boundaries of at fixed price (*p*(*i*), *<sup>x</sup>*(*i*)), *<sup>i</sup>* <sup>=</sup> 1, 2, 3, 4 for *<sup>θ</sup>* <sup>=</sup> <sup>−</sup>0.05 (dashed), 0.1 (solid), 0.3 (dotted).

**Figure 7.** Buy and sell boundaries of at fixed price (*p*(*i*), *x*(*i*)), *i* = 1, 2, 3, 4 for *κ* = 0.8 (dashed), 1 (solid), and 1.2 (dotted).

**Figure 8.** Buy and sell boundaries of at fixed price (*p*(*i*), *x*(*i*)), *i* = 1, 2, 3, 4 for *ν* = 0.1 (dashed), 0.15 (solid), and 0.2 (dotted).

**Figure 9.** Buy and sell boundaries of at fixed price (*p*(*i*), *<sup>x</sup>*(*i*)), *<sup>i</sup>* <sup>=</sup> 1, 2, 3, 4 for *<sup>ρ</sup>* <sup>=</sup> <sup>−</sup>0.2 (dashed), 0.5 (solid), and 0.6 (dotted).

**Figure 10.** Buy and sell boundaries of at fixed price (*p*(*i*), *x*(*i*)), *i* = 1, 2, 3, 4 for *r* = 0.005 (dashed), 0.01 (solid), and 0.03 (dotted).

**Figure 11.** Buy and sell boundaries of at fixed price (*p*(*i*), *x*(*i*)), *i* = 1, 2, 3, 4 for *γ* = 3 (dashed), 5 (solid), and 8 (dotted).

**Figure 12.** Buy and sell boundaries of at fixed price (*p*(*i*), *x*(*i*)), *i* = 1, 2, 3, 4 for *ζ <sup>p</sup>* = *ζ<sup>q</sup>* = *ξ <sup>p</sup>* = *ξ<sup>q</sup>* = 0.0001 (dashed), 0.0005 (solid), and 0.0010 (dotted).

### *4.2. Performance of the Strategy*

We also perform simulation studies to investigate the performance of the optimal trading strategy. For comparison purpose, we also consider a benchmark strategy that is analogous to the relative-value arbitrage strategy used in Gatev et al. (2006) and based on standard deviation of the spread. Specifically, the strategy opens a position when the spread exceeds twice the standard deviation of the spread process, and closes the position when either price converges or the maturity is reached. As the benchmark strategy doesn't specify the number of shares of stocks that should be bought or sold, we assume that the number of shares of stocks traded each time is one.

We simulate the price process *pt* and the spread process *xt* to compare the performance of the benchmark strategy and our strategy in scenarios (S1)–(S19). Assume that *T* = 1, and we discretize the time interval (0, 1] as {0.01, 0.02, ... , 0.99, 1}, so that we have 100 trading periods. For each scenario, we simulate 1000 paths of {(*pt*, *xt*)|*t* = 0, 0.01, ... , 0.99, 1, *p*<sup>0</sup> = 1}, and for each simulated path (*pt*, *xt*), we implement the benchmark strategy and the optimal strategy at *t* = 0.01, 0.02, ... , 0.99 and close the position at *T* = 1. Let *i* = *b*, *o* represent the benchmark and the optimal strategies, respectively. For each realized trading strategies, denote *N*(*i*) as the number of trades (i.e., buy and sell) among the 100 trading periods and *PL*(*i*) <sup>=</sup> <sup>−</sup>*C*(*i*)(*Lp*, *Mp*; 0, 1) the total profit made during the trading process. Note that the benchmark strategy trades only one share of stock each time while the number of shares of stocks in the optimal strategy are "optimally" chosen based on the buy and sell regions, we define *PS*(*i*) as the the average profit (or loss) generated from the maximum number of shares of stocks during the trading process. That is, *PS*(*i*) :<sup>=</sup> <sup>−</sup>*C*(*i*)(*Lp*, *Mp*; 0, 1)/ max*<sup>t</sup>* <sup>|</sup>*Y*(*i*) *<sup>t</sup>* <sup>|</sup>, where *<sup>Y</sup>*(*i*) *<sup>t</sup>* is the number of shares of stock *P* at *t* = 0.01, 0.02, . . . , 0.99.

Table 2 summarizes the mean and standard error of *N*(*i*), *PL*(*i*), and *PS*(*i*) (*i* = *o*, *b*) for 1000 paths in each scenario. We note that the total numbers of trades *N*(*o*) in the optimal strategy range from 45.736 to 55.821 for (S1)–(S17), and increases (or decreases) significantly when the transaction costs decreases (or increases) in (S18) and (S19). In comparison to this, the total numbers of trades *N*(*b*) in the benchmark strategy are much smaller, essentially, between 1 and 2. This suggests the benchmark strategy is much more conservative than the optimal strategy. For the realized profit over the trading period, *PL*(*o*) is much larger than *PL*(*b*) as the optimal strategy can choose to buy or sell the "optimal" number of shares of stock pairs, while the benchmark strategy only buy or sell one share of stock pair. *PS*(*o*) and *PS*(*b*) remove the impact of number of shares of traded stocks, and provide the average earning per traded stock, and we notice that *PS*(*o*) is still significantly higher than *PS*(*b*).

**Table 2.** Performance of strategies.


### **5. Real Data Studies**

We test our model with real market data in this section. We present the sample and explain our methodology first, and then show the results and discussion.

A key step of implementing pairs trading strategy is to select two stocks for pairs trading. Gatev et al. (2006) illustrate how this can be done by using stock price data. An alternative to this approach is to use fundamentals analysis to select two stocks that have almost the same risk factor exposures; see Vidyamurthy (2004). In this study, we consider a hybrid of these two approaches. Specifically, we restrict two stocks *P* and *Q* to belong to the same industry sector. Table 3 lists six pairs of stocks selected from four different sectors. For each pair of stocks *P* and *Q*, we compute the spread by regressing log price of stock *Q* on the log price of stock *P*, and the fitted values of the regression is considered as the "transformed" price of *P*. Figure 13 shows six pairs of the original prices of *Q* and transformed prices of *P* over time.

**Table 3.** Six pairs of stocks selected from different industries.


**Figure 13.** Original (solid) and transformed (dashed) prices of six pairs of stocks.

We then apply the optimal strategy and the benchmark strategy in Section 4.2 to test the out-of-the-sample performance. Specifically, we use the past three years of the historical data of each pair to estimate the model parameter, and run a unit-root test to conclude if the spread *xt* is a stationary process. If *xt* is not stationary, we do not implement any strategies. Otherwise, we implement both the optimal strategy and the benchmark strategy. Note that the optimal strategy can optimally choose the number of shares of stocks in each trade, while we still trade one unit of stock in the benchmark strategy. Table 4 shows the number of trades *N*(*i*), the accumulated profit (in U.S. dollars) at maturity *PL*(*i*), and the average profit per traded share *PS*(*i*) over two testing periods, for *i* = *o* (the optimal strategy) and *i* = *b* (the benchmark strategy). Table 4 suggests that the benchmark strategy is much more conservative than the optimal strategy. Besides, the average profits per traded share *PS*(*o*) of the optimal strategy are much larger than that of the benchmark strategy except for the stock pair (*KO*, *PEP*).


**Table 4.** Performance of strategies.

### **6. Concluding Remark**

The problem of optimal pairs trading has been studied by many academic researchers and financial practitioners. Existing models and methods try to find either the optimal shares of stocks by assuming no transaction costs, or the optimal timing of trading fixed number of shares of stocks with transaction costs. In contrast to these analysis, this paper studies the joint effect of optimal shares and optimal trading times in pairs trading process with proportional transaction costs. Under the assumption that the investor's aim is to maximize the expected utility of terminal wealth, the optimal pair trading problem can be written as a singular stochastic control problem and solved by the approach in Davis et al. (1993). We then demonstrate the advantage of joint consideration of optimal shares and optimal trading times in pair trading via simulation and empirical studies.

The following issues may need further investigation to make this study more practical. First, our approach can be easily extended for nonexponential utility functions. In such a case, the optimization problem involves five (instead of four) variables, and the numerical algorithm in our paper needs to be modified to adapt for five variables. Second, our approach can be extended to solve the optimal co-integration trading, which involves *n* stocks with *m* co-integration relationship. Third, many empirical studies suggest that stock price processes can be better approximated by incorporating jumps. Using the framework and algorithms developed in Xing et al. (2017), the method developed here can be extended to the case that price processes follow geometric jump-diffusion processes. In such a case, the value function of the corresponding variational inequalities involve integro-differential equations, which can be solved by extending our numerical algorithm.

**Funding:** This research received no external funding.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Data available on request.

**Conflicts of Interest:** The author declares no conflict of interest.

### **Appendix A. Proof of Theorems**

**Proof of Theorem 1.** In our case, the state **X** is (*s*, **x**), where **x** = (*p*, *x*, *y*, *g*). Let **X**<sup>0</sup> = (*s*0, *p*0, *x*0, *y*0, *G*0), it follows that there exists an optimal trading strategy, dictated by the pair of processes (*L*∗ *<sup>p</sup>*(*t*), *M*<sup>∗</sup> *<sup>p</sup>*(*t*), where **X**<sup>∗</sup> <sup>0</sup> (*t*)=(*t*, *p*<sup>∗</sup> <sup>0</sup> (*t*), *x*<sup>∗</sup> <sup>0</sup> (*t*), *y*<sup>∗</sup> <sup>0</sup> (*t*), *g*<sup>∗</sup> <sup>0</sup> (*t*)) is the optimal trajectory, with **X**∗ <sup>0</sup> (*s*0) = **X**0.

(i) First, we prove that *<sup>V</sup>* is a viscosity subsolution of (21) on [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> ). For this, we must show that, for all smooth functions *φ*(**X**), such that *V*(**X**) − *φ*(**X**) has a local maximum at **X**0, the following inequality holds:

$$\min \left\{ -\mathcal{B}\phi(\mathbf{X}\_0), \mathcal{S}\phi(\mathbf{X}\_0), -\mathcal{L}\phi(\mathbf{X}\_0) \right\} \le 0. \tag{A1}$$

Without loss of generality, we assume that *V*(**X**0) = *φ*(**X**0) and *V* ≤ *φ* on [0, *T*] × <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> . We argue by contradiction: if the arguments inside the operator of (A1) satisfy −B*φ*(**X**0) > 0 and S*φ*(**X**0) > 0, then there exists *θ* > 0, such that −L*φ*(**X**0) > *θ*. From the fact that *φ* is smooth, the above inequalities become −B*φ*(**X**) > 0, S*φ*(**X**) > 0, and −L*φ*(**X**) > *θ*, where **X** = (*t*, *p*, *x*, *y*, *g*) ∈ B(**X**0), a neighborhood of **X**0. In Lemma 1, it is shown that **X**∗ <sup>0</sup> (*t*) has no jumps, P-a.s., at **X**<sup>0</sup> = **X**<sup>∗</sup> <sup>0</sup> (*s*0). Hence, *τ*(*ω*), defined by

$$\pi(\omega) = \inf \{ t \in (s\_0, T] : \mathbf{X}\_0^\*(t) \notin \partial(\mathbf{X}\_0) \},$$

is positive P-a.s., and therefore the integral along **X**∗ <sup>0</sup> (*t*)

$$\begin{split} -\theta \int\_{s\_0}^{\tau} dt &> \mathbb{E} \int\_{s\_0}^{\tau} \mathcal{B}\phi(\mathbf{X}\_0^\*(t)) dL^\*(t) - \mathbb{E} \int\_{s\_0}^{\tau} \mathcal{S}\phi(\mathbf{X}\_0^\*(t)) dM^\*(t) + \mathbb{E} \int\_{s\_0}^{\tau} \mathcal{L}\phi(\mathbf{X}\_0^\*(t)) dt \\ &= \mathbb{E}\{I\_1\} - \mathbb{E}\{I\_2\} + \mathbb{E}\{I\_3\}, \end{split} \tag{A2}$$

where (*L*∗(*t*), *M*∗(*t*)) is the optimal trading strategy at **X**0. Applying It*o*ˆ's formula to *φ*(**X**), where the state dynamics are given by (1)–(6), we get

$$E\left\{\phi(\mathbf{X}\_0^\*(\tau))\right\} = \phi(\mathbf{X}\_0) + E\{I\_1\} - E\{I\_2\} + E\{I\_3\}.\tag{A.3}$$

Since *V*(**X**) ≤ *φ*(**X**), for all **X** ∈ B(**X**0), and *V*(**X**0) = *φ*(**X**0), (A2) and (A3) yield

$$E\{V(\mathbf{X}\_0^\star(\tau))\} \le V(\mathbf{X}\_0) + E\{I\_1\} - E\{I\_2\} + E\{I\_3\} < V(\mathbf{X}\_0) - \theta \int\_{\mathcal{S}\_0}^\tau dt\_\tau$$

which violates the dynamic programming principle, together with the optimality of (*L*∗(*t*), *M*∗(*t*)). Therefore, at least one of the arguments inside the minimum operator of (A1) is nonpositive, and hence the value function is a viscosity subsolution of (21).

(ii) In the second part of the proof, we show that *V* is a viscosity supersolution of (21). For this, we must show that, for all smooth functions *φ*(**X**), such that *V*(**X**) − *φ*(**X**) has a local minimum at **X**0, the following inequality holds:

$$\min \left\{ -\mathcal{B}\phi(\mathbf{X}\_0), \mathcal{S}\phi(\mathbf{X}\_0), -\mathcal{L}\phi(\mathbf{X}\_0) \right\} \ge 0,\tag{A4}$$

where, without loss of generality, *<sup>V</sup>*(**X**0) = *<sup>φ</sup>*(**X**0) and *<sup>V</sup>*(**X**) <sup>≥</sup> *<sup>φ</sup>*(**X**) on [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> . In this case, we prove that each argument of the minimum operator of (A4) is non-negative.

Consider the trading strategy *L*(*t*) = *L*<sup>0</sup> > 0, *s*<sup>0</sup> ≤ *t* ≤ *T*, and *M*(*t*) = 0, *s*<sup>0</sup> ≤ *t* ≤ *T*. By the dynamic programming principle,

$$V(\mathbf{s}\_{0\prime}p\_{0\prime}\mathbf{x}\_{0\prime}\mathbf{y}\_{0\prime}\mathbf{g}\_{0\prime}\mathbf{g}\_{0}) \ge V(\mathbf{s}\_{0\prime}p\_{0\prime}\mathbf{x}\_{0\prime}\mathbf{y}\_{0} + L\_{0\prime}\mathbf{g}\_{0} - (a\_{\mathcal{P}} - b\_{\emptyset}e^{\mathbf{X}\_{0}})p\_{0}L\_{0}).$$

This inequality holds for *φ*(*s*, *p*, *x*, *y*, *g*) as well, and, by taking the left-hand side to the right-hand side, dividing by *L*0, and sending *L*<sup>0</sup> → 0, we get B*φ*(**X**0) ≤ 0. Similarly, by using the trading strategy *L*(*t*) = 0,*s*<sup>0</sup> ≤ *t* ≤ *T*, and *M*(*t*) = *M*<sup>0</sup> > 0, *s*<sup>0</sup> ≤ *t* ≤ *T*, the second argument inside the minimum operator is found to be non-negative.

Finally, consider the case where no trading is applied. By the dynamic programming principle

$$E\{V(\mathbf{X}\_0^d(t))\} \le V(s\_{0\prime}p\_{0\prime}\mathbf{x}\_{0\prime}\mathbf{y}\_{0\prime}\mathbf{g}\_0),\tag{A5}$$

where **X***<sup>d</sup>* <sup>0</sup>(*t*) is the state trajectory of starting at *s*0, when *M*(*t*) = *L*(*t*) = 0, *s*<sup>0</sup> ≤ *t* ≤ *T*, given by (1)–(6) as

$$\mathbf{X}\_0^d(t) = (t, p(t), \mathfrak{x}(t), y\_{0\prime} \mathfrak{g}(t))^\prime$$

and **X***<sup>d</sup>* <sup>0</sup>(*t*) ∈ B(**X**0). Therefore, by applying It*o*ˆ's rule on *φ*(*s*, *X*, *B*, *y*, *G*), inequality (A5) yields

$$E\left\{\int\_{s\_0}^t \mathcal{L}\phi(\mathbf{X}\_0^d(\xi))d\xi\right\} \le 0\_r$$

and, by letting *t* → *s*0, the third argument inside the minimum operator is found to be non-negative. This complete the proof.

**Lemma A1.** *Assume that* −B*φ*(**X**0) > 0*, and denote the event that the optimal trajectory* **X**<sup>∗</sup> <sup>0</sup> (*t*) *has a jump of size , along the direction* (0, 0, 0, 1, −(*ap* − *bqex*<sup>0</sup> )*p*0) *by <sup>A</sup>*(*ω*)*. Assume that the state (after the jump) is* (*s*0, *p*0, *x*0, *y*<sup>0</sup> + , −(*ap* − *bqex*<sup>0</sup> )*B*<sup>0</sup>) ∈ B(**X**0)*. Then,*

$$\left(\mathcal{B}\phi(\mathbf{X}\_0)\right)P(A) \ge 0,\tag{A6}$$

*therefore P*(*A*) = 0*. Similarly, if* S*φ*(**X**0) > 0*, then the optimal trajectory has no jumps along the direction* (0, 0, 0, −1,(*bp* − *aqex*<sup>0</sup> )*p*0)*, P-a.s. at* **<sup>x</sup>**0*.*

**Proof.** By the principle of dynamic programming,

$$\begin{aligned} V(\mathbf{s}\_{0}, p\_{0}, \mathbf{x}\_{0}, y\_{0}, g\_{0}) &= E\left\{ V(\mathbf{s}\_{0}, p\_{0}, \mathbf{x}\_{0}, y\_{0} + \boldsymbol{\varepsilon}, -(a\_{p} - b\_{q}\boldsymbol{\varepsilon}^{x\_{0}})B\_{0}\boldsymbol{\varepsilon}) \right\} \\ &= \int\_{A(\boldsymbol{\omega})} V(\mathbf{s}\_{0}, p\_{0}, \mathbf{x}\_{0}, y\_{0} + \boldsymbol{\varepsilon}, -(a\_{p} - b\_{q}\boldsymbol{\varepsilon}^{x\_{0}})B\_{0}\boldsymbol{\varepsilon}) dP + \int\_{A(\boldsymbol{\omega})} V(\mathbf{s}\_{0}, p\_{0}, \mathbf{x}\_{0}, y\_{0}, g\_{0}) dP\_{\boldsymbol{\omega}} \end{aligned}$$

and therefore

$$\int\_{A(\omega)} \left[ \phi(\mathbf{s}\_{0\prime} \, p\_{0\prime} \, \mathbf{x}\_{0\prime} \, y\_0 + \boldsymbol{\varepsilon}\_{\prime} - (\boldsymbol{a}\_p - \boldsymbol{b}\_q \boldsymbol{\varepsilon}^{\mathbf{x}\_0}) B\_0 \boldsymbol{\varepsilon}) - \phi(\mathbf{s}\_{0\prime} \, p\_{0\prime} \, \mathbf{x}\_{0\prime} \, y\_0 \, y\_0) \right] dP \geq 0, \sigma\_0^2$$

since *V*(**X**) ≤ *φ*(**X**) for all **X** ∈ B(**X**0) and *V*(**X**0) = *φ*(**X**0). Therefore,

$$\limsup\_{\varepsilon \to 0} \left\{ \int\_{A(\omega)} \frac{\phi(\mathbf{s}\_0, p\_0, \mathbf{x}\_0, \mathbf{y}\_0 + \varepsilon, -(a\_p - b\_q e^{\mathbf{x}\_0}) p\_0 \varepsilon) - \phi(\mathbf{s}\_0, p\_0, \mathbf{x}\_0, \mathbf{y}\_0, \mathbf{g}\_0)}{\varepsilon} dP \right\} \ge 0, \eta$$

and, by Fatou's lemma,

$$\int\_{A(\omega)} \limsup\_{\epsilon \to 0} \left\{ \frac{\phi(s\_{0\prime}p\_{0\prime} \mathbf{x}\_{0\prime} \mathbf{y}\_0 + \epsilon, -(a\_{\mathcal{P}} - b\_{\mathcal{P}}\epsilon^{\mathbf{x}\_0})B\_0\epsilon) - \phi(s\_{0\prime}p\_{0\prime} \mathbf{x}\_{0\prime}\mathbf{y}\_0, \mathbf{G}\_0)}{\epsilon} \right\} dP \ge 0, 1$$

which implies (A6).

### **Proof of Theorem 3.** Let

$$\mathcal{V}^{\delta}(t,\mathsf{p},\mathsf{x},\mathsf{y},\mathsf{g}) = \begin{cases} \ \mathsf{V}^{\delta}(\mathsf{y},\mathsf{p},\mathsf{x},\mathsf{y},\mathsf{g}) & \text{if } t \in [\mathsf{y},\mathsf{x}+\delta), \mathsf{y} \in [\mathsf{v},\mathsf{v}+\mathsf{x}\delta),\\ \mathcal{Z}(\mathsf{p},\mathsf{x},\mathsf{y},\mathsf{g}) & \text{if } t = T \end{cases}$$

and

$$\underline{V}(\mathbf{X}) = \lim\_{\mathbf{Y} \to \mathbf{X}} \inf\_{\delta \to 0} \{ \mathbb{V}^{\delta}(\mathbf{Y}) \} \quad \text{and} \quad \nabla(\mathbf{X}) = \lim\_{\mathbf{Y} \to \mathbf{X}} \sup\_{\delta \to 0} \{ \mathbb{V}^{\delta}(\mathbf{Y}) \}, \tag{A7}$$

where **X** = (*t*, *p*, *x*, *y*, *g*). We will show that *V*(**X**) and *V*(**X**) are a viscosity supersolution and a viscosity subsolution of (21), respectively. Combining this with the uniqueness of the viscosity solution of (21) yields *<sup>V</sup>*(**X**) <sup>≥</sup> *<sup>V</sup>*(**X**) on [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> . The opposite inequality is true by the definition of *V*(**X**) and *V*(**X**), and therefore

$$
\underline{V}(\mathbf{X}) = \nabla(\mathbf{X}) = V(\mathbf{X})\_\prime
$$

which, together with (A7), also implies the local uniform convergence of *<sup>δ</sup>* to *V*.

Note that we only prove that *V* is a viscosity supersolution of (21), as the arguments for *<sup>V</sup>* is identical. Let **<sup>X</sup>**<sup>0</sup> be a local minimum of *<sup>V</sup>* <sup>−</sup> *<sup>φ</sup>* on [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> , for *<sup>φ</sup>* <sup>∈</sup> *<sup>C</sup>*1,2([0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> ). Without loss of generality, we may assume that **<sup>X</sup>**<sup>0</sup> is a strict local minimum, that *<sup>V</sup>*(**X**0) = *<sup>φ</sup>*(**X**0), and that *<sup>φ</sup>* ≤ −<sup>2</sup> <sup>×</sup> sup*δ*{||*δ*||∞} outside the vall B(**X**0, *R*), *R* > 0, where *V*(**X**) − *φ*(**X**) ≥ 0.

Then, there exist sequences *<sup>δ</sup><sup>n</sup>* <sup>∈</sup> <sup>+</sup> and **<sup>Y</sup>***<sup>n</sup>* <sup>∈</sup> [0, *<sup>T</sup>*] <sup>×</sup> <sup>+</sup> <sup>×</sup> <sup>×</sup> <sup>×</sup> , such that

$$\delta\_n \to 0, \mathbf{Y}\_n \to \mathbf{X}\_{0\prime} \,\mathrm{V}^{\delta\_n}(\mathbf{Y}\_n) \to \underline{V}(\mathbf{X}\_0), \mathbf{Y}\_n \text{ if a global minimum point of } \mathbb{V}^{\delta\_n}\_{\mathbf{j}} - \boldsymbol{\phi}.$$

Let *hn* <sup>=</sup> *δ<sup>n</sup>* <sup>−</sup> *<sup>φ</sup>*; then

$$h\_{\boldsymbol{\eta}} \to 0 \text{ and } \mathbb{V}\_{\boldsymbol{\eta}}^{\delta\_{\boldsymbol{\eta}}}(\mathbf{X}) \ge \boldsymbol{\phi}(\mathbf{X}) + h\_{\boldsymbol{\eta}}(\mathbf{X}) \quad \text{for any } \mathbf{X} \in [0, T] \times \mathbb{R}^+ \times \mathbb{R} \times \mathbb{R} \times \mathbb{R}.\tag{A8}$$

To show that *V* is a viscosity supersolution of (21), it suffices to show that

$$\min \left\{ -\mathcal{B}\phi(\mathbf{X}\_0), \mathcal{S}\phi(\mathbf{X}\_0), -\mathcal{L}\phi(\mathbf{X}\_0) \right\} \ge 0. \tag{A9}$$

Let *<sup>n</sup>* = (*si*, *<sup>n</sup>*, *n*, *yn*, *n*), where *si* ∈ [*χi*, *χ<sup>i</sup>* + *δn*) and *yδ<sup>n</sup>* ∈ [*ϑn*, *ϑ<sup>n</sup>* + *κδn*). Denote (0) *<sup>n</sup>* = (*χn*, *<sup>n</sup>*, *n*, *yn*, *n*),

$$\mathbb{Y}\_{n}^{(1)} = \left(\chi\_{\boldsymbol{\mathsf{n}}\prime} \mathbb{p}\_{\boldsymbol{\mathsf{n}}\prime} \mathbb{x}\_{\boldsymbol{\mathsf{n}}\prime} \boldsymbol{\theta}\_{\boldsymbol{\mathsf{n}}} + \kappa \delta\_{\boldsymbol{\mathsf{n}}\prime} \mathbb{g}\_{\boldsymbol{\mathsf{n}}} - (a\_{\boldsymbol{\mathsf{p}}} - b\_{\boldsymbol{\mathsf{q}}} \boldsymbol{\mathsf{e}}^{\mathbf{x}\_{\boldsymbol{\mathsf{n}}}}) \mathbb{p}\_{\boldsymbol{\mathsf{n}}} \kappa \delta\_{\boldsymbol{\mathsf{n}}}\right),$$

$$\mathbb{Y}\_{n}^{(2)} = \left(\chi\_{\boldsymbol{\mathsf{n}}\prime} \mathbb{p}\_{\boldsymbol{\mathsf{n}}\prime} \mathbb{x}\_{\boldsymbol{\mathsf{n}}\prime} \theta\_{\boldsymbol{\mathsf{n}}} - \kappa \delta\_{\boldsymbol{\mathsf{n}}\prime} \mathbb{g}\_{\boldsymbol{\mathsf{n}}} + (b\_{\boldsymbol{\mathsf{p}}} - a\_{\boldsymbol{\mathsf{q}}} \boldsymbol{\mathsf{e}}^{\mathbf{x}\_{\boldsymbol{\mathsf{n}}}}) \mathbb{p}\_{\boldsymbol{\mathsf{n}}} \kappa \delta\_{\boldsymbol{\mathsf{n}}}\right).$$

Then,

$$\mathbb{V}^{\delta\_n}(\mathbb{X}\_n^{(0)}) = \max \left\{ \mathbb{V}^{\delta\_n}(\mathbb{X}\_n^{(1)}), \mathbb{V}^{\delta\_n}(\mathbb{X}\_n^{(2)}), \mathbb{E}\left\{\mathbb{V}^{\delta\_n}(\mathbb{X}\_{\binom{n+1}{2}})\right\} \right\}.$$

Now, we look at the following three cases.

*Case 1*. It holds that *δ<sup>n</sup>* ((0) *<sup>n</sup>* ) = *δ<sup>n</sup>* ((1) *<sup>n</sup>* ). Then (A8) implies that

$$
\mathbb{W}\_{\mathbb{V}^n}(\mathbb{X}\_{(0)}^n) \ge \phi(\mathbb{X}\_n^{(1)}) + \mathbb{W}\_n^{\delta\_n}(\mathbb{X}\_n^{(0)}) - \phi(\mathbb{X}\_n^{(0)}),
$$

and therefore

$$\begin{split} 0 &\geq \liminf\_{n} \left\{ \frac{\phi\left(\mathbb{Y}\_{n}^{\left(1\right)}\right) - \phi\left(\mathbb{Y}\_{n}^{\left(0\right)}\right)}{\delta\_{n}} \right\} \geq \liminf\_{\delta \to 0} \left\{ \frac{\phi\left(\mathbb{Y}\_{0}^{\left(1\right)}\right) - \phi\left(\mathbb{Y}\_{0}^{\left(0\right)}\right)}{\delta} \right\} \\ &= \frac{\partial \phi\left(\mathbb{X}\_{0}\right)}{\partial y} - (a\_{p} - e^{\mathbf{x}\_{0}\left(t\right)}) p\_{0}(t) \frac{\partial \phi\left(\mathbf{x}\_{0}\right)}{\partial y} .\end{split}$$

*Case 2*. It holds that *δ<sup>n</sup>* ((0) *<sup>n</sup>* ) = *δ<sup>n</sup>* ((2) *<sup>n</sup>* ). Arguing similarly to case 1, we get

$$0 \ge -\left(\frac{\partial \phi(\mathbf{X}\_0)}{\partial y} - \left(b\_p - a\_q e^{\mathbf{x}\_0(t)}\right) p\_0(t) \frac{\partial \phi(\mathbf{X}\_0)}{\partial \mathbf{g}}\right).$$

*Case 3*. It holds that *δ<sup>n</sup>* ((0) *<sup>n</sup>* ) = *E δ<sup>n</sup>* ((0) *<sup>n</sup>*+1) . Then (A8) implies that

$$\mathbb{V}^{\delta^n}(\mathbb{X}\_n^{(0)}) \ge E\{\phi(\mathbb{X}\_{n+1}^{(0)})\} + \mathbb{V}^{\delta^n}(\mathbb{X}\_n^{(0)}) - \phi(\mathbb{X}\_{n+1}^{(0)}),$$

and therefore

$$0 \geq \liminf\_{n} \left\{ \frac{\phi(\mathbb{Y}\_{n+1}^{(0)}) - \phi(\mathbb{Y}\_{n}^{(0)})}{\delta\_{n}} \right\} \geq \liminf\_{\delta \to 0} \left\{ \frac{\phi(\mathbb{Y}\_{1}^{(0)}) - \phi(\mathbb{Y}\_{0}^{(0)})}{\delta} \right\} = \mathcal{L}\phi(\mathbb{X}\_{0}).$$

Combining the results in cases 1–3 yields (A9), and the proof is complete.

### **References**

Davis, Mark H. A., Vassilios G. Panas, and Thaleia Zariphopoulou. 1993. European option pricing with transaction costs. *SIAM Journal on Control and Optimization* 31: 470–93. [CrossRef]

Ehrman, Douglas S. 2006. *The Handbook of Pairs Trading: Strategies Using Equities, Options, and Futures*. Hoboken: John Wiley and Sons. Elliott, Robert J., John Van Der Hoek, and William P. Malcolm. 2005. Pairs Trading. *Quantitative Finance* 5: 271–76. [CrossRef]

Gatev, Evan, William N. Goetzmann, and K. Geert Rouwenhorst. 2006. Pairs trading: Performance of a relative-value arbitrage rule. *The Review of Financial Studies* 19: 797–827. [CrossRef]

Lai, Tze Leung, and Haipeng Xing. 2008. *Statistical Models and Methods for Financial Markets*. New York: Springer.

Lei, Yaoting, and Jing Xu. 2015. Costly arbitrage through pairs trading. *Journal of Economic Dynamics and Control* 56: 1–19. [CrossRef] Leung, Tim, and Xin Li. 2015. Optimal mean reversion trading with transaction costs and stop-loss exit. *International Journal of Theoretical and Applied Finance* 18: 1550020. [CrossRef]

Mudchanatongsuk, Supakorn, James A. Primbs, and Wilfred Wong. 2008. Optimal pairs trading: A stochastic approach. Paper presented at 2008 American Control Conference, Seattle, WA, USA, June 11–13.

Ngo, Minh-Man, and Huyen Pham. 2016. Optimal switching for the pairs trading rule: A viscosity solutions approach. *Journal of Mathematical Analysis and Applications* 441: 403–25. [CrossRef]

Song, Qingshuo, and Qing Zhang. 2013. An optimal pairs-trading rule. *Automatica* 49: 3007–14. [CrossRef]

Tourin, Agnès, and Raphael Yan. 2013. Dynamic pairs trading using the stochastic control approach. *Journal of Economic Dynamics and Control* 37: 1972–81. [CrossRef]

Vidyamurthy, Ganapathy. 2004. *Pairs Trading—Quantitative Methods and Analysis*. New York: John Wiley and Sons.

