SlideShare una empresa de Scribd logo
1 de 47
Descargar para leer sin conexión
Introduction to pair trading
  -Based on cointegration-

       ・Shinichi Takayanagi
         ・Kohta Ishikawa

                               1
Topics
1.   What is pair trading?
2.   What is cointegration?
3.   Idea of pair trading based on cointegration
4.   Simulation by R language
5.   Summary & concluding remarks




                                               2
1. What is pair trading?


                       3
Pair trading was pioneered by …



•   Gerry Bamberger and Nunzio Tartaglia
•   Quantitative group at Morgan Stanley
•   Around 1980s
•   D.E. Shaw & Co. is famous for this strategy




                                                  4
Pair trading is …




Market neutral trading strategy




                              5
Pair trading belongs to …




Statistical Arbitrage


                               6
Basic idea of pair trading …



 Select two stocks
which move similarly

                                 7
Basic idea of pair trading …




Sell high priced stock
Buy low priced stock

                                 8
Basic idea of pair trading …
Stock A : --------
Stock B : --------
                                          Sell
                       Sell             Stock B
                     Stock A



                                       Buy
                                     Stock A
                         Buy
                       Stock B
                                               9
Basic idea of pair trading …



    Usually, monitor
     the difference
between two stock prices

                                  10
Basic idea of pair trading …
   the difference between two stock prices
  Sell
Stock A                          Sell
                               Stock B


       Buy
     Stock B
                                    Buy
                                  Stock A    11
2. What is cointegration?


                       12
Cointegration is …



• Pioneered by Engle and Granger
• Statistical property of time series
• Around 1990s


                                   13
Cointegration is …




Not correlation

                        14
Cointegration and correlation

•Correlation
 –Specify co-movement of return
 –Short term relationship

•Cointegration
 –Specify co-movement of price
 –Long term relationship
                                   15
(weak) Stationary time series

     Not depend on time
・E  X t   
・ X t   
 var                   2


・  X t , X t  s    s 
 cov
                                    16
Example of stationary time series

          White noise
・E  t   0
・  t   
 var                  2


・  t ,  s   0, t  s
 cov
                                      17
Non stationary time series

        Depend on time
・E  X t   t
・ X t    t
                      2
 var
・  X t , X t  s    t , s 
 cov
                                   18
Example of non stationary time series

       Brownian motion

・E Wt   0
・ Wt   t
 var
・ Wt ,Wt  s   t  s
 cov
                                    19
Lag operator   L

・LX t  X t 1
・1  L X t  X t  X t 1  X t
 

                               20
Integrated of order P

X t : non stationary
1  L    p
               X t : stationary


      X t~I  p 
                                  21
Example of “integrate”

  Z t  Z t 1   t : Random walk
   t : White noise
       Calculate difference

Z t  Z t  Z t 1   t : Stationary
 Z t~I 1
                                     22
X t and Yt are cointegrated if …


ut  Yt    X t 
ut : ~I 0, stationary process
X t , Yt : ~I 1

*This is a special version of general cointegration for I(1)
                                                               23
Example of cointegrated time series




                Yt  50  0.5 X t  ut
Xt : --------   X t : 100  2  Normal brownian motion
Yt : --------   ut : 3  Gaussian noise
                                                     24
Example of cointegrated time series




       Plot : ut = Yt – 0.5 Xt
                                      25
ut seems to be…


 Stationary
      &
Mean reversion
                     26
Question




Can we apply this idea
  to trading strategy?

                     27
3. Idea of pair trading
based on cointegration


                      28
Geometric brownian motion

The most widely used model of stock price


dSt
     dt  dWt
 St                          St : Stock price
                              : Average return
                              : Volatility
                             Wt : Brownian motion
                                                29
From Ito’s lemma



                    2
                          
d log St     
                         dt  dWt
                          
                    2    

Log price follow Brownian motion
                                  30
Brownian motion(log price) is …




                    I(1)
* Random walk can be considered as discretization of Brownian motion
                                                                31
Then, we can apply




Cointegration idea
 to log stock price

                          32
Log price spread(*) is…


 Stationary
      &
Mean reversion
※Spreadt : logYt      log X t ,   X t , Yt : stock price
                                                                      33
Simple trading idea

if Spread t  very hish : Buy X t ,Sell Yt
if Spread t  very low : Buy Yt ,Sell X t


 Spread t  log Yt      log  X t 
 X t , Yt : stock price

                                          34
4. Simulation by R language



                         35
Process
1.   Find two likely cointegrated stocks
2.   Estimate spreads
3.   Check stationarity
4.   Create trading signal
5.   Run back-test




                                           36
1.Find two likely cointegrated stocks
> library(PairTrading)
> #load sample stock price data
> data(stock.price)
> #select 2 stocks
> price.pair <- stock.price[,1:2]["2008-12-31::"]
> head(price.pair)
       7201 7203
2009-01-05 333 3010
2009-01-06 341 3050
2009-01-07 374 3200
2009-01-08 361 3140

* Just load sample data in this case….
                                                    37
2. Estimate spreads
> reg <- EstimateParameters(price.pair, method = lm)
> str(reg)
List of 3
 $ spread :An ‘xts’ object from 2008-12-30 to 2011-08-05 containing:
  Data: num [1:635, 1] -0.08544 -0.0539 -0.04306 -0.00426 -0.01966 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr "B"
  Indexed by objects of class: [Date] TZ:
  xts Attributes:
 NULL
 $ hedge.ratio: num 0.0997
 $ premium : num 7.48
                                                                  38
2. Estimate spreads
> plot(reg$spread, main = "Spread“)




    Spreadt  logYt      log X t , X t , Yt : stock price
                                                                      39
3. Check stationarity
> PP.test(as.numeric(reg$spread))
   Phillips-Perron Unit Root Test
data: as.numeric(reg$spread)
Dickey-Fuller = -3.2299, Truncation lag parameter = 6, p-value
   = 0.08278
> adf.test(as.numeric(reg$spread))
   Augmented Dickey-Fuller Test
data: as.numeric(reg$spread)
Dickey-Fuller = -3.6462, Lag order = 8, p-value = 0.02825
alternative hypothesis: stationary

                                                          40
4. Create trading signal
> params <-
  EstimateParametersHistorically(price.pair,
  period = 180)
> signal <- Simple(params$spread, 0.05)
> barplot(signal,col="blue",space = 0, border =
  "blue",xaxt="n",yaxt="n",xlab="",ylab="")
> par(new=TRUE)
> plot(params$spread, type="l", col = "red",
  lwd = 3, main = "Spread & Signal")
                                             41
4. Create trading signal




                           42
5. Run back-test

> return.pairtrading <-
 Return(price.pair, lag(signal),
 lag(params$hedge.ratio))
> plot(100 * cumprod(1 +
 return.pairtrading), main =
 "Performance of pair trading")

                                   43
5. Run back-test




                   44
5. Summary &
concluding remarks


                     45
Summary & concluding remarks
• Pair trading is simple quantitative trading strategy
• Cointegration is long term relation ship of time
  series
• Idea of cointegration may give a chance to make a
  profit from financial market by pair trading

• Next step ….
  – Sophisticate parameter estimation & trading rule
  – Make a simulation close to real

                                                       46
Reference
• Pairs trade(http://en.wikipedia.org/wiki/Pairs_trade)
• Cointegration(http://en.wikipedia.org/wiki/Cointegration)
• Andrew Neil Burgess, “A Computational Methodology for
  Modeling the Dynamics of Statistical Arbitrage”
• Russell Wojcik, “Pairs Trading: A Professional Approach”
• Daniel Herlemont, “Pairs trading, convergence trading,
  cointegration”
• Paul Teetor, “Using R to Test Pairs of Securities for
  Cointegration”(http://quanttrader.info/public/testForCoint.html)
• Ganapathy Vidyamurthy, “Pairs Trading: Quantitative Methods
  and Analysis “



                                                                47

Más contenido relacionado

La actualidad más candente

共和分ランクに依存した確率制御アプローチによる多資産間のダイナミックトレーディング
共和分ランクに依存した確率制御アプローチによる多資産間のダイナミックトレーディング共和分ランクに依存した確率制御アプローチによる多資産間のダイナミックトレーディング
共和分ランクに依存した確率制御アプローチによる多資産間のダイナミックトレーディング東出 卓朗
 
Money markets ch. 9 (uts)
Money markets   ch. 9 (uts)Money markets   ch. 9 (uts)
Money markets ch. 9 (uts)Rika Hernawati
 
Stochastic Control/Reinforcement Learning for Optimal Market Making
Stochastic Control/Reinforcement Learning for Optimal Market MakingStochastic Control/Reinforcement Learning for Optimal Market Making
Stochastic Control/Reinforcement Learning for Optimal Market MakingAshwin Rao
 
Quant insti webinar on algorithmic trading for technocrats!
Quant insti webinar on algorithmic trading for technocrats!Quant insti webinar on algorithmic trading for technocrats!
Quant insti webinar on algorithmic trading for technocrats!QuantInsti
 
Webinar Mean Reversion Strategies Presentation
Webinar Mean Reversion Strategies PresentationWebinar Mean Reversion Strategies Presentation
Webinar Mean Reversion Strategies PresentationQuantInsti
 
How To Trade Regular Divergence with MACD, RSI, Stochastics
How To Trade Regular Divergence with MACD, RSI, StochasticsHow To Trade Regular Divergence with MACD, RSI, Stochastics
How To Trade Regular Divergence with MACD, RSI, StochasticsNetpicksTrading
 
Basic Options Trading Tools
Basic Options Trading ToolsBasic Options Trading Tools
Basic Options Trading ToolsInvestingTips
 
Limiti del modello Black-Scholes-Merton e vantaggi del metodo Monte Carlo: an...
Limiti del modello Black-Scholes-Merton e vantaggi del metodo Monte Carlo: an...Limiti del modello Black-Scholes-Merton e vantaggi del metodo Monte Carlo: an...
Limiti del modello Black-Scholes-Merton e vantaggi del metodo Monte Carlo: an...Matteo Evangelisti
 
アセットアロケーションの未来
アセットアロケーションの未来アセットアロケーションの未来
アセットアロケーションの未来Kei Nakagawa
 
Derivatives - Delta Gamma Vega Theta Rho
Derivatives - Delta  Gamma Vega Theta RhoDerivatives - Delta  Gamma Vega Theta Rho
Derivatives - Delta Gamma Vega Theta RhoAmeya Ranadive
 
Option Gamma - Dynamic Delta Hedging
Option Gamma - Dynamic Delta HedgingOption Gamma - Dynamic Delta Hedging
Option Gamma - Dynamic Delta HedgingErdem Tokmakoglu
 
因果チェーンを用いたリードラグ効果の実証分析
因果チェーンを用いたリードラグ効果の実証分析因果チェーンを用いたリードラグ効果の実証分析
因果チェーンを用いたリードラグ効果の実証分析Kei Nakagawa
 

La actualidad más candente (20)

共和分ランクに依存した確率制御アプローチによる多資産間のダイナミックトレーディング
共和分ランクに依存した確率制御アプローチによる多資産間のダイナミックトレーディング共和分ランクに依存した確率制御アプローチによる多資産間のダイナミックトレーディング
共和分ランクに依存した確率制御アプローチによる多資産間のダイナミックトレーディング
 
Statistical arbitrage
Statistical arbitrageStatistical arbitrage
Statistical arbitrage
 
Money markets ch. 9 (uts)
Money markets   ch. 9 (uts)Money markets   ch. 9 (uts)
Money markets ch. 9 (uts)
 
Stochastic Control/Reinforcement Learning for Optimal Market Making
Stochastic Control/Reinforcement Learning for Optimal Market MakingStochastic Control/Reinforcement Learning for Optimal Market Making
Stochastic Control/Reinforcement Learning for Optimal Market Making
 
Understanding Diagonal Spreads
Understanding Diagonal SpreadsUnderstanding Diagonal Spreads
Understanding Diagonal Spreads
 
Quant insti webinar on algorithmic trading for technocrats!
Quant insti webinar on algorithmic trading for technocrats!Quant insti webinar on algorithmic trading for technocrats!
Quant insti webinar on algorithmic trading for technocrats!
 
Webinar Mean Reversion Strategies Presentation
Webinar Mean Reversion Strategies PresentationWebinar Mean Reversion Strategies Presentation
Webinar Mean Reversion Strategies Presentation
 
How To Trade Regular Divergence with MACD, RSI, Stochastics
How To Trade Regular Divergence with MACD, RSI, StochasticsHow To Trade Regular Divergence with MACD, RSI, Stochastics
How To Trade Regular Divergence with MACD, RSI, Stochastics
 
Open Interest
Open InterestOpen Interest
Open Interest
 
Basic Options Trading Tools
Basic Options Trading ToolsBasic Options Trading Tools
Basic Options Trading Tools
 
Limiti del modello Black-Scholes-Merton e vantaggi del metodo Monte Carlo: an...
Limiti del modello Black-Scholes-Merton e vantaggi del metodo Monte Carlo: an...Limiti del modello Black-Scholes-Merton e vantaggi del metodo Monte Carlo: an...
Limiti del modello Black-Scholes-Merton e vantaggi del metodo Monte Carlo: an...
 
アセットアロケーションの未来
アセットアロケーションの未来アセットアロケーションの未来
アセットアロケーションの未来
 
Euro notes
Euro notesEuro notes
Euro notes
 
Derivatives
DerivativesDerivatives
Derivatives
 
Derivatives Fundamentals
Derivatives FundamentalsDerivatives Fundamentals
Derivatives Fundamentals
 
Derivatives - Delta Gamma Vega Theta Rho
Derivatives - Delta  Gamma Vega Theta RhoDerivatives - Delta  Gamma Vega Theta Rho
Derivatives - Delta Gamma Vega Theta Rho
 
Efficient Market Hypothesis
Efficient Market HypothesisEfficient Market Hypothesis
Efficient Market Hypothesis
 
Option Gamma - Dynamic Delta Hedging
Option Gamma - Dynamic Delta HedgingOption Gamma - Dynamic Delta Hedging
Option Gamma - Dynamic Delta Hedging
 
因果チェーンを用いたリードラグ効果の実証分析
因果チェーンを用いたリードラグ効果の実証分析因果チェーンを用いたリードラグ効果の実証分析
因果チェーンを用いたリードラグ効果の実証分析
 
CANDLESTICK PROFITS.pdf
CANDLESTICK PROFITS.pdfCANDLESTICK PROFITS.pdf
CANDLESTICK PROFITS.pdf
 

Similar a Introduction to pairtrading

Dynamic Trading Volume
Dynamic Trading VolumeDynamic Trading Volume
Dynamic Trading Volumeguasoni
 
Transactional Data Mining
Transactional Data MiningTransactional Data Mining
Transactional Data MiningTed Dunning
 
Incomplete-Market Equilibrium with Unhedgeable Fundamentals and Heterogeneous...
Incomplete-Market Equilibrium with Unhedgeable Fundamentals and Heterogeneous...Incomplete-Market Equilibrium with Unhedgeable Fundamentals and Heterogeneous...
Incomplete-Market Equilibrium with Unhedgeable Fundamentals and Heterogeneous...guasoni
 
Hedging, Arbitrage, and Optimality with Superlinear Frictions
Hedging, Arbitrage, and Optimality with Superlinear FrictionsHedging, Arbitrage, and Optimality with Superlinear Frictions
Hedging, Arbitrage, and Optimality with Superlinear Frictionsguasoni
 
Black-Scholes overview
Black-Scholes overviewBlack-Scholes overview
Black-Scholes overviewInon Sharony
 
Estimation of Static Discrete Choice Models Using Market Level Data
Estimation of Static Discrete Choice Models Using Market Level DataEstimation of Static Discrete Choice Models Using Market Level Data
Estimation of Static Discrete Choice Models Using Market Level DataNBER
 
Transaction Costs Made Tractable
Transaction Costs Made TractableTransaction Costs Made Tractable
Transaction Costs Made Tractableguasoni
 
Introduction to time series.pptx
Introduction to time series.pptxIntroduction to time series.pptx
Introduction to time series.pptxHamidUllah50
 
UT Austin - Portugal Lectures on Portfolio Choice
UT Austin - Portugal Lectures on Portfolio ChoiceUT Austin - Portugal Lectures on Portfolio Choice
UT Austin - Portugal Lectures on Portfolio Choiceguasoni
 
The Orbit Rulebook.pdf
The Orbit Rulebook.pdfThe Orbit Rulebook.pdf
The Orbit Rulebook.pdfSamm Ikwue
 
Stochastic Dividend Modeling
Stochastic Dividend ModelingStochastic Dividend Modeling
Stochastic Dividend ModelingClebson Derivan
 
Introduction to Interest Rate Models by Antoine Savine
Introduction to Interest Rate Models by Antoine SavineIntroduction to Interest Rate Models by Antoine Savine
Introduction to Interest Rate Models by Antoine SavineAntoine Savine
 
Stochastic Control of Optimal Trade Order Execution
Stochastic Control of Optimal Trade Order ExecutionStochastic Control of Optimal Trade Order Execution
Stochastic Control of Optimal Trade Order ExecutionAshwin Rao
 
An Approximate Distribution of Delta-Hedging Errors in a Jump-Diffusion Model...
An Approximate Distribution of Delta-Hedging Errors in a Jump-Diffusion Model...An Approximate Distribution of Delta-Hedging Errors in a Jump-Diffusion Model...
An Approximate Distribution of Delta-Hedging Errors in a Jump-Diffusion Model...Volatility
 
A Quantitative Case Study on the Impact of Transaction Cost in High-Frequency...
A Quantitative Case Study on the Impact of Transaction Cost in High-Frequency...A Quantitative Case Study on the Impact of Transaction Cost in High-Frequency...
A Quantitative Case Study on the Impact of Transaction Cost in High-Frequency...Cognizant
 

Similar a Introduction to pairtrading (20)

Dynamic Trading Volume
Dynamic Trading VolumeDynamic Trading Volume
Dynamic Trading Volume
 
Transactional Data Mining
Transactional Data MiningTransactional Data Mining
Transactional Data Mining
 
Incomplete-Market Equilibrium with Unhedgeable Fundamentals and Heterogeneous...
Incomplete-Market Equilibrium with Unhedgeable Fundamentals and Heterogeneous...Incomplete-Market Equilibrium with Unhedgeable Fundamentals and Heterogeneous...
Incomplete-Market Equilibrium with Unhedgeable Fundamentals and Heterogeneous...
 
Hedging, Arbitrage, and Optimality with Superlinear Frictions
Hedging, Arbitrage, and Optimality with Superlinear FrictionsHedging, Arbitrage, and Optimality with Superlinear Frictions
Hedging, Arbitrage, and Optimality with Superlinear Frictions
 
Black-Scholes overview
Black-Scholes overviewBlack-Scholes overview
Black-Scholes overview
 
Estimation of Static Discrete Choice Models Using Market Level Data
Estimation of Static Discrete Choice Models Using Market Level DataEstimation of Static Discrete Choice Models Using Market Level Data
Estimation of Static Discrete Choice Models Using Market Level Data
 
Pres fibe2015-pbs-org
Pres fibe2015-pbs-orgPres fibe2015-pbs-org
Pres fibe2015-pbs-org
 
Pres-Fibe2015-pbs-Org
Pres-Fibe2015-pbs-OrgPres-Fibe2015-pbs-Org
Pres-Fibe2015-pbs-Org
 
Transaction Costs Made Tractable
Transaction Costs Made TractableTransaction Costs Made Tractable
Transaction Costs Made Tractable
 
Margrabe option
Margrabe optionMargrabe option
Margrabe option
 
Black-Schole Model.pptx
Black-Schole Model.pptxBlack-Schole Model.pptx
Black-Schole Model.pptx
 
Introduction to time series.pptx
Introduction to time series.pptxIntroduction to time series.pptx
Introduction to time series.pptx
 
DP_M4_L2.pdf
DP_M4_L2.pdfDP_M4_L2.pdf
DP_M4_L2.pdf
 
UT Austin - Portugal Lectures on Portfolio Choice
UT Austin - Portugal Lectures on Portfolio ChoiceUT Austin - Portugal Lectures on Portfolio Choice
UT Austin - Portugal Lectures on Portfolio Choice
 
The Orbit Rulebook.pdf
The Orbit Rulebook.pdfThe Orbit Rulebook.pdf
The Orbit Rulebook.pdf
 
Stochastic Dividend Modeling
Stochastic Dividend ModelingStochastic Dividend Modeling
Stochastic Dividend Modeling
 
Introduction to Interest Rate Models by Antoine Savine
Introduction to Interest Rate Models by Antoine SavineIntroduction to Interest Rate Models by Antoine Savine
Introduction to Interest Rate Models by Antoine Savine
 
Stochastic Control of Optimal Trade Order Execution
Stochastic Control of Optimal Trade Order ExecutionStochastic Control of Optimal Trade Order Execution
Stochastic Control of Optimal Trade Order Execution
 
An Approximate Distribution of Delta-Hedging Errors in a Jump-Diffusion Model...
An Approximate Distribution of Delta-Hedging Errors in a Jump-Diffusion Model...An Approximate Distribution of Delta-Hedging Errors in a Jump-Diffusion Model...
An Approximate Distribution of Delta-Hedging Errors in a Jump-Diffusion Model...
 
A Quantitative Case Study on the Impact of Transaction Cost in High-Frequency...
A Quantitative Case Study on the Impact of Transaction Cost in High-Frequency...A Quantitative Case Study on the Impact of Transaction Cost in High-Frequency...
A Quantitative Case Study on the Impact of Transaction Cost in High-Frequency...
 

Más de Kohta Ishikawa

[Paper reading] Hamiltonian Neural Networks
 [Paper reading] Hamiltonian Neural Networks [Paper reading] Hamiltonian Neural Networks
[Paper reading] Hamiltonian Neural NetworksKohta Ishikawa
 
Spherical CNNs paper reading
Spherical CNNs paper readingSpherical CNNs paper reading
Spherical CNNs paper readingKohta Ishikawa
 
Model Transport: Towards Scalable Transfer Learning on Manifolds 論文紹介
Model Transport: Towards Scalable Transfer Learning on Manifolds 論文紹介Model Transport: Towards Scalable Transfer Learning on Manifolds 論文紹介
Model Transport: Towards Scalable Transfer Learning on Manifolds 論文紹介Kohta Ishikawa
 
A brief explanation of Causal Entropic Forces
A brief explanation of Causal Entropic ForcesA brief explanation of Causal Entropic Forces
A brief explanation of Causal Entropic ForcesKohta Ishikawa
 
量子アニーリング解説 1
量子アニーリング解説 1量子アニーリング解説 1
量子アニーリング解説 1Kohta Ishikawa
 
R Language Definition 2.2 to 2.3
R Language Definition 2.2 to 2.3R Language Definition 2.2 to 2.3
R Language Definition 2.2 to 2.3Kohta Ishikawa
 
Nonlinear Filtering and Path Integral Method (Paper Review)
Nonlinear Filtering and Path Integral Method (Paper Review)Nonlinear Filtering and Path Integral Method (Paper Review)
Nonlinear Filtering and Path Integral Method (Paper Review)Kohta Ishikawa
 
Particle Filter Tracking in Python
Particle Filter Tracking in PythonParticle Filter Tracking in Python
Particle Filter Tracking in PythonKohta Ishikawa
 
Rでisomap(多様体学習のはなし)
Rでisomap(多様体学習のはなし)Rでisomap(多様体学習のはなし)
Rでisomap(多様体学習のはなし)Kohta Ishikawa
 
Introduction to statistics
Introduction to statisticsIntroduction to statistics
Introduction to statisticsKohta Ishikawa
 

Más de Kohta Ishikawa (11)

[Paper reading] Hamiltonian Neural Networks
 [Paper reading] Hamiltonian Neural Networks [Paper reading] Hamiltonian Neural Networks
[Paper reading] Hamiltonian Neural Networks
 
Spherical CNNs paper reading
Spherical CNNs paper readingSpherical CNNs paper reading
Spherical CNNs paper reading
 
Model Transport: Towards Scalable Transfer Learning on Manifolds 論文紹介
Model Transport: Towards Scalable Transfer Learning on Manifolds 論文紹介Model Transport: Towards Scalable Transfer Learning on Manifolds 論文紹介
Model Transport: Towards Scalable Transfer Learning on Manifolds 論文紹介
 
A brief explanation of Causal Entropic Forces
A brief explanation of Causal Entropic ForcesA brief explanation of Causal Entropic Forces
A brief explanation of Causal Entropic Forces
 
量子アニーリング解説 1
量子アニーリング解説 1量子アニーリング解説 1
量子アニーリング解説 1
 
R Language Definition 2.2 to 2.3
R Language Definition 2.2 to 2.3R Language Definition 2.2 to 2.3
R Language Definition 2.2 to 2.3
 
Nonlinear Filtering and Path Integral Method (Paper Review)
Nonlinear Filtering and Path Integral Method (Paper Review)Nonlinear Filtering and Path Integral Method (Paper Review)
Nonlinear Filtering and Path Integral Method (Paper Review)
 
Particle Filter Tracking in Python
Particle Filter Tracking in PythonParticle Filter Tracking in Python
Particle Filter Tracking in Python
 
Rでisomap(多様体学習のはなし)
Rでisomap(多様体学習のはなし)Rでisomap(多様体学習のはなし)
Rでisomap(多様体学習のはなし)
 
Introduction to statistics
Introduction to statisticsIntroduction to statistics
Introduction to statistics
 
PRML_2.3.1~2.3.3
PRML_2.3.1~2.3.3PRML_2.3.1~2.3.3
PRML_2.3.1~2.3.3
 

Último

Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel
 
Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperityhemanthkumar470700
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Adnet Communications
 
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan CytotecJual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan CytotecZurliaSoop
 
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All TimeCall 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All Timegargpaaro
 
BeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdfBeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdfDerekIwanaka1
 
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...meghakumariji156
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...daisycvs
 
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon investment
 
Over the Top (OTT) Market Size & Growth Outlook 2024-2030
Over the Top (OTT) Market Size & Growth Outlook 2024-2030Over the Top (OTT) Market Size & Growth Outlook 2024-2030
Over the Top (OTT) Market Size & Growth Outlook 2024-2030tarushabhavsar
 
Putting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxPutting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxCynthia Clay
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1kcpayne
 
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al MizharAl Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizharallensay1
 
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165meghakumariji156
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityEric T. Tung
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon investment
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptxnandhinijagan9867
 
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in OmanMifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Omaninstagramfab782445
 

Último (20)

Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024
 
Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperity
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
 
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan CytotecJual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
 
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All TimeCall 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
 
BeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdfBeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdf
 
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business Potential
 
Over the Top (OTT) Market Size & Growth Outlook 2024-2030
Over the Top (OTT) Market Size & Growth Outlook 2024-2030Over the Top (OTT) Market Size & Growth Outlook 2024-2030
Over the Top (OTT) Market Size & Growth Outlook 2024-2030
 
Putting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxPutting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptx
 
HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1
 
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al MizharAl Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
 
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in OmanMifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
 

Introduction to pairtrading

  • 1. Introduction to pair trading -Based on cointegration- ・Shinichi Takayanagi ・Kohta Ishikawa 1
  • 2. Topics 1. What is pair trading? 2. What is cointegration? 3. Idea of pair trading based on cointegration 4. Simulation by R language 5. Summary & concluding remarks 2
  • 3. 1. What is pair trading? 3
  • 4. Pair trading was pioneered by … • Gerry Bamberger and Nunzio Tartaglia • Quantitative group at Morgan Stanley • Around 1980s • D.E. Shaw & Co. is famous for this strategy 4
  • 5. Pair trading is … Market neutral trading strategy 5
  • 6. Pair trading belongs to … Statistical Arbitrage 6
  • 7. Basic idea of pair trading … Select two stocks which move similarly 7
  • 8. Basic idea of pair trading … Sell high priced stock Buy low priced stock 8
  • 9. Basic idea of pair trading … Stock A : -------- Stock B : -------- Sell Sell Stock B Stock A Buy Stock A Buy Stock B 9
  • 10. Basic idea of pair trading … Usually, monitor the difference between two stock prices 10
  • 11. Basic idea of pair trading … the difference between two stock prices Sell Stock A Sell Stock B Buy Stock B Buy Stock A 11
  • 12. 2. What is cointegration? 12
  • 13. Cointegration is … • Pioneered by Engle and Granger • Statistical property of time series • Around 1990s 13
  • 14. Cointegration is … Not correlation 14
  • 15. Cointegration and correlation •Correlation –Specify co-movement of return –Short term relationship •Cointegration –Specify co-movement of price –Long term relationship 15
  • 16. (weak) Stationary time series Not depend on time ・E  X t    ・ X t    var 2 ・  X t , X t  s    s  cov 16
  • 17. Example of stationary time series White noise ・E  t   0 ・  t    var 2 ・  t ,  s   0, t  s cov 17
  • 18. Non stationary time series Depend on time ・E  X t   t ・ X t    t 2 var ・  X t , X t  s    t , s  cov 18
  • 19. Example of non stationary time series Brownian motion ・E Wt   0 ・ Wt   t var ・ Wt ,Wt  s   t  s cov 19
  • 20. Lag operator L ・LX t  X t 1 ・1  L X t  X t  X t 1  X t  20
  • 21. Integrated of order P X t : non stationary 1  L  p X t : stationary X t~I  p  21
  • 22. Example of “integrate” Z t  Z t 1   t : Random walk  t : White noise Calculate difference Z t  Z t  Z t 1   t : Stationary  Z t~I 1 22
  • 23. X t and Yt are cointegrated if … ut  Yt    X t  ut : ~I 0, stationary process X t , Yt : ~I 1 *This is a special version of general cointegration for I(1) 23
  • 24. Example of cointegrated time series Yt  50  0.5 X t  ut Xt : -------- X t : 100  2  Normal brownian motion Yt : -------- ut : 3  Gaussian noise 24
  • 25. Example of cointegrated time series Plot : ut = Yt – 0.5 Xt 25
  • 26. ut seems to be… Stationary & Mean reversion 26
  • 27. Question Can we apply this idea to trading strategy? 27
  • 28. 3. Idea of pair trading based on cointegration 28
  • 29. Geometric brownian motion The most widely used model of stock price dSt  dt  dWt St St : Stock price  : Average return  : Volatility Wt : Brownian motion 29
  • 30. From Ito’s lemma   2  d log St       dt  dWt   2  Log price follow Brownian motion 30
  • 31. Brownian motion(log price) is … I(1) * Random walk can be considered as discretization of Brownian motion 31
  • 32. Then, we can apply Cointegration idea to log stock price 32
  • 33. Log price spread(*) is… Stationary & Mean reversion ※Spreadt : logYt      log X t , X t , Yt : stock price 33
  • 34. Simple trading idea if Spread t  very hish : Buy X t ,Sell Yt if Spread t  very low : Buy Yt ,Sell X t Spread t  log Yt      log  X t  X t , Yt : stock price 34
  • 35. 4. Simulation by R language 35
  • 36. Process 1. Find two likely cointegrated stocks 2. Estimate spreads 3. Check stationarity 4. Create trading signal 5. Run back-test 36
  • 37. 1.Find two likely cointegrated stocks > library(PairTrading) > #load sample stock price data > data(stock.price) > #select 2 stocks > price.pair <- stock.price[,1:2]["2008-12-31::"] > head(price.pair) 7201 7203 2009-01-05 333 3010 2009-01-06 341 3050 2009-01-07 374 3200 2009-01-08 361 3140 * Just load sample data in this case…. 37
  • 38. 2. Estimate spreads > reg <- EstimateParameters(price.pair, method = lm) > str(reg) List of 3 $ spread :An ‘xts’ object from 2008-12-30 to 2011-08-05 containing: Data: num [1:635, 1] -0.08544 -0.0539 -0.04306 -0.00426 -0.01966 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr "B" Indexed by objects of class: [Date] TZ: xts Attributes: NULL $ hedge.ratio: num 0.0997 $ premium : num 7.48 38
  • 39. 2. Estimate spreads > plot(reg$spread, main = "Spread“) Spreadt  logYt      log X t , X t , Yt : stock price 39
  • 40. 3. Check stationarity > PP.test(as.numeric(reg$spread)) Phillips-Perron Unit Root Test data: as.numeric(reg$spread) Dickey-Fuller = -3.2299, Truncation lag parameter = 6, p-value = 0.08278 > adf.test(as.numeric(reg$spread)) Augmented Dickey-Fuller Test data: as.numeric(reg$spread) Dickey-Fuller = -3.6462, Lag order = 8, p-value = 0.02825 alternative hypothesis: stationary 40
  • 41. 4. Create trading signal > params <- EstimateParametersHistorically(price.pair, period = 180) > signal <- Simple(params$spread, 0.05) > barplot(signal,col="blue",space = 0, border = "blue",xaxt="n",yaxt="n",xlab="",ylab="") > par(new=TRUE) > plot(params$spread, type="l", col = "red", lwd = 3, main = "Spread & Signal") 41
  • 42. 4. Create trading signal 42
  • 43. 5. Run back-test > return.pairtrading <- Return(price.pair, lag(signal), lag(params$hedge.ratio)) > plot(100 * cumprod(1 + return.pairtrading), main = "Performance of pair trading") 43
  • 46. Summary & concluding remarks • Pair trading is simple quantitative trading strategy • Cointegration is long term relation ship of time series • Idea of cointegration may give a chance to make a profit from financial market by pair trading • Next step …. – Sophisticate parameter estimation & trading rule – Make a simulation close to real 46
  • 47. Reference • Pairs trade(http://en.wikipedia.org/wiki/Pairs_trade) • Cointegration(http://en.wikipedia.org/wiki/Cointegration) • Andrew Neil Burgess, “A Computational Methodology for Modeling the Dynamics of Statistical Arbitrage” • Russell Wojcik, “Pairs Trading: A Professional Approach” • Daniel Herlemont, “Pairs trading, convergence trading, cointegration” • Paul Teetor, “Using R to Test Pairs of Securities for Cointegration”(http://quanttrader.info/public/testForCoint.html) • Ganapathy Vidyamurthy, “Pairs Trading: Quantitative Methods and Analysis “ 47