optimal stochastic control for pairs trading
play

Optimal Stochastic Control for Pairs Trading Hui Gong, UCL - PowerPoint PPT Presentation

Outline Introduction Optimal Stochastic Control Model The HJB equation & Its Solution Implementation & Exercise Optimal Stochastic Control for Pairs Trading Hui Gong, UCL http://www.homepages.ucl.ac.uk/ucahgon/ March 26, 2014 Hui


  1. Outline Introduction Optimal Stochastic Control Model The HJB equation & Its Solution Implementation & Exercise Optimal Stochastic Control for Pairs Trading Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ March 26, 2014 Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  2. Outline Introduction Optimal Stochastic Control Model The HJB equation & Its Solution Implementation & Exercise Introduction Optimal Stochastic Control Model Dynamics of Paired Stock Prices Co-integrating Vector Dynamic of Wealth Value Integrability Condition Agent’s Objective The HJB equation & Its Solution HJB Equation Particular Case δ = 0 Solution Implementation & Exercise Implement Pairs Trading in MATLAB Exercise Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  3. Outline Introduction Optimal Stochastic Control Model The HJB equation & Its Solution Implementation & Exercise Introduction Pairs Trading is an investment strategy used by many Hedge Funds. Consider two co-integrated and correlated stocks which trade at some spread. For a given period, we need to maximise the agent’s terminal utility of wealth subject to budget constraints. Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  4. Outline Dynamics of Paired Stock Prices Introduction Co-integrating Vector Optimal Stochastic Control Model Dynamic of Wealth Value The HJB equation & Its Solution Integrability Condition Implementation & Exercise Agent’s Objective Let S 1 and S 2 denote the co-integrated stock price which satisfies the stochastic differential equations = ( µ 1 + δ z ( t )) S 1 dt + σ 1 S 1 dB 1 , (1) dS 1 � � � 1 − ρ 2 dB 2 dS 2 = µ 2 S 2 dt + σ 2 S 2 ρ dB 1 + , (2) where B 1 and B 2 are independent Brownian Motions. Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  5. Outline Dynamics of Paired Stock Prices Introduction Co-integrating Vector Optimal Stochastic Control Model Dynamic of Wealth Value The HJB equation & Its Solution Integrability Condition Implementation & Exercise Agent’s Objective The instantaneous co-integrating vector z ( t ) is defined by z ( t ) = a + ln S 1 ( t ) + β ln S 2 ( t ) . (3) The dynamics of z ( t ) is a stationary Ornstein-Uhlenbeck process dz = α ( η − z ) dt + σ β dB t , where α = − δ is the speed of mean reversion, � σ 2 1 + β 2 σ 2 σ β = 2 + 2 βσ 1 σ 2 ρ , √ 1 − ρ 2 B 1 + β σ 2 B t = σ 1 + βσ 2 ρ B 2 is a Brownian motion adapted to σ β σ β F t and µ 1 − σ 2 µ 2 − σ 2 η = − 1 � � �� 1 2 2 + β δ 2 is the equilibrium level. Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  6. Outline Dynamics of Paired Stock Prices Introduction Co-integrating Vector Optimal Stochastic Control Model Dynamic of Wealth Value The HJB equation & Its Solution Integrability Condition Implementation & Exercise Agent’s Objective The dynamic of wealth value is given by dW = π 1 ( t ) dS 1 + π 2 ( t ) dS 2 . (4) Substitute equation (1) and (2) into the value of wealth (4), then we obtain the SDE as below dW = π 1 ( t ) ( µ 1 + δ z ( t )) S 1 dt + π 2 ( t ) µ 2 S 2 dt � � � 1 − ρ 2 dB 2 + π 1 ( t ) σ 1 S 1 dB 1 + π 2 ( t ) σ 2 S 2 ρ dB 1 + (5) . Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  7. Outline Dynamics of Paired Stock Prices Introduction Co-integrating Vector Optimal Stochastic Control Model Dynamic of Wealth Value The HJB equation & Its Solution Integrability Condition Implementation & Exercise Agent’s Objective A pair of controls ( π 1 , π 2 ) is said to be admissible if π 1 and π 2 are real-valued, progressively measurable, are such that, (1)(2)(5) define a unique solution ( W , S 1 , S 2 ) for any t ∈ [0 , T ] and ( π 1 , π 2 , S 1 , S 2 ) satisfy the integrability condition � T ( π 1 S 1 ) 2 + ( π 2 S 2 ) 2 ds < + ∞ . E t Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  8. Outline Dynamics of Paired Stock Prices Introduction Co-integrating Vector Optimal Stochastic Control Model Dynamic of Wealth Value The HJB equation & Its Solution Integrability Condition Implementation & Exercise Agent’s Objective Assume that the agent’s objective is � � �� W t , W , S 1 , S 2 J ( t , W , S 1 , S 2 ) = max (6) E U , T ( π 1 ,π 2 ) ∈A t where J ( t , W , S 1 , S 2 ) denote the value function, the agent seeks an admissible control pair ( π 1 , π 2 ) that maximizes the utility of wealth at time T . Specifying U ( W ). Now let us assume the utility function like U ( W ) = − exp( − γ W ) , (7) which is the CARA (Constant Absolute Risk Aversion) utility, where γ > 0 is constant and equal to the absolute risk aversion. Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  9. Outline Introduction HJB Equation Particular Case δ = 0 Optimal Stochastic Control Model The HJB equation & Its Solution Solution Implementation & Exercise We expect the value function J ( t , W , S 1 , S 2 ) satisfy the following HJB partial differential equation: J t + max π 1 ,π 2 [ ( π 1 ( µ 1 + δ z ) S 1 + π 2 µ 2 S 2 ) J W + ( µ 1 + δ z ) S 1 J S 1 + µ 2 S 2 J S 2 + π 1 σ 2 1 S 2 1 J WS 1 + π 2 ρσ 1 σ 2 S 1 S 2 J WS 1 + π 2 σ 2 2 S 2 2 J WS 2 + π 1 ρσ 1 σ 2 S 1 S 2 J WS 2 +1 π 2 1 σ 2 1 S 2 1 + ρπ 1 π 2 σ 1 σ 2 S 1 S 2 + π 2 2 σ 2 2 S 2 � � J WW 2 2 +1 1 J S 1 S 1 + ρσ 1 σ 2 S 1 S 2 J S 1 S 2 + 1 2 σ 2 1 S 2 2 σ 2 2 S 2 2 J S 2 S 2 ] = 0 , (8) with the final condition J ( T , W , S 1 , S 2 ) = U ( W T ) = − exp( − γ W T ) . (9) Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  10. Outline Introduction HJB Equation Particular Case δ = 0 Optimal Stochastic Control Model The HJB equation & Its Solution Solution Implementation & Exercise Ansatz S 1 = e x , S 2 = e y , J ( t , W , S 1 , S 2 ) = − e − γ W g ( t , x , y ) . Then the transformed HJB equation will be g t = max[ ( π 1 ( µ 1 + δ z ) S 1 + π 2 µ 2 S 2 ) γ g − ( µ 1 + δ z ) g x − µ 2 g y + π 1 σ 2 1 S 1 γ g x + π 2 ρσ 1 σ 2 S 2 γ g x + π 2 σ 2 2 S 2 γ g y + π 1 ρσ 1 σ 2 S 1 γ g y − 1 π 2 1 σ 2 1 S 2 1 + 2 π 1 π 2 ρσ 1 σ 2 S 1 S 2 + π 2 2 σ 2 2 S 2 γ 2 g � � 2 2 − 1 1 ( g xx − g x ) − 1 2 σ 2 2 σ 2 2 ( g yy − g y ) − ρσ 1 σ 2 g xy ] , (10) subject to g ( T , x , y ) = 1 . (11) Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  11. Outline Introduction HJB Equation Particular Case δ = 0 Optimal Stochastic Control Model The HJB equation & Its Solution Solution Implementation & Exercise Optimal Control Weights (initial) ( µ 1 + δ z ) g x µ 2 π ∗ = + (12) − ρ , 1 γ (1 − ρ 2 ) σ 2 γ (1 − ρ 2 ) σ 1 σ 2 S 1 γ gS 1 1 S 1 µ 2 g y ( µ 1 + δ z ) π ∗ = + − ρ . (13) 2 γ (1 − ρ 2 ) σ 2 γ (1 − ρ 2 ) σ 1 σ 2 S 2 2 S 2 γ gS 2 Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  12. Outline Introduction HJB Equation Particular Case δ = 0 Optimal Stochastic Control Model The HJB equation & Its Solution Solution Implementation & Exercise Particular Case δ = 0 If we set δ = 0, the value function is independent of the stocks and the amount invested in each stock are constant. Then the closed form for the value function and the amount corresponding to δ = 0 will be � µ 2 + µ 2 � � � 1 − 2 ρµ 1 µ 2 1 2 g ( t , x , y ) = exp ( T − t ) , − σ 2 σ 2 2(1 − ρ 2 ) σ 1 σ 2 1 2 µ 1 ρµ 2 π ∗ 1 S 1 = − , γ (1 − ρ 2 ) σ 2 γ (1 − ρ 2 ) σ 1 σ 2 1 µ 2 ρµ 1 π ∗ = 2 S 2 − . γ (1 − ρ 2 ) σ 2 γ (1 − ρ 2 ) σ 1 σ 2 2 Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

  13. Outline Introduction HJB Equation Particular Case δ = 0 Optimal Stochastic Control Model The HJB equation & Its Solution Solution Implementation & Exercise Reduce the HJB equation into a one-dimensional equation by letting X = µ 1 + δ z = µ 1 + δ ( a + x + β y ) , and by using the exponential change of variable Φ( t , X ) = − ln( g ( t , x , y )) i.e. g = exp( − Φ).Then we will obtain the linear parabolic PDE 2( X 2 + µ 2 � 1 � 1 ) − ρ µ 2 X + 1 2 2( σ 2 1 + βσ 2 Φ t = 2 )( δ Φ X ) − 1 − ρ 2 σ 2 σ 2 σ 1 σ 2 1 2 − 1 2( σ 2 1 + β 2 σ 2 2 + 2 σ 1 σ 2 βρ )( δ 2 Φ XX ) . (14) for any real number X and time 0 � t < T and is subject to the terminal condition Φ( T , X ) = 0 . (15) Hui Gong, UCL http://www.homepages.ucl.ac.uk/˜ucahgon/ Optimal Stochastic Control for Pairs Trading

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend