A closed-form solution for optimal mean-reverting trading strategies
AA closed-form solution for optimal mean-reverting trading strategies
Alexander Lipton ∗ and Marcos Lopez de Prado † Abstract
When prices reflect all available information, they oscillate around an equilibrium level. This oscil-lation is the result of the temporary market impact caused by waves of buyers and sellers. This pricebehavior can be approximated through an Ornstein-Uhlenbeck (OU) process.Market makers provide liquidity in an attempt to monetize this oscillation. They enter a long positionwhen a security is priced below its estimated equilibrium level, and they enter a short position whena security is priced above its estimated equilibrium level. They hold that position until one of threeoutcomes occur: (1) they achieve the targeted profit; (2) they experience a maximum tolerated loss; (3)the position is held beyond a maximum tolerated horizon.All market makers are confronted with the problem of defining profit-taking and stop-out levels. Moregenerally, all execution traders acting on behalf of a client must determine at what levels an order must befulfilled. Those optimal levels can be determined by maximizing the trader’s Sharpe ratio in the contextof OU processes via Monte Carlo experiments, [35]. This paper develops an analytical framework andderives those optimal levels by using the method of heat potentials, [31, 32].
Mean-reverting trading strategies in various contexts have been studied for decades, see, e.g., [43, 14, 15,17, 21, 25, 26, 27, 18, 16, 41]. For instance, Elliott et al. explained how mean-reverting processes mightbe used in pairs trading and developed several methods for parameter estimation, [13]. Avellaneda and Leeused mean-reverting processes for pairs trading, and modeled the hitting time to find the exit rule of thetrade, [1]. Bertram developed some analytic formulae for statistical arbitrage trading where the securityprice follows an Ornstein–Uhlenbeck (O-U) process, [6, 7]. Lindberg and his coauthors model the spreadbetween two assets as an O-U process and study the optimal liquidation strategy for an investor who wantsto optimize profit over the opportunity cost, [12, 11, 23, 29]. Lopez de Prado (Chapter 13) considered tradingrules for discrete-time mean-reverting trading strategies and found optimal trading rules using Monte Carlosimulations, [35].By its very nature, the energy market is particularly well suited to mean-reverting trading strategies.Numerous researchers discuss these strategies, see, e.g., [8, 5, 28], among others.Usually, it is assumed that the stochastic process underlying mean-reverting trading strategies is thestandard O-U process. However, in practice, jumps do play a major role. Hence, some attention had beendevoted to L´evy-driven O-U processes, see, e.g., [23, 16, 10]. Although Endres and St¨ubinger, [10], presenta fairly detailed exposition, their central equation (9) is incorrect because it ignores the possibility of aL´evy-driven O-U process to overshoot the chosen boundaries.We emphasize that most, if not all, analytical results derived by the above authors, are asymptotic andvalid for perpetual trading strategies only, see, e.g., [6, 7, 12, 11, 24, 23, 29, 45, 2]. While interesting from atheoretical standpoint, they have limited application in practice. In contrast, our approach deals with finitematurity trading strategies, and, because of that, has immediate applications.When prices reflect all available information, they oscillate around an equilibrium level. This oscillationis the result of the temporary market impact caused by waves of buyers and sellers. The resulting price ∗ The Jerusalem School of Business Administration, The Hebrew University of Jerusalem, Jerusalem, Israel; Connection Sci-ence and Engineering, Massachusetts Institute of Technology, Cambridge, MA, USA; Investimizer, Chicago, IL, USA; SilaMoney,Portland, OR, USA. E-mail: [email protected] † Operations Research and Information Engineering, Cornell University, New York, NY, USA; Investimizer, Chicago, IL,USA; True Positive Technologies, New York, NY, USA. E-mail [email protected] a r X i v : . [ q -f i n . T R ] M a r ehavior can be approximated through an O-U process. The parameters of the process might be estimatedusing historical data.Market makers provide liquidity in an attempt to monetize this oscillation. They enter a long positionwhen a security is priced below its estimated equilibrium level, and they enter a short position when asecurity is priced above its estimated equilibrium level. They hold that position until one of three outcomesoccurs: (A) they achieve a targeted profit; (B) they experience a maximum tolerated loss; (C) the positionis held beyond a maximum tolerated horizon.All traders are confronted with the problem of defining profit-taking and stop-out levels. More generally,all execution traders acting on behalf of a client must determine at what levels an order must be fulfilled.Lopez de Prado (Chapter 13) explains how to identify those optimal levels in the sense of maximizing thetrader’s Sharpe ratio (SR) in the context of O-U processes via Monte Carlo experiments, [35]. AlthoughLopez de Prado (p. 192) conjectured the existence of an analytical solution to this problem, he identified it asan open problem. In this paper, we solve the critical question of finding optimal trading rules analytically byusing the method of heat potentials. These optimal profit-taking/stop-loss trading rules for mean-revertingtrading strategies provide the algorithm that must be followed to exit a position. To put it differently, wefind the optimal exit corridor to maximize the SR of the strategy.The method of heat potential is a highly powerful and versatile approach popular in mathematical physics;see, e.g., [42, 40, 20, 44] among others. It has been successfully used in numerous important fields, such asthermal engineering, nuclear engineering, and material science. However, it is not particularly popular inmathematical finance,even though the first important use case was given by Lipton almost twenty years ago.Specifically, Lipton considered pricing barrier options with curvilinear barriers, see [30], Section 12.2.3, pp.462–467. More recently, Lipton and Kaushansky described several important financial applications of themethod, see [31, 34, 32, 33].The SR is defined as the ratio between the expected returns of an execution algorithm and the standarddeviation of the same returns. The returns are computed as the logarithmic ratio between the exit andentry prices, times the sign of the order side ( − Suppose an investment strategy S invests in i = 1 , ...I opportunities or bets. At each opportunity i , S takesa position of m i units of security X , where m i ∈ ( −∞ , ∞ ). The transaction that entered such opportunitywas priced at a value m i P i, , where P i, is the average price per unit at which the m i securities weretransacted. As other market participants transact security X , we can mark-to-market (MtM) the value ofthat opportunity i after t observed transactions as m i P i,t . This represents the value of opportunity i if itwere liquidated at the price observed in the market after t transactions. Accordingly, we can compute theMtM profit/loss of opportunity i after t transactions as π i,t = m i ( P i,t − P i, ).A standard trading rule provides the logic for exiting opportunity i at t = T i . This occurs as soon as oneof two conditions is verified: • π i,T i ≥ π , where π > • π i,T i ≤ π , where π < π < π , one and only one of the two exit conditions can trigger the exit from opportunity i . Assuming that opportunity i can be exited at T i , its final profit/loss is π i,T i . At the onset of eachopportunity, the goal is to realize an expected profit E [ π i,T i ] = m i ( E [ P i,T i ] − P i, ) , E [ P i,T i ] is the forecasted price and P i, is the entry level of opportunity i . Consider the discrete O-U process on a price series { P i,t } : P i,t − E [ P i,T i ] = κ ( E [ P i,T i ] − P i,t − ) + σε i,t , such that the random shocks are IID distributed ε i,t ∼ N (0 , P i, ,the level targeted by opportunity i is E [ P i,T i ], and κ determines the speed at which P i, converges towards E [ P i,T i ].We estimate the input parameters { κ, σ } , by stacking the opportunities as: X = ( E [ P ,T ] − P , , E [ P ,T ] − P , , ..., E [ P ,T ] − P ,T − , ..., E [ P I,T I ] − P I, , ..., E [ P I,T I ] − P I,T − ) T ,Y = ( P , − E [ P ,T ] , P , − E [ P ,T ] , ..., P ,T − E [ P ,T ] , ..., P I, − E [ P I,T I ] , ..., P I,T − E [ P I,T I ]) T , where ( ... ) T denotes vector transposition. Applying OLS on the above equation, we can estimate the originalO-U parameters as follows: ˆ κ = cov[ Y,X ]cov[
X,X ] , ˆ ξ = Y − ˆ κX, ˆ σ = (cid:114) cov (cid:104) ˆ ξ, ˆ ξ (cid:105) , where, as usual, cov [ ., . ] is the covariance operator. We use the above estimations to find optimal stop-lossand take-profit bounds. In this rather technical section, we perform transformations in order to formulate the problem in terms ofheat potentials.Consider a long investment strategy S and suppose profit/loss opportunity is driven by an O-U process(see [35] among many others): dx (cid:48) = κ (cid:48) (cid:0) θ (cid:48) − x (cid:48) (cid:1) dt (cid:48) + σ (cid:48) dW t (cid:48) , x (cid:48) (0) = 0 , (1)and a trading rule R = { π (cid:48) , π (cid:48) , T (cid:48) } , π (cid:48) < π (cid:48) >
0. It is important to understand what are the natural unitsassociated with the O-U process (1). To this end we can use its steady-state. The steady-state expectationof the above process is θ , while its standard deviation is given by Ω (cid:48) = σ (cid:48) / √ κ (cid:48) .As usual, an appropriate scaling is helpful to remove superfluous parameters. To this end, we define t = κ (cid:48) t (cid:48) , T = κ (cid:48) T (cid:48) , x = √ κ (cid:48) σ (cid:48) x (cid:48) , π = √ κ (cid:48) σ (cid:48) π (cid:48) , π = √ κ (cid:48) σ (cid:48) π (cid:48) , θ = √ κ (cid:48) σ (cid:48) θ (cid:48) , E = E (cid:48) √ κ (cid:48) σ (cid:48) , F = F (cid:48) κ (cid:48) σ (cid:48) , and get dx = ( θ − x ) dt + dW t , in the domain π ≤ x ≤ π, ≤ t ≤ T. The steady-state distribution has the expectation of θ , and the standard deviation Ω = 1 / √ π to take profit; (B) theprice hits π to stop losses; (C) the trade expires at t = T . For a short investment strategy, the roles of { π, π } are reversed - profits equal to − π are taken when when the price hits π , and losses equal − π are realizedwhen the price hits π . Given the fact that the reflection x → − x leaves the initial condition unchanged andtransforms the original O-U process into the O-U process of the form dx = ( − θ − x ) dt + dW t , x (0) = 0 ,
3e can restrict ourselves to the case θ ≥
0. More explicitly and intuitively, we go long when θ ≥ θ <
0. Assuming that we know the trading rule { π ( θ, T ) , π ( θ, T ) , T } for θ ≥
0, the correspondingtrading rule for θ < { π ( θ, T ) , π ( θ, T ) , T } = {− π ( − θ, T ) , − π ( − θ, T ) , T } . Thus, we are interested in the maximization of the SR for nonnegative θ ≥
0. We formulate this mathemat-ically below.For a given T , we define the stopping time ι = inf { t : x t = π or x t = π or t = T } . We wish to determineoptimal π > , π < E { x ι /ι } √ E { x ι /ι }− ( E { x ι /ι } ) , We also need to know the expected duration of the trade,DUR = E { ι } . In order to calculate the corresponding SR and DUR we proceed as follows. We solve three terminalboundary value problems (TBVPs) of the form E t ( t, x ) + ( θ − x ) E x ( t, x ) + E xx ( t, x ) = 0 ,E ( t, π ) = πt , E ( t, π ) = πt ,E ( T, x ) = xT ,F t ( t, x ) + ( θ − x ) F x ( t, x ) + F xx ( t, x ) = 0 ,F ( t, π ) = π t , F ( t, π ) = π t ,F ( T, x ) = x T , and G t ( t, x ) + ( θ − x ) G x ( t, x ) + G xx ( t, x ) = 0 ,G ( t, π ) = t, G ( t, π ) = t,G ( T, x ) = T, We represent the SR and DUR as SR = E (0 , √ F (0 , − ( E (0 , , DUR = G (0 , . We wish to use the method of heat potentials to solve the above TBVPs. First, we define τ = T − t, and get initial boundary value problems (IBVPs): E τ ( τ , x ) = ( θ − x ) E x ( τ , x ) + E xx ( τ , x ) ,E ( τ , π ) = π ( T − τ ) , E ( τ , π ) = π ( T − τ ) ,E (0 , x ) = xT , τ ( τ , x ) = ( θ − x ) F x ( τ , x ) + F xx ( τ , x ) ,F ( τ , π ) = π ( T − τ ) , F ( τ , π ) = π ( T − τ ) ,F (0 , x ) = x T ,G τ ( τ , x ) = ( θ − x ) G x ( τ , x ) + G xx ( τ , x ) ,G ( τ , π ) = ( T − τ ) , G ( τ , π ) = ( T − τ ) ,G (0 , x ) = T, SR = E ( T, √ F ( T, − ( E ( T, , DUR = G ( T, . Second, we define υ = − e − τ , ξ = e − τ ( x − θ ) , so that ∂ τ = (1 − υ ) ∂ υ − ξ∂ ξ , ∂ x = √ − υ∂ ξ . Accordingly, E υ ( υ, ξ ) = E ξξ ( υ, ξ ) ,E (cid:16) υ, Π ( υ ) (cid:17) = π ln ( (1 − υ )(1 − ) , E (cid:16) υ, Π ( υ ) (cid:17) = π ln ( (1 − υ )(1 − ) ,E (0 , ξ ) = − ξ + θ )ln(1 − ,F υ ( υ, ξ ) = F ξξ ( υ, ξ ) ,F (cid:16) υ, Π ( υ ) (cid:17) = π ( ln ( (1 − υ )(1 − )) , F (cid:16) υ, Π ( υ ) (cid:17) = π ( ln ( (1 − υ )(1 − )) ,F (0 , ξ ) = ξ + θ ) (ln(1 − ,G υ ( υ, ξ ) = G ξξ ( υ, ξ ) ,G (cid:16) υ, Π ( υ ) (cid:17) = ln (cid:16) (1 − υ )(1 − (cid:17) , G (cid:16) υ, Π ( υ ) (cid:17) = ln (cid:16) (1 − υ )(1 − (cid:17) ,G (0 , ξ ) = − ln (1 − , SR = E (Υ ,(cid:36) ) √ F (Υ ,(cid:36) ) − ( E (Υ ,(cid:36) )) , DUR = G (Υ , (cid:36) ) . Here Υ = − e − T , (cid:36) = −√ − θ, Π( υ ) = √ − υ ( π − θ ) , Π( υ ) = √ − υ ( π − θ ) . As usual, we have to account for the initial conditions. To this end, we introduceˆ E ( υ, ξ ) = E ( υ, ξ ) + ξ + θ )ln(1 − , ˆ F ( υ, ξ ) = F ( υ, ξ ) − ( υ +( ξ + θ ) ) (ln(1 − , ˆ G ( υ, ξ ) = G ( υ, ξ ) + ln (1 − , E υ ( υ, ξ ) = ˆ E ξξ ( υ, ξ ) , ˆ E ( υ, Π ( υ )) = e ( υ ) , ˆ E (cid:0) υ, Π( υ ) (cid:1) = e ( υ ) , ˆ E (0 , ξ ) = 0 , ˆ F υ ( υ, ξ ) = ˆ F ξξ ( υ, ξ ) , ˆ F ( υ, Π ( υ )) = f ( υ ) , ˆ F (cid:0) υ, Π( υ ) (cid:1) = f ( υ ) , ˆ F (0 , ξ ) = 0 , ˆ G υ ( υ, ξ ) = ˆ G ξξ ( υ, ξ ) , ˆ G ( υ, Π ( υ )) = g ( υ ) , ˆ G (cid:0) υ, Π( υ ) (cid:1) = g ( υ ) , ˆ G (0 , ξ ) = 0 , where e ( υ ) = π ln ( (1 − υ )(1 − ) + υ )+ θ )ln(1 − , e ( υ ) = π ln ( (1 − υ )(1 − ) + υ )+ θ )ln(1 − f ( υ ) = π ( ln ( (1 − υ )(1 − )) − ( υ +(Π( υ )+ θ ) ) (ln(1 − , f ( υ ) = π ( ln ( (1 − υ )(1 − )) − ( υ +(Π( υ )+ θ ) ) (ln(1 − ,g ( υ ) = ln (1 − υ ) , g ( υ ) = ln (1 − υ ) . Accordingly, SR = ˆ E (Υ ,(cid:36) ) − (cid:36) + θ )ln(1 − (cid:114) ˆ F (Υ ,(cid:36) ) − ( ˆ E (Υ ,(cid:36) ) ) + ( Υ+ln(1 − (cid:36) + θ ) ˆ E (Υ ,(cid:36) ) ) (ln(1 − , (2)DUR = ˆ G (Υ , (cid:36) ) − ln (1 − . After the above transformations are performed, the problem becomes solvable by the method of heatpotentials.
Now we are ready to use the classical method of heat potentials to calculate the SR. Consider ˆ E . We haveto solve the following coupled system of Volterra integral equations: ε ( υ ) + √ π υ (cid:90) υ ) − Π( ζ )) e − (Π( υ ) − Π( ζ ))22( υ − ζ ) ( υ − ζ ) / ε ( ζ ) dζ + √ π υ (cid:90) ( Π( υ ) − Π( ζ ) ) e − ( Π( υ ) − Π( ζ ) ) υ − ζ ) ( υ − ζ ) / ε ( ζ ) dζ = e ( υ ) , (3) − ε ( υ ) + √ π υ (cid:90) ( Π( υ ) − Π( ζ ) ) e − ( Π( υ ) − Π( ζ ) ) υ − ζ ) ( υ − ζ ) / ε ( ζ ) dζ + √ π υ (cid:90) ( Π( υ ) − Π( ζ ) ) e − ( Π( υ ) − Π( ζ ) ) υ − ζ ) ( υ − ζ ) / ε ( ζ ) dζ = e ( υ ) , (4)6nce these equations are solved, ˆ E ( υ, ξ ) can be written as follows:ˆ E ( υ, ξ ) = √ π υ (cid:90) ξ − Π( ζ )) e − ( ξ − Π( ζ ))22( υ − ζ ) ( υ − ζ ) / ε ( ζ ) dζ + √ π υ (cid:90) ( ξ − Π( ζ ) ) e − ( ξ − Π( ζ ) ) υ − ζ ) ( υ − ζ ) / ε ( ζ ) dζ. (5)We can find ˆ F ( υ, ξ ) by the same token: φ ( υ ) + √ π υ (cid:90) υ ) − Π( ζ )) e − (Π( υ ) − Π( ζ ))22( υ − ζ ) ( υ − ζ ) / φ ( ζ ) dζ + √ π υ (cid:90) ( Π( υ ) − Π( ζ ) ) e − ( Π( υ ) − Π( ζ ) ) υ − ζ ) ( υ − ζ ) / φ ( ζ ) dζ = f ( υ ) , (6) − φ ( υ ) + √ π υ (cid:90) ( Π( υ ) − Π( ζ ) ) e − ( Π( υ ) − Π( ζ ) ) υ − ζ ) ( υ − ζ ) / φ ( ζ ) dζ + √ π υ (cid:90) ( Π( υ ) − Π( ζ ) ) e − ( Π( υ ) − Π( ζ ) ) υ − ζ ) ( υ − ζ ) / φ ( ζ ) dζ = f ( υ ) , (7)ˆ F ( υ, ξ ) = √ π υ (cid:90) ξ − Π( ζ )) e − ( ξ − Π( ζ ))22( υ − ζ ) ( υ − ζ ) / φ ( ζ ) dζ + √ π υ (cid:90) ( ξ − Π( ζ ) ) e − ( ξ − Π( ζ ) ) υ − ζ ) ( υ − ζ ) / φ ( ζ ) dζ. (8)In particular,ˆ E (Υ , (cid:36) ) = √ π Υ (cid:90) (cid:36) − Π( ζ )) e − ( (cid:36) − Π( ζ ))22(Υ − ζ ) (Υ − ζ ) / ε ( ζ ) dζ + √ π Υ (cid:90) ( (cid:36) − Π( ζ ) ) e − ( (cid:36) − Π( ζ ) ) − ζ ) (Υ − ζ ) / ε ( ζ ) dζ, ˆ F (Υ , (cid:36) ) = √ π Υ (cid:90) (cid:36) − Π( ζ )) e − ( (cid:36) − Π( ζ ))22(Υ − ζ ) (Υ − ζ ) / φ ( ζ ) dζ + √ π Υ (cid:90) ( (cid:36) − Π( ζ ) ) e − ( (cid:36) − Π( ζ ) ) − ζ ) (Υ − ζ ) / φ ( ζ ) dζ. It is important to notice that ( ε ( ζ ) , ε ( ζ )) and (cid:0) φ ( ζ ) , φ ( ζ ) (cid:1) are singular at ζ = Υ. However, due tothe dampening impact of the exponents exp (cid:16) − (cid:0) (cid:36) − Π ( ζ ) (cid:1) / − ζ ) (cid:17) , the corresponding integrals stillconverge.We now know ˆ E (Υ , (cid:36) ) , ˆ F (Υ , (cid:36) ) and calculate the SR by using Eq. (2). ˆ G (Υ , (cid:36) ) and DUR can becalculated in a similar fashion. To compute the SR, we need to find ˆ E (Υ , (cid:36) ) and ˆ F (Υ , (cid:36) ), and then apply Eq. (2). ˆ E (Υ , (cid:36) ) and ˆ F (Υ , (cid:36) )can be computed using Eqs (5) and (8) by simple integration with pre-computed ( ε, ε ) and (cid:0) φ, φ (cid:1) . In thissection, we develop a numerical method to compute these quantities by solving Eqs (3)–(4), and (6)–(7) byextending the methods described in Lipton and Kaushansky, [31, 32]. For illustrative purposes we developa simple scheme based on the trapezoidal rule for Stieltjes integrals.We want to solve a generic system of the form: ν ( υ ) + (cid:82) υ K , ( υ,s ) √ υ − s ν ( s ) ds + (cid:82) υ K , ( υ, s ) ν ( s ) ds = χ ( υ ) , − ν ( υ ) + (cid:82) υ K , ( υ, s ) ν ( s ) ds + (cid:82) υ K , ( υ,s ) √ υ − s ν ( s ) ds = χ ( υ ) , ν ( υ ) , ν ( υ )), where K , ( υ, s ) = √ π Π( υ ) − Π( s ) υ − s exp (cid:16) − (Π( υ ) − Π( s )) υ − s ) (cid:17) ,K , ( υ, s ) = √ π Π( υ ) − Π( s )( υ − s ) / exp (cid:16) − (Π( υ ) − Π( s )) υ − s ) (cid:17) ,K , ( υ, s ) = √ π Π( υ ) − Π( s )( υ − s ) / exp (cid:16) − (Π( υ ) − Π( s )) υ − s ) (cid:17) ,K , ( υ, s ) = √ π Π( υ ) − Π( s ) υ − s exp (cid:16) − (Π( υ ) − Π( s )) υ − s ) (cid:17) . It is clear that K , ( υ, υ ) = √ π lim s → υ Π( υ ) − Π( s ) υ − s = θ − π √ π √ − υ ,K , ( υ, υ ) = 0 ,K , ( υ, υ ) = 0 ,K , ( υ, υ ) = √ π lim s → υ Π( υ ) − Π( s ) υ − s = θ − π √ π √ − υ . We can equally rewrite the relevant integrals as Stieltjes integrals ν ( υ ) − (cid:82) υ K , ( υ, s ) ν ( s ) d √ υ − s + (cid:82) υ K , ( υ, s ) ν ( s ) ds = χ ( υ ) , − ν ( υ ) + (cid:82) υ K , ( υ, s ) ν ( s ) ds − (cid:82) υ K , ( υ, s ) ν ( s ) d √ υ − s = χ ( υ ) . Consider a grid 0 = υ < υ < . . . < υ n = Υ, and let ∆ k,l = υ k − υ l . Then, using the trapezoidal rule forapproximation of integrals, we get the following approximation of last two equations: ν k + (cid:80) ki =1 (cid:18) ( K , k,i ν i + K , k,i − ν i − )( √ ∆ k,i + √ ∆ k,i − ) + (cid:16) K , k,i ν i + K , k,i − ν i − (cid:17)(cid:19) ∆ i,i − = χ k , − ν k + (cid:80) ki =1 (cid:18) (cid:16) K , k,i ν i + K , k,i − ν i − (cid:17) + ( K , k,i ν i + K , k,i − ν i − )( √ ∆ k,i + √ ∆ k,i − ) (cid:19) ∆ i,i − = χ k . where ν αi = ν α ( υ i ) , χ αi = χ α ( υ i ) , K α,βk,j = K α,β ( υ k , υ i ) , α, β = 1 , . Taking into account that (cid:0) ν , ν (cid:1) = (cid:0) χ , − χ (cid:1) , (cid:0) ν , ν (cid:1) = (cid:18) χ ( K , , √ υ ) , − χ ( − K , , √ υ ) (cid:19) , and assuming that (cid:0) ν , ν (cid:1) , . . . , (cid:0) ν k − , ν k − (cid:1) have been computed, we can easily find (cid:0) ν k , ν k (cid:1) : ν k = (cid:16) K , k,k (cid:112) ∆ k,k − (cid:17) − (cid:16) χ k − K , k,k − ν k − (cid:112) ∆ k,k − − K , k,k − ν k − ∆ k,k − − (cid:80) k − i =1 (cid:18) ( K , k,i ν i + K , k,i − ν i − )( √ ∆ k,i + √ ∆ k,i − ) + (cid:16) K , k,i ν i + K , k,i − ν i − (cid:17)(cid:19) ∆ i,i − (cid:19) ,ν k = (cid:16) − K , k,k (cid:112) ∆ k,k − (cid:17) − (cid:16) χ k − K , k,k − ν k − ∆ k,k − − K , k,k − ν k − (cid:112) ∆ k,k − − (cid:80) k − i =1 (cid:18) (cid:16) K , k,i ν i + K , k,i − ν i − (cid:17) + ( K , k,i ν i + K , k,i − ν i − )( √ ∆ k,i + √ ∆ k,i − ) (cid:19) ∆ i,i − (cid:19) . The approximation error of the integrals is of order O (∆ ), where ∆ = max i ∆ i,i − ). Hence, on uniformgrid, the convergence is of order O (∆). We emphasize that, due to the nature of ( e ( υ ) , e ( υ )), etc., it isnecessary to use a highly inhomogeneous grid which is concentrated near the right endpoint.8 .1 Computation of the Sharpe ratio Once ( ε ( υ ) , ε ( υ )) and (cid:0) φ ( υ ) , φ ( υ ) (cid:1) are computed, we can approximate ˆ E ( υ, ξ ) and ˆ F ( υ, ξ ). We interested tocompute these functions at one point (Υ , (cid:36) ), which can be done by approximation of the integrals using thetrapezoidal rule: ˆ E (Υ , (cid:36) ) = (cid:80) ki =1 (cid:0) w n,i ε i + w n,i − ε i − + w n,i ε i + w n,i − ε i − (cid:1) ∆ i,i − , (9)and ˆ F (Υ , (cid:36) ) = (cid:80) ki =1 (cid:16) w n,i φ i + w n,i − φ i − + w n,i φ i + w n,i − φ i − (cid:17) ∆ i,i − . (10)The corresponding weights are as follows: w n,i = ( (cid:36) − Π i ) e − ( (cid:36) − Π i ) n,i √ π ∆ / n,i , w n,i = ( (cid:36) − Π i ) e − ( (cid:36) − Π i ) n,i √ π ∆ / n,i ≤ i < n,w n,i = 0 w n,i = 0 , i = n. As a result, we get the following algorithm for the numerical evaluation of the SR.
Algorithm 1
Numerical evaluation of the Sharpe ratioStep 1 Define a time grid 0 = υ < υ < . . . < Υ.Step 2 Compute (cid:15) ( υ ) , (cid:15) ( υ ) , φ ( υ ) , φ ( υ ) using numerical method in Section 6.Step 3 Compute ˆ E (Υ , (cid:36) ) by using (9).Step 4 Compute ˆ F (Υ , (cid:36) ) by using Eq. (10).Step 5 Compute the Sharpe ratio by using Eq. (2). We compute the SR for various values of π and π , and as a result show the SR as a function of ( π, π ). Afterthat one can choose ( π, π ) in order to maximize the SR.To be concrete, consider θ = 1 . . T = 1 .
96. We compare our results with the Monte Carlomethod, which simulates the process and compute its expectation and variance (see [35]). First, we compareseparately E , σ = √ F − E , and G calculated by both methods in Figure 1:Figure 1 near here.Second, we show the results for the SR itself in Figure 2:Figure 2 near here.We see that the relative difference between the method of heat potentials and the Monte Carlo method issmall and mainly comes from the Monte Carlo noise. In this section we solve a problem of finding parameters to maximize the SR by analyzing it as a function of( π, π ) for different values of θ and Υ. Two problems are considered: (A) Fix Υ and maximize the SR over( π, π ); (B) Maximize the SR over ( π, π, Υ).Given that the natural unit Ω = 1 / √
2, we consider three representative values of θ , namely θ = 1, θ = 0 .
5, and θ = 0, corresponding to strong and weak mispricing and fair pricing, respectively. We choosethree maturities, Υ = 0 .
49, 0 . . T = 1 .
96, 4 .
26, 6 .
56. For negative θ , thecorresponding SR can be obtained by reflection if needed.9e show the corresponding SR surfaces in Figures 3, 4, 5:Figure 3 near here.Figure 4 near here.Figure 5 near here.The optimal bounds ( π ∗ , π ∗ ) are given in the Table 1 below:Table 1 near here.This table shows that in the case when the original mispricing is strong ( θ = 1) it is not optimal to stop thetrade early. When the mispricing is weaker ( θ = 0 .
5) or there is no mispricing in the first place ( θ = 0) itis not optimal to stop losses, but it might be beneficial to take profits. We emphasize that in practice oneneeds to use a highly reliable estimation of the O-U parameters to be able to use these rules with confidence. The method of heat potentials boils down to solving a system of Volterra equations of the second kind.However, there are certain quantities of interest, which can be calculated directly. To put it into a propercontext, in this section we discuss several classical approached to the problem we are interested in. Weemphasize that the method of heat potentials is dramatically different from other method because it allowsone to consider strategies with finite duration, say T , whilst, to the best of our knowledge, all other methodsare asymptotic in nature and assume that T → ∞ . In this subsection, we calculate the expected value and the variance of the of duration of a trade, whichterminates only when the spread hits one of the barriers, T = ∞ (or Υ = 0 . G (1) t ( t, x ) + ( θ − x ) G (1) x ( t, x ) + G (1) xx ( t, x ) = 0 ,G (2) ( t, π ) = t, G (1) ( t, π ) = t, (11) G (2) t ( t, x ) + ( θ − x ) G (2) x ( t, x ) + G (2) xx ( t, x ) = 0 ,G (2) ( t, π ) = t , G (2) ( t, π ) = t . (12)with implicit terminal conditions at T → ∞ . The superscripts indicate the first and second moments,respectively.We start with the expectation. We can represent the solution G (1) ( t, x ) of Eq. (11) in a semi-stationaryform: G (1) ( t, x ) = t + g (1) ( x ) , where ( θ − x ) g (1) x ( x ) + g (1) xx ( x ) = − , (13) g (1) ( π ) = 0 , g (1) ( π ) = 0 . (14)Eq. (13) can be solved by the method of variation of constants: g (1) x ( x ) = a e ( x − θ ) + λ F ( x − θ ) ,g (1) ( x ) = a + a I ( x − θ ) + λ G ( x − θ ) , (15)10here a , a are arbitrary constants. Here D ( x ) is Dawson’s function, E ( x ) is its integral, and F ( x ) , G ( x )are convenient abbreviations: I ( x ) = (cid:82) x e z dz, D ( x ) = e − x (cid:82) x e z dz = e − x I ( x ) , E ( x ) = (cid:82) x D ( z ) dz, F ( x ) = √ πN (cid:0) √ x (cid:1) e x , G ( x ) = √ πN (cid:0) √ x (cid:1) I ( x ) − E ( x ) . We can use the Taylor series expansion for G ( x ) and represent it in the form G ( x ) = ∞ (cid:88) n =1 Γ ( n ) Γ( n +1) (2 x ) n , (16)see also [38], where this formula is obtained via the Laplace transform. Taking into account boundaryconditions (14), we can represent g as follows: g (1) ( x, π, π ) = 2 (cid:16) ( G ( π − θ ) −G ( π − θ ))( I ( π − θ ) −I ( π − θ )) ( I ( x − θ ) − I ( π − θ )) − ( G ( x − θ ) − G ( π − θ )) (cid:17) . (17)Finally, the expected duration is given by the following expression:DUR = g (0) . (18)We show the expected duration as a function of π, π for θ = 1 in Figure 6:Figure 6 near here.Given the fact that Υ → . T → ∞ , we can see from this Figure that for sufficiently remote π, π the process stays within the range [ π, π ] indefinitely, or, at least, for a very long time.Now we consider Eq. (12) and write G (2) ( t, x ) = t + tg (2 , ( x ) + g (2 , ( x ) , where ( θ − x ) g (2 , x ( x ) + g (2 , xx ( x ) = − ,g (2 , ( π ) = 0 , g (2 , ( π ) = 0 , ( θ − x ) g (2 , x ( x ) + g (2 , xx ( x ) = − g (2 , ( x ) ,g (2 , ( π ) = 0 , g (2 , ( π ) = 0 . (19)In is clear that g (2 , ( x ) = 2 g (1) ( x, π, π ) , where g (1) is given by Eq. (17).Green’s function G ( x, y ) for problem (19) has the form G ( x, y ) = e − ( y − θ )2 ( I ( y − θ ) −I ( π − θ ))( I ( π − θ ) −I ( π − θ )) ( I ( x − θ ) − I ( π − θ )) y ≤ x ≤ π, e − ( y − θ )2 ( I ( y − θ ) −I ( π − θ ))( I ( π − θ ) −I ( π − θ )) ( I ( x − θ ) − I ( π − θ )) π ≤ x ≤ y. As usual, g (2 , ( x ) = − (cid:82) u −∞ G ( x, y ) g (1) ( y, π, π ) dy. The explicit expression for the expected duration given by Eq. (18) is interesting in its own right and alsocan be used for benchmarking solutions obtained via the method of heat potentials.11 .3 Renewal theory approach
To facilitate the comparison with previously know results, from now on, we assume that θ = 0.In this subsection, we revisit Bertram’s approach [6, 7]. In a nutshell, Bertram assumes that the un-derlying O-U process, representing portfolio’s log-price, is running in perpetuity. He envisions the followinginvestment strategy. When the return process x hits the lower level l , the underlying is bought. Whenthe process x hits the upper level u , the underlying is sold. Thus, the round trip is characterized by twotransitions, x = l → x = u , and x = u → x = l ; once the round trip is completed, the process starts again.We can use the same ideas as in Section 8.2 to calculate E ( T ), E (cid:0) T (cid:1) , and V ( T ) for the hitting time ofa given level u , starting at the level x = l by letting π → −∞ , π = u : E ( T ) = 2 ( G ( u ) − G ( l )) , E (cid:0) T (cid:1) = 8 ( G ( u ) ( G ( u ) − G ( l )) − ( J ( u ) − J ( l ))) , V ( T ) = 4 (cid:0)(cid:0) G ( u ) − J ( u ) (cid:1) − (cid:0) G ( l ) − J ( l ) (cid:1)(cid:1) , where J ( x ) = (cid:82) x −∞ e − y ( I ( x ) − I ( y )) G ( y ) dy = I ( x ) (cid:82) x −∞ e − y G ( y ) dy − (cid:82) x −∞ D ( y ) G ( y ) dy. Similarly to Eq. (16), we can write: J ( x ) = ∞ (cid:88) n =1 Γ ( n )( ψ ( n ) + γ ) Γ( n +1) (2 x ) n , where ψ is the digamma function and γ is the Euler-Mascheroni constant, γ = − ψ (1), see also [38], wherethis formula is obtained via the Laplace transform.In summary, ε ( l → u ) ≡ E ( T ) = 2 ( G ( u ) − G ( l )) ,ϑ ( l → u ) ≡ V ( T ) = 4 (cid:0)(cid:0) G ( u ) − J ( u ) (cid:1) − (cid:0) G ( l ) − J ( l ) (cid:1)(cid:1) . By symmetry, ε ( u → l ) = ε ( − u → − l ) = 2 ( G ( − l ) − G ( − u )) ,ϑ ( u → l ) = ϑ ( − u → − l ) = 4 (cid:0)(cid:0) G ( − l ) − J ( − l ) (cid:1) − (cid:0) G ( − u ) − J ( − u ) (cid:1)(cid:1) . Finally, ε ( l → u → l ) ≡ ε ( l → u ) + ε ( u → l )= 2 ( G ( u ) − G ( − u ) − ( G ( l ) − G ( − l )))= 2 √ π ( I ( u ) − I ( l )) ,ϑ ( l → u → l ) ≡ ϑ ( l → u ) + ϑ ( u → l )= 4 (cid:0)(cid:0) G ( u ) − G ( − u ) − J ( u ) − J ( − u )) (cid:1) − (cid:0) G ( l ) − G ( − l ) − J ( l ) − J ( − l )) (cid:1)(cid:1) = 16 (cid:0)(cid:0) G ( e ) ( u ) G ( o ) ( u ) − J ( o ) ( u ) (cid:1) − (cid:0) G ( e ) ( l ) G ( o ) ( l ) − J ( o ) ( l ) (cid:1)(cid:1) since G , J are decomposed into the even and odd parts as follows: G ( x ) = G ( e ) ( x ) + G ( o ) ( x ) , G ( e ) ( x ) = √ π (cid:0) N (cid:0) √ x (cid:1) − (cid:1) I ( x ) − E ( x ) , G ( o ) ( x ) = √ π I ( x ) , ( x ) = J ( e ) ( x ) + J ( o ) ( x ) , J ( e ) ( x ) = I ( x ) (cid:82) x e − y G ( e ) ( y ) dy − (cid:82) −∞ D ( y ) G ( y ) dy − (cid:82) x D ( y ) G ( e ) ( y ) dy J ( o ) ( x ) = I ( x ) (cid:16)(cid:82) −∞ e − y G ( y ) dy + √ π E ( x ) (cid:17) − √ π (cid:82) x D ( y ) I ( y ) dy. Once the requisite quantities are computed, Bertram invokes classical results from renewal theory, [6, 7]. The classical result from renewal theory, see, e.g., [39], gives the asymptotic properties of the random variable M ( t, l, u ) representing the number of round trips on the time interval [0 , t ]: M ( t, l, u ) ∼ N (cid:16) tε ( l → u → l ) , ϑ ( l → u → l ) tε ( l → u → l ) (cid:17) , where N is the normal variable. Given that x represents the log-price of the underlying portfolio, the returnand asymptotic Sharpe ratio SR per unit of time are given by r = ( u − l − c ) ε ( l → u → l ) , SR = (cid:113) ε ( l → u → l ) ϑ ( l → u → l ) ( u − l − c − r f )( u − l − c ) , where c , r f represent transaction fees, and risk-free rate, respectively. Bertram maximizes one of thesequantities over the stop-loss/take profit thresholds ( l, u ).The main practical problem with this approach is that it assumes stationarity in perpetuity of theunderlying process, which is a somewhat questionable assumption. The other problem is that, even for astationary process, it takes a very long time for the strategy to reach its asymptotic state. The reasonwhy these issues have not been discussed earlier, is that it is very hard to calculate the probability densityfunction (pdf) for the processes l → u , u → l , and the round-trip process l → u → l . Recently, Lipton andKaushansky proposed a very efficient method for calculating the pdfs for the processes l → u , u → l , see[31, 32]; the the round-trip process l → u → l can be analyzed by convolution. We show the correspondingpdfs for a representative choice of l , u , namely l = − / √ u = 1 / √ l → u → l , so that the strategy might neverreach its asymptotic limit in practice. Figure 7 near here. In this section, we discuss results obtained in [12, 11, 23, 29], and rederive and improve their findings in aconcise semi-analytic fashion.The stationary problem for determining the value function and the optimal take-profit level u for a given stop-loss level l (which is determined by the investor’s risk appetite) and the time value of money has theform: V xx ( x ) − xV x ( x ) − λV = 0 , l ≤ x ≤ u,V ( l ) = l, V ( u ) = u, V (cid:48) ( u ) = 1 . (20)This problem is similar, but by no means identical, to the pricing problem for the perpetual American calloption on a dividend-paying stock. Here λ is the non-dimensional discount rate, λ = 2 r/κ .The second-order ordinary differential equation (20) is the well-known Hermite differential equation. Itsgeneral solution has the form V ( x ) = a M (cid:0) λ , , x (cid:1) + a xM (cid:0) λ +24 , , x (cid:1) , (21) We note in passing that Bertram uses informal notation, which is dimensionally incorrect, such as V (1 /T ) = V ( T ) / E ( T ) ,and next to impossible to understand, although his final results are correct. M ( a, b, z ) is the celebrated Kummer function (a confluent hypergeometric function of the first kind),and a , a are arbitrary constants. Boundary conditions (20) yield: a M (cid:0) λ , , l (cid:1) + a lM (cid:0) λ +24 , , l (cid:1) = l,a M (cid:0) λ , , u (cid:1) + a uM (cid:0) λ +24 , , u (cid:1) = u,a λuM (cid:0) λ +44 , , u (cid:1) + a (cid:16) M (cid:0) λ +24 , , u (cid:1) + ( λ +2)3 u M (cid:0) λ +64 , , u (cid:1)(cid:17) = 1 . Here we use the fact that M z ( a, b, z ) = ab M ( a + 1 , b + 1 , z ) . We eliminate a , a : a = c l − c uc c − c c , a = − c l + c uc c − c c ,c = M (cid:0) λ , , l (cid:1) , c = lM (cid:0) λ +24 , , l (cid:1) ,c = M (cid:0) λ , , u (cid:1) , c = uM (cid:0) λ +24 , , u (cid:1) , (22)and obtain the following nonlinear algebraic equation for u :( c l − c u ) λuM (cid:0) λ +44 , , u (cid:1) + ( − c l + c u ) (cid:16) M (cid:0) λ +24 , , u (cid:1) + ( λ +2)3 u M (cid:0) λ +64 , , u (cid:1)(cid:17) = ( c c − c c ) . (23)We solve Eq. (23) via the Newton-Raphson method.Once u is found, we use Eqs (21), (22), to construct the value functions V ( x ). We show V ( x ) − x and u ( l ) for several representative values of λ in Figures 8 (a), (b).Figure 8 near here.The stationary problem for determining the value function and the optimal take-profit level U for a given stop-loss level L (which is determined by the investor’s risk appetite) and the opportunity cost c has thenondimensional form: V xx ( x ) − xV x ( x ) = λ, l ≤ x ≤ u,V ( l ) = l, V ( u ) = u, V x ( u ) = 1 , (24)where λ is the non-dimensional opportunity cost, λ = 2 c/κ . It is easy to show that the general solution ofEq. (24) has the form given by Eq. (15). As before we get the following set of equations: a + a I ( l ) = l − λ G ( l ) ,a + a I ( u ) = u − λ G ( u ) ,a e u = 1 − λ F ( u ) . Accordingly, a = I ( u )( l − λ G ( l )) −I ( l )( u − λ G ( u ))( I ( u ) −I ( l )) ,a = u − λ G ( u ) − ( l − λ G ( l ))( I ( u ) −I ( l )) , e u ( u − λ G ( u ) − ( l − λ G ( l )))( I ( u ) −I ( l )) = 1 − λ F ( u ) . In Figure 9(a), we show V ( x ) − x for l = − . λ , the correspondingoptimal values of u are 1 .
07, 0 .
74, 0 .
50. In Figure 9(b) we show the optimal boundary u ( l ).Figure 9 near here.14t is natural to ask what happens when the underlying mean-reverting process has a jump component,so that dx = − xdt + dW t + JdP t , where P t is a Poisson process with intensity ν , and J is the jump magnitude, which is assumed to be arandom variable with density function φ ( J ), see [23]. Larsson et al. use the finite element method tosolve the corresponding free boundary problem. However, if J has a double exponential distribution densityfunction φ ( J ), φ ( J ) = κe − κ | J | , or, more generally, a hyper-exponential distribution, see, e.g., [22], the problem can be solved in a semi-analytical fashion.To this end, it is convenient to write the problem with jumps in terms of v ( x ) = V ( x ) − x : v (cid:48)(cid:48) ( x ) − xv (cid:48) ( x ) + ω ( I + ( x ) + I − ( x ) − v ( x )) = λ + (2 + ω ) x,I + ( x ) = x − l (cid:90) v ( x − z ) e − κz dz = x (cid:90) l v ( z ) e − κ ( x − z ) dz,I − ( x ) = u − x (cid:90) v ( x + z ) e − κz dz = u (cid:90) x v ( z ) e − κ ( z − x ) dz,v ( l ) = v ( u ) = v (cid:48) ( u ) = I + ( l ) = I − ( u ) = 0 , where ω = κν . It can be written as an inhomogeneous system of linear ODEs: v (cid:48) ( x ) − w ( x ) = 0 w (cid:48) ( x ) − xw ( x ) + ω ( I + ( x ) + I − ( x ) − v ( x )) = λ + (2 + ω ) x,I (cid:48) + ( x ) − v ( x ) + κI + ( x ) = 0 ,I − ( x ) + v ( x ) − κI − ( x ) = 0 ,v ( l ) = 0 , w ( l ) = c, I + ( l ) = 0 , I − ( l ) = d. This system can be solved by the method of shooting by choosing initial values c, d and the right endpointof the computational interval b to satisfy the remaining boundary conditions v ( u ) = w ( u ) = I − ( u ) = 0 . (25)or in the matrix form: vwI + I − (cid:48) + − − ω − x ω ω − κ
01 0 0 − κ vwI + I − = λ + (2 + ω ) x . In Figure 10(a), we show the solution vector ( v ( x ) , w ( x ) , I + ( x ) , I − ( x )) corresponding to the suboptimalchoice of u . The shooting parameters, c, d , are chosen in such a way, that two of the three boundary conditions(25) are satisfied, v ( u ) = I − ( u ) = 0. In Figure 10(b), we show what happens when the upper limit u ischosen optimally, by using the Newton-Raphson method. For u = 1 .
18 all three conditions (25) are met.In Figure 10(c), we demonstrate the quality of our numerical method by putting ω = 0 and comparing thecorresponding numerical solution with the analytical solution given by Eq. (15). The figure shows that theagreement is excellent. Figure 10 near here.15n Figure 11(a), we show v ( x ) for l = − .
0, the corresponding optimal values of u are 1 .
18, 0 .
80, 0 . u ( l ) for several representative values of λ in Figure 11(b), whileFigure 11 near here. Several researchers, including de Lataillade et al. , [24], concentrated on the critical question on how lineartransaction costs affect the profitability of mean-reverting trading strategies. An alternative treatment isgiven by [37], see also [9]. Denuded of all amenities, the approach of de Lataillade et al. is almost identicalto the method used by Hyer et al., [19], for studying passport options.de Lataillade et al. reduce the problem to solving the following Fredholm integral equation of the secondkind g ( x ) − (cid:82) q − q K ( x, y ) g ( y ) dy = f ( x ) , (26)where K ( x, y ) = Θ exp (cid:18) − (Θ y − x )2 ( Θ2 − ) (cid:19) √ π (Θ − ,f ( x ) = x + Γ (cid:18) N (cid:18) − √ q − x ) √ (Θ − (cid:19) − N (cid:18) − √ q + x ) √ (Θ − (cid:19)(cid:19) , where Θ = e ∆ . Eq. (26) is augmented with the matching condition g ( q ) = Γ . (27)Here Γ represents transaction cost, while ∆ shows how far forward the behavior of the process can bepredicted. The trader should not change her position when − q < x < q , and go maximally long when x = q ,and short when x = − q .While de Lataillade et al. use the path integral method to understand the behavior of Eqs (26,27), weprefer to attack the problem in question directly - by solving the corresponding Fredholm equation. Asbefore, we solve Eq. (26) for a given q , and then adjust q by using the Newton-Raphson method until thematching condition (27) is met. We notice in passing that K ( x, y ) is even, K ( − x, − y ) = K ( x, y ), while f ( x ) is odd, f ( − x ) = − f ( x ), so that g ( x ) is even, g ( − x ) = − g ( x ). Our analysis results in some unexpectedfindings. Namely, Eqs (26,27) have multiple solutions. We choose Γ = 0 .
1, ∆ = 1 and solve the equationsin question. It turns out that at least two critical values of q are possible, q = 0 . q = 1 . g ( x ), which has a single root at x = 0 is the solution of interest. With this in mind, we can construct critical boundaries q (∆) correspondingto several representative values of Γ. These boundaries are shown in Figure 12(c).Figure 12 near here. In this paper we create an analytical framework for computing optimal stop-loss/take-profit bounds ( π ∗ , π ∗ )for O-U driven trading strategies by using the method of heat potentials.First, we present a method for calibrating the corresponding O-U process to market prices. Second, wederive an explicit expression for the SR given by Eq. (2), and maximize it with respect to the stop loss/ takeprofit bounds ( π, π ). Third, for three representative values of θ , we calculate the SR on a grid of ( π, π ) andpre-chosen times and graphically summarize in Figures 3, 4, 5. Next, for each case, we perform optimizationand present ( π ∗ , π ∗ ) in Table 1. In agreement with intuition, in the case of strong misprising, it is optimalto wait until the trade’s expiration without imposing stop losses/ take profit bounds. For weaker mispricing,it is not optimal to stop losses, but it might be optimal to take profits early. Still, to be on the safe side, werecommend imposing stop losses chosen in accordance with one’s risk appetite to avoid unpleasant surprisescaused by the misspecification of the underlying process.Our rules help liquidity providers to decide how to offer liquidity to the market in the most profitableway, as well as by statistical arbitrage traders to optimally execute their trading strategies.16 very interesting and difficult multi-dimensional version of these rules (covering several correlated stocks)will be described elsewhere. Acknowledgement 1
We greatly appreciate valuable discussions with Dr. Marsha Lipton, our partner atInvestimizer.
Acknowledgement 2
We are grateful to Dr. Vadim Kaushansky for his help with an earlier version ofthis paper.
References [1] Avellaneda, M. and Lee, J.-H., 2010. Statistical arbitrage in the us equities market. Quantitative Fi-nance, 10(7):761-782.[2] Bai, Y., Wu, L., 2018. Analytic value function for optimal regime-switching pairs trading rules. Quan-titative Finance 18 (4), 637-654.[3] Bailey D. H. and Lopez De Prado, M., 2013. The Sharpe Ratio Efficient Frontier. Journal of Risk, 15(2).[4] Bailey D. H. and Lopez De Prado, M., 2014. The Deflated Sharpe Ratio: Correcting for Selection Bias,Backtest Overfitting and Non-Normality. Journal of Portfolio Management, 40(5):94-107.[5] Baviera, R., Baldi, T. S., 2017. Stop-loss and leverage in optimal statistical arbitrage with an applicationto energy market. Working paper, Politecnico di Milano.[6] Bertram, W.K., 2009. Optimal trading strategies for Ito diffusion processes. Physica A: StatisticalMechanics and its Applications, 388(14): 2865-2873.[7] Bertram, W.K., 2010. Analytic solutions for optimal statistical arbitrage trading. Physica A: StatisticalMechanics and its Applications, 389(11): 2234-2243.[8] Cummins, M., Bucca, A., 2012. Quantitative spread trading on crude oil and refined products markets.Quantitative Finance 12 (12): 1857-1875.[9] Do, B., Faff, R., 2012. Are pairs trading profits robust to trading costs? Journal of Financial Research35 (2), 261-287.[10] Endres, S., St¨ubinger, J., 2017. Optimal trading strategies for L´evy-driven Ornstein-Uhlenbeck pro-cesses. FAU Discussion Papers in Economics, No. 17/2017, Friedrich-Alexander-Universit¨at Erlangen-N¨urnberg.[11] Ekstrom, E., Lindberg, C., Tysk, J., 2011. Optimal liquidation of a pairs trade. In: Di Nunno, G.,Oksendal, B. (Eds.), Advanced mathematical methods for finance. Springer, Berlin, Heidelberg, pp.247-255.[12] Ekstrom, E., Lindberg, C., Tysk, J., Wanntorp, H., 2010. Optimal liquidation of a call spread. Journalof Applied Probability 47, 586-593.[13] Elliott, R. J., Van Der Hoek, J., and Malcolm, W. P. (2005). Pairs trading. Quantitative Finance,5(3):271-276.[14] Gatev, E., Goetzmann, W. N., Rouwenhorst, K. G., 2006. Pairs trading: Performance of a relative-valuearbitrage rule. Review of Financial Studies 19 (3), 797-827.[15] Govender, K., 2011. Statistical arbitrage in South African financial markets. Working paper, Universityof Cape Town.[16] Goncu, A., Akyldirim, E., 2016. Statistical arbitrage with pairs trading. International Review of Finance16 (2), 307-319. 1717] Gregory, I., Ewald, C.-O., Knox, P., 2011. Analytical pairs trading under different assumptions on thespread and ratio dynamics. Working paper, University of Sydney.[18] Huck, N., Afawubo, K., 2015. Pairs trading and selection methods: Is cointegration superior? AppliedEconomics 47 (6), 599-613.[19] Hyer T., Lipton-Lifschitz, A., Pugachevsky D., 1997. Passport to success. Risk Magazine 10(9), 127-131.[20] Kartashov, E., 2001. Analytical Methods in the Theory of Heat Conduction of Solids. Vysshaya Shkola,Moscow 706.[21] Krauss, C., 2015. Statistical arbitrage pairs trading strategies: Review and outlook, IWQW DiscussionPapers, No. 09/2015, Friedrich-Alexander-Universit¨at Erlangen-N¨urnberg.[22] Lipton, A., 2002. Assets with jumps. Risk Magazine 15 (9), 149-153.[23] Larsson, S., Lindberg, C., Warfheimer, M., 2013. Optimal closing of a pair trade with a model containingjumps. Applications of Mathematics 58 (3), 249-268.[24] de Lataillade, J., Deremble, C., Potters, M., Bouchaud, J-P. 2012. Optimal trading with linear costs.Journal of Investment Strategies 1(3): 91-115.[25] Leung, T., Li, X., 2015a. Optimal mean reversion trading: Mathematical analysis and practical appli-cations. World Scientific, New Jersey, USA.[26] Leung, T., Li, X., 2015b. Optimal mean reversion trading with transaction costs and stop-loss exit.International Journal of Theoretical and Applied Finance 18 (3), 1550020.[27] Li, X., 2015. Optimal multiple stopping approach to mean reversion trading. PhD thesis, ColumbiaUniversity.[28] Liu, B., Chang, L.-B., Geman, H., 2017. Intraday pairs trading strategies on high frequency data: Thecase of oil companies. Quantitative Finance 17 (1), 87-100.[29] Lindberg, C., 2014. Pairs trading with opportunity cost. Journal of Applied Probability 51, 282-286.[30] Lipton, A., 2001. Mathematical Methods for Foreign Exchange: A Financial Engineer’s Approach.World Scientific, Singapore.[31] Lipton, A. and Kaushansky, V., 2018. On the first hitting time density of an Ornstein-Uhlenbeck process.arXiv preprint arXiv:1810.02390.[32] Lipton, A. and Kaushansky, V., 2020. On the first hitting time density for a reducible diffusion process.Quantitative Finance, , DOI: 10.1080/14697688.2020.1713394.[33] Lipton, A. and Kaushansky, V., 2020. Physics and Derivatives: On Three Important Problems inMathematical Finance. The Journal of Derivatives.[34] Lipton, A., Kaushansky, V. and Reisinger, C., 2019. Semi-analytical solution of a McKean–Vlasovequation with feedback through hitting a boundary. European Journal of Applied Mathematics, DOI:10.1017/S0956792519000342.[35] Lopez De Prado, M., 2018. Advances in financial machine learning. John Wiley & Sons, Hoboken, NJ,USA.[36] Lopez De Prado, M., 2019. Tactical Investment Algorithms. https://ssrn.com/abstract=3459866.[37] Martin, R., Sch¨oneborn, T., 2011. Mean reversion pays, but costs. Risk Magazine 24(2), 96-101.[38] Ricciardi, L.M., Sato, S., 1988. First-passage-time density and moments of the Ornstein–Uhlenbeckprocess. Journal of Applied Probability 25(1), 43–57.1839] Ross, S.M., 2010. Introduction to Probability Models. Tenth Edition. Academic Press, San Diego, CA,USA[40] Rubinstein, L. 1971. The Stefan Problem. Vol. 27 of Translations of Mathematical Monographs. Amer-ican Mathematical Society, Providence, RI.[41] Suzuki, K., 2018. Optimal pair-trading strategy over long/short/square positions | empirical study. Quan-titative Finance 18 (1), 97-119.[42] Tikhonov, A. N., Samarskii, A.A., 1963. Equations of Mathematical Physics. Dover Publications, NewYork. English translation.[43] Vidyamurthy, G., 2004. Pairs trading: Quantitative methods and analysis. John Wiley & Sons, Hoboken,NY, USA.[44] Watson, N.A., 2012. Introduction to Heat Potential Theory. Number 182 in Mathematical Surveys andMonographs. American Mathematical Society, Providence, RI.[45] Zeng, Z., Lee, C.-G., 2014. Pairs trading: Optimal thresholds and profitability. Quantitative Finance 14(11), 1881-1893. 19 \ Υ , T . , . . , .
96 0 . , . . π ∗ = − . π ∗ = 4 . . π ∗ = − . π ∗ = 4 . . π ∗ = − . π ∗ = 4 . . . π ∗ = − . π ∗ = 0 . . π ∗ = − . π ∗ = 0 . . π ∗ = − . π ∗ = 1 . . . π ∗ = − . π ∗ = 0 . . π ∗ = − . π ∗ = 0 . . π ∗ = − . π ∗ = 0 . . π, π ) for fixed Υ or T .20 a) (b)(c) (d)(e) (f) Figure 1: (a)
E, σ = √ F − E and G as functions of π ≡ π computed by using the method of heat potentialsand the Monte Carlo method for π = −
2; (b) Same quantities as functions of π ≡ π computed using themethod of heat potentials and the Monte Carlo method for π = 1; θ = 1 . T = 1 . a)(b) Figure 2: (a) The Sharpe ratio as a function of π ≡ π computed by using the method of heat potentialsand the Monte Carlo method for π = − π ≡ π computed using themethod of heat potentials and the Monte Carlo method for π = 1; θ = 1 . T = 1 . a) (b)(c) (d)(e) (f) Figure 3: The Sharpe Ratio as a function of ( π, π ) for θ = 1 . T = 1 .
96, c)-d) T = 4 .
26, e)-f) T = 6 . a) (b)(c) (d)(e) (f) Figure 4: The Sharpe Ratio as a function of ( π, π ) for θ = 0 . T = 1 .
96, c)-d) T = 4 .
26, e)-f) T = 6 . a) (b)(c) (d)(e) (f) Figure 5: The Sharpe Ratio as a function of ( π, π ) for θ = 0 . T = 1 .
96, c)-d) T = 4 .
26, e)-f) T = 6 . a) (b)(c) (d) Figure 6: In Figures (a)-(b) we show the expected duration Υ = (1 − exp ( − G ) /
2) as a function of π , π ; inFigures (c)-(d) we show the logarithm of the expected duration G . The corresponding θ = 1 .
0. Here and inFigures 3, 4, 5 π ≡ π , π ≡ π . 26 a)(b) Figure 7: Figure (a) shows the pdf for the process l → u ; Figure (b) shows the pdf for the round-trip process l → u → l . The corresponding l = − / √ u = 1 / √
2. We make this choice because one standard deviationof the stationary O-U distribution is 1 / √
2. 27 a)(b)
Figure 8: Figure (a) shows the nondimensional value function V ( x ) − x for several representative values of λ , the corresponding optimal values of u are 1 .
15, 0 .
97, 0 .
87; Figure (b) shows the nondimensional optimaltake-profit boundary u as a function of the nondimensional stop-loss boundary l .28 a)(b) Figure 9: Figure (a) shows the nondimensional value function V ( x ) − x for l = − .
0, and several rep-resentative values of λ , the corresponding optimal values of u are 1 .
07, 0 .
74, 0 .
50; Figure (b) shows thenondimensional optimal execution boundary u ( l ). 29 a)(b)(c) Figure 10: Figure (a) shows the nondimensional value functions v ( x ) for l = − . λ = 0 . ω = 0 . κ = 1 . u = 1, which is not optimal. Hence, the matching condition is not satisfied. Figure (b) shows thevalue function v ( x ) for the optimal value of u = 1 .
18. Since u is optimal, the matching condition is met, sothat w ( u ) = 0. Figure (c) shows the nondimensional value functions v ( x ) for l = − . u = 1 . λ = 0 . ω = 0 . κ = 1 .
0. 30 a)(b)
Figure 11: Figure (a) shows the nondimensional value functions v ( x ) for l = − .
0, and several representativevalues of λ , the corresponding optimal values of u are 1 .
18, 0 . u ( l ). Here ω = 0 . κ = 1 .
0. 31 a)(b)(c)
Figure 12: In Figure (a) we show g ( x ) corresponding to the critical value q = 0 . g ( x ) corresponding to the critical value q = 1 . g ( x ) has a single rootat x = 0, while in the second case, there are three roots. In Figure (c) we show critical boundaries q (∆)corresponding to three representative values of Γ, Γ = 0 .
05, 0 .
10, 0 ..