cointegration and pair trading

Upload: soumensahil

Post on 06-Jul-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/17/2019 Cointegration and Pair Trading

    1/19

     

    กก

    ก     20  2555

    ก 

    Cointegration and Pair Trading

          .   

      21 ก 2555 15.00 16.30 .

    206 ก 

       

  • 8/17/2019 Cointegration and Pair Trading

    2/19

    Asst. Prof. Dr. Sarayut Nathaphan

    0

    • Simple steps in pair trading (Traditional Pair Trading)

    • Drawbacks of general strategy and suggested

    solution.• What is pair trading?

     • a s ca r rage co n egra on pa r ra ng

    • What/Why Stationarity?

    • Why is stationarity important?

    • Is correlation the same as cointegration?

    • What is cointegration?

    1

  • 8/17/2019 Cointegration and Pair Trading

    3/19

    ( )( )Step1: Pair Formation by finding two assets whose

    prices have moved together historically.

    Step 2: Creating price ratio

    Step 3: Determining +- 2 SD from average of priceratio to form long-short trading strategy

    Step 4: buy underpriced and short overpriced assetsand expecting for profit.

    2

    • General pair trading strategy bases on historicalprice pattern and form boundaries based on pastpatterns.

    • Traditional pair trading bases on correlation

    ,trading strategy may not generated sure profit.

    • Trading strategy based on non parametric decisionrule.

    • No guarantee for statistical sure profitable pair

    trading namely mean reversion

    3

  • 8/17/2019 Cointegration and Pair Trading

    4/19

    (() ()) ()• The presence of a cointegrating relationship

    enables us to combine the two assets in a certainlinear combination so that the combined portfolio isa stationary process.

    •   - valued asset and shorting the relative over-valuedasset.

    • If two cointegrated assets share a long-run

    equilibrium relationship, then deviations from thisequilibrium are only short-term and are expected toreturn to zero in future periods.

    4

    (() ()) ()• To profit from this relative mis-pricing, a long position

    in the portfolio is opened when its value fallssufficiently below its long-run equilibrium and isclosed out once the value of the portfolio reverts toits ex ected value.

    • Profits may be earned when the portfolio is tradingsufficiently above its equilibrium value by shortingthe portfolio until it reverts to its expected value.

    5

  • 8/17/2019 Cointegration and Pair Trading

    5/19

    (() ()) ()• Typical questions which must be answered when

    developing a pairs trading strategy include

    1. How to identify trading pairs?

     . en s e com ne por o o su c en y awayfrom its equilibrium value to open a tradingposition?

    3. When do we close the position?

    6

    • Statistical arbitrage strategy: quantitative trading

    strategies that can be implemented using machineswith little human interventions.

     that the price paths of two assets that havehistorically moved together will converge againafter any divergence.

    7

  • 8/17/2019 Cointegration and Pair Trading

    6/19

    • Magnitude of pair trading profit depends on short

    term liquidity provision and price discovery orannouncement (news) that temporarily affectsliquidity of one asset in the pair or announcementsthat affect both assets but one asset reacts to suchnews faster than the other asset.

    • What is it in layman term (human language)?

    8

    • Pairs trading strategy works by taking the arbitrage

    opportunity of temporary anomalies betweenprices of related assets which have long-run

    equilibrium. When such an event occurs, one assetwill be overvalued relative to the other asset. We

    -where the overvalued asset is sold (short position)and the undervalued asset is bought (long position).

    • The trade is closed out by taking the oppositepositions of these assets after the asset prices havesettled back into their long-run relationship.

    9

  • 8/17/2019 Cointegration and Pair Trading

    7/19

    • The profit is captured from this short-term

    discrepancies in the two asset prices. Since theprofit does not depend on the movement of themarket, pairs trading can be said as a market-neutral investment strate .

    • If the value of the portfolio is known to fluctuatearound its equilibrium value then any deviations

    from this value can be traded against.

    10

    • A pairs trading strategy is developed based on the

    cointegration coefficients weighted (CCW) rule. TheCCW rule works by trading the number of unit in twoassets based on their cointegration coefficients toachieve a uaranteed minimum rofit er trade.

    • The minimum profit per trade corresponds to thepre-set boundaries upper-bound U and lower-bound L chosen to open trades. The optimal pre-setboundary value is determined by maximizing theminimum total profit (MTP) over a specified tradinghorizon.

    11

  • 8/17/2019 Cointegration and Pair Trading

    8/19

    • The MTP is a function of the minimum profit per

    trade and the number of trades during the tradinghorizon.

     distance of the pre-set boundaries from the long-run cointegration equilibrium.

    12

    • Gatev, Goetzmann and Rouwenhorst (2006)

    showed that a pairs trading strategy generatesannual returns of 11 percent and a monthly Sharperatio four to six times that of market returns between1962 and 2002. 

    13

  • 8/17/2019 Cointegration and Pair Trading

    9/19

    ()()

    • For simple terms, a stochastic process is stationary, if

    its statistical properties do not change with time.(Jan Grandell)

    • One of the characteristic features that distinguishes

    is the fact that, the values of the series at differenttime instants will be correlated. Hence a basicproblem in time series analysis is to study the patternof the correlation between values at different timeinstants and try to construct statistical models whichexplain the correlation structure of the series.

    14

    ()()

    • Stationarity is a basic assumption in classical timeseries analysis. It means, in effect, that the mainstatistical properties of the series remain unchangedover time.

    •   · · · , , ,any integer c, the joint probability distribution of[X(t1), X(t2), · · · , X(tn)] is identical with that of [X(t1+ c), X(t2 + c), · · · , X(tn + c)]

    15

  • 8/17/2019 Cointegration and Pair Trading

    10/19

    (())

    • A univariate time series yt is integrated if it can be

    brought to stationarity through differencing. Thenumber of differences required to achievestationarity is called the order of integration. Timeseries of order d are denoted I(d). Stationary series

    .

    • An n-dimensional time series yt is cointegrated ifsome linear combination β1y1t + … + βnynt of thecomponent variables is stationary. The combinationis called a cointegrating relation, and thecoefficients β = ( β1 , … , βn)′ form a cointegratingvector .

    16

    >> load Data_Canada;

    >> Y = Data(:,3:end);

    >> figure>> Plot(dates,Y,’LineWidth’,2);

     >> xlabel(‘Year’);

    >> ylabel(‘Percent’);

    • What can be interpreted?

    17

  • 8/17/2019 Cointegration and Pair Trading

    11/19

    18

    >> fprintf('=== Test y1 for a unit root ===\n\n')

    >> [h1 PVal1] = adftest(y1,'model','ARD')

    >> fprintf('\n === Test y1 for stationarity === \n\n')

    >> [h0, PVal0] = kpsstest(y1,'trend',false)

    h1 =0

     =

    0.2867

    h0 =

    1

    PVal0 =

    0.0100

    19

  • 8/17/2019 Cointegration and Pair Trading

    12/19

    >>fprintf('\n === Test (1-L)y1 for a unit root === \n\n')

    >> [h1D PVal1D] = adftest(diff(y1),'model','ARD')

    >> fprintf('\n === Test (1-L)y1 for stationarity === \n\n')

    >> [h0D PVal0D] = kpsstest(diff(y1),‘trend‘,false)

    h1D =

    1

    PVal1D =

    1.0000e-03

    h0D =

    0PVal0D =

    0.1000

    20

    21

  • 8/17/2019 Cointegration and Pair Trading

    13/19

    22

    (())• If we say that Yt can change in an arbitrary way

    (i.e., one where the probability distribution is notstable over time), then how can we learn aboutpatterns?

    •   ,never have multiple data points to average toestimate that particular mean. We need to assumea constant mean so that we can take averagesand get meaningful results. (Charlie Gibbon, 2011)

    23

  • 8/17/2019 Cointegration and Pair Trading

    14/19

    (())• When estimation through regression has performed,

    nonstationarity always lead to spurious result.• There are two types of stationarity

    1. Trend Statoinarity

     t = 0 + 1  + εt,

    where εt is AR(1) with |ρ| < 1.

    2. Difference Stationarity

    Yt= Y

    t−1+ ν

    t.

    The AR(1) model with ρ = 1. This is a randomwalk model.

    24

    • If two assets are correlated, it implies that when one

    goes up one day, the other would likely go up alsoon the same day, and vice versa. Their daily (orweekly, or monthly) returns would have risen orfallen in s nchron .

    • If two assets are cointegrated, meaning that thetwo price series cannot wander off in oppositedirections for very long without coming back to amean distance eventually.

    “There is no requirement that two assets mustmove synchronously everyday !!!!”

    25

  • 8/17/2019 Cointegration and Pair Trading

    15/19

    Example of correlated assets (Ernest, Chan (2001))

    26

    Example of cointegrated assets (Ernest, Chan (2001))

    27

  • 8/17/2019 Cointegration and Pair Trading

    16/19

    • For any two assets who are correlated, spreads

    between them may not be diverged and revertedto make arbitrage profit.

      ,between them are temporarily diverged in a shortterm manner and will reverted back to the samespread before diverging.

    28

    • Cointegration is the foundation upon which pair

    trading (“statistical arbitrage”) is built. If two stockssimply move in a correlated manner, there maynever be any widening of the spread. Without atem orar widenin of the s read in eitherdirection, there is no opportunity to short (or buy)the spread, and no reason to expect the spread torevert to the mean either.

    29

  • 8/17/2019 Cointegration and Pair Trading

    17/19

    • In this instance, a profitable trade would be to buy

    A and short C at around day 10, then exit bothpositions at around day 19. Another profitable tradewould be to buy C and short A at around day 31,then closin out the ositions around da 40. 

    30

    • Correlation VS Cointegration which one is more

    appropriate?

    Definition:Cointegration is an analytic technique for testing for

    modeling long-run and short-run dynamics. Two ormore predictive variables in a time-series model arecointegrated when they share a common stochasticdrift. Variables are considered cointegrated if a linearcombination of them produces a stationary timeseries.

    31

  • 8/17/2019 Cointegration and Pair Trading

    18/19

    • Cointegration is distinguished from traditional

    economic equilibrium, in which a balance of forcesproduces stable long-term levels in the variables.Cointegrated variables are generally unstable in

    -,"spreads" (generalized by the cointegratingrelation) that force the variables to move aroundcommon stochastic trends.

    •The tendency of cointegrated variables to revert tocommon stochastic trends is expressed in terms of

    error-correction.

    32

    • In layman term, cointegration means two or more time

    series share long-term behavior 

    • Integrated variables are a specific class of non-stationary variables with important economic andstatistical properties.

    • Granger (1986) and Engle and Granger (1987) pointedthe differences between I(0) and I(1) as follows:

    • I(0) has finite variance which does not depend on time,has limited memory of its past behavior, tend tofluctuate around the mean (include deterministic trend),

    has autocorrelations that decline rapidly as the lagincreases.

    33

  • 8/17/2019 Cointegration and Pair Trading

    19/19

    • I(1) series have the main features as

    1) Variance depends upon time and goes toinfinity as time goes to infinity

      e process as an n n e y ong memory aninnovation will permanently affect the process)

    3) It wanders widely

    4) The autocorrelations tend to one in

    magnitude for all time separations

    34