pairs trading

20
An investigation into Pairs Trading (Statistical Arbitrage) Strategies Brian Bannon

Upload: bbannon89

Post on 16-Aug-2015

91 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Pairs Trading

An investigation into Pairs Trading (Statistical Arbitrage)

Strategies

Brian Bannon

Page 2: Pairs Trading

i

Abstract

In this report, the author is going to conduct an investigation into widely used trading

strategy in the financial trading industry known as “Pairs Trading’ or Statistical Arbitrage

trading. This is a trading strategy that looks at the mispricing of two highly correlated or co-

integrated stocks in the market and opening and closing positions in the two stocks so that the

stock mean revert and risk free arbitrage opportunity exists to make profit.

This report will investigate the theory behind Pairs Trading, look at some academic research

into the topic while in parallel drawing from some industrial reports conducted on the

strategy, and finally conduct some empirical back testing and results from the methodologies

learned throughout the author’s research.

Page 3: Pairs Trading

ii

Table of Contents

1 INTRODUCTION ............................................................................................................ 1

1.1 PAIRS TRADING ........................................................................................................... 1

2 LITERATURE REVIEW ............................................................................................... 2

3 METHODOLOGY .......................................................................................................... 4

3.1 DISCUSSION OF ACADEMIC THEORY ........................................................................... 4

3.1.1 Correlated Pairs Trading ...................................................................................... 4

3.1.2 Co-Integrated Pairs Trading ................................................................................ 5

3.1.3 Augmented Dicky Fuller Test ............................................................................... 5

4 ANALYSIS RESULTS .................................................................................................... 6

4.1 CORRELATED PAIRS .................................................................................................... 6

4.1.1 Allied Irish Bank vs. Bank or Ireland .................................................................. 6

4.1.2 Christian Dior SE vs. Moet Hennessy Louis Vuitton SE .................................... 9

4.2 CO-INTEGRATED PAIRS ............................................................................................. 11

4.2.1 Google US Equity vs. Apple US Equity .............................................................. 11

4.2.2 Nike US Equity vs. Adidas US Equity ................................................................ 14

5 CONCLUSION .............................................................................................................. 16

5.1 SUMMARY OF RESULTS ............................................................................................. 16

6 BIBLIOGRAPHY .......................................................................................................... 17

Page 4: Pairs Trading

1

1 Introduction

1.1 Pairs Trading

The pair trading is a market neutral trading strategy enabling traders to profit from virtually

any market conditions. It matches a long position with a short position in a pair of highly

correlated or co-integrated instruments such as two assets. Pairs traders wait for weakness in

the correlation or divergence from the long term equilibrium in co-integration, and then go

long on the under-performer while simultaneously going short on the over-performer, closing

the positions as the relationship returns to its statistical normal. The strategy’s profit is

derived from the difference in price change between the two instruments, rather than from the

direction in which each moves.

Fig(1): Graph taken from authors presentation on pairs trading. Simple example of what pairs trading looks

graphically. At June 06 the trader would short Pepsi and long Coke and at Jun 08 long Pepsi and short Coke.

Page 5: Pairs Trading

2

2 Literature Review Pair’ trading has received quite a lot of academic and industrial investigation. Looking for

better ways to make the process more efficient and looking into different statistical tests for

easier implementation. (UBS Investment Research, 2010). And also looking at back testing to

see if this trading strategy performance has been successful or have been overshadowed by

other trading strategies (Do & Faff, 2010)

UBS research division conducted a very concise empirical report on the performance of pairs

trading in the European market along with an empirical test on all the statistical approaches to

determine co-integration, ranking the performance of different tests across an eight year time

period Figure (2). Concluding that pairs trading was a profitable strategy in the European

market during the period, with the success of multiple statistical screens identifying

opportunities. It concluded that there seems to be no decline in European pairs trading

profitability. (UBS Investment Research, 2010)

In Do and Raff’s paper they also examine the performance of pairs trading, restricted to the

U.S. market. They noted a continuous declining trend towards the end of the 2000’s.This was

mainly caused by the competition in the hedge fund industry. They deduced a 70% decline in

the performance of pairs’ strategies due to the worsening arbitrage risks in various pairs’

portfolios. And found during the 2007 financial crisis pairs trading performance was strong

during market downturns. They investigated the importance of homogeneity is pairs

classification with lower divergence risk. Lastly they found pairs trading by industry group

were quite an important factor. They tested by pairs trading the S&P major industry groups,

utilities, financials, transportation and industrials. Profits across all sectors were found but

significant profit was found in Financial and Utility sectors.

Page 6: Pairs Trading

3

Advancements of the traditional pairs trading co-integration strategy on two stocks has also

been adopted by hedge funds in the last couple of years. Hedge funds are growing in the

amount of market neutral hedge fund strategies being implemented by these firms. One such

is the long short hedge strategy applied to portfolios. Traditional strategies do not guarantee

that the tracking error is stationary and thus rebalancing for the hedge to remain tied to the

benchmark. The con-integration strategy, the hedge is mean reverting to the benchmark and

tracking errors are stationary by design, this can be achieved with relatively few stocks and

much lower turnover. (Alexander, Giblin, & Weddington, 2001)

Page 7: Pairs Trading

4

3 Methodology

3.1 Discussion of Academic Theory

3.1.1 Correlated Pairs Trading The main theory behind this Bloomberg Spread sheet is to identify pairs that have good

mean reversion which is the basis behind pairs trading.This spreadsheet identifies pairs of

stocks that have this criteria and analyse the trades and performance over the trading period.

The mean reversion technique is used to see if paris of stocks are co-integrated .In correlation

two random stocks may move together and are perfectly correlated but the differnce is not

arbitrary and may drift off from each over time while still being perfectly correlated.Co-

integration is a measure of how well the two stocks are tied together.Two stocks that stay in

the same range as each other and have a long term relationship are co-integrated.Co-

integrated stocks are expected to stay parallel to one another over time, since the

differnce(Residuals) between the two will be corrected over time..

When the price of one or both stocks moves above or below the long term equilibrium

position, a trader can profit by taking a long/short postions on the pair of stocks and wait for

the relative price of the stock to move back into equilibrium.

In this template, we first establish if this long-term co-integration relationship exists by

performing a linear regression of the two times series of the stock.

𝑦! = 𝛽!𝑥! +  𝜀! 𝑖 = 1…𝑛 (1)

Where y is the dependent variable, x the independent variable, 𝛽 is the linear coefficient and

𝜀 is the error variable. Then use these results to find if the current prices deviate from the

equilibrium, when to put a trade on and when to profit from these trades. When fitting the

linear regression it is good to look at the residual spread series, which is the difference

between the fitted value and the actual value. A good residual spread series is that crosses 0

times.

Page 8: Pairs Trading

5

3.1.2 Co-Integrated Pairs Trading (Ganapthy, 2004) Again in this section we look into co-integration in pairs to conduct pairs trading but this time

we are going to use a statistical test for co-integration called “Augmented Dicky Fuller Test”

(ADF). There are many statistical tests researchers can perform to test for co-integration such

as Run’s Test, KPSS, IKPSS, and Sum of Squares. Usually in the industry research

departments or traders would perform several different statistical co-integration tests on a pair

of stocks and pick the best 4 out 6, 3 out 5 etc. to increase the statistical testing of the pair.

(UBS Investment Research, 2010)

Fig (2): Performance of the six different co-integration tests ranging from 1992-2010 (UBS Investment

Research, 2010)

3.1.3 Augmented Dicky Fuller Test (Herlemont, 2000) Two non-stationary time series ( I(1) ) {Xt} and {Yt} are co-integrated if some linear

combination aXt + bYt , with a and b being constants, is a stationary series ( I(0) ).The reason

this is stated is because in the ADF test that a variable follows a unit-root process, then a and

b would be co-integrated. The theory behind the test is, perform a linear regression on the

residuals and see what the value of 𝑎 is:

𝑦! = 𝑎𝑦!!! +  𝜀! (2)

Where 𝑦! = 0 and 𝜀~𝑁(0,𝜎!) for an AR (1) process then the residual process can be written

as

Δ𝑦! =  𝛿𝑦!!! +  𝜀! (3)

.We then perform the hypothesis testing that if

Page 9: Pairs Trading

6

𝐻!: 𝑎 = 0

𝐻!:  𝑎 ≠ 0

If, 𝐻!: 𝑎 = 0 is true there is no co-integration and the signal contains a unit root, a unit root

means our signal is non-stationary. The test gives a pValue, the lower this number the more

confident we can be that we have found a stationary signal. P-Values less than 0.1 are

considered to be good candidates. (Quant, 2012)

4 Analysis Results

4.1 Correlated Pairs

4.1.1 Allied Irish Bank vs. Bank or Ireland We conducted a correlation test using the Bloomberg correlation template testing from March

2014 to March 2015.

Fig (3): Linear regression of AIB and Bank of Ireland

We see from this regression that that the two stocks, while correlated over the long run from

initial testing, are not correlated over the trading period with a very low R2 which is close to

zero.

Next we look at the residual series of the stocks, from this we see that the number of

crossings is quite high (16) which is a good indicator that it has a good mean reversion.

y  =  -­‐0.0395x  -­‐  1.3154  R²  =  0.00456  

-­‐1.6  

-­‐1.4  

-­‐1.2  

-­‐1  

-­‐0.8  

-­‐0.6  

-­‐0.4  

-­‐0.2  

0  -­‐3   -­‐2.5   -­‐2   -­‐1.5   -­‐1   -­‐0.5   0  

BKIR  ID

 Equ

ity  

ALBK  ID  Equity  

Page 10: Pairs Trading

7

Fig (4): Residual spread of the stocks showing the deviation from the statistical mean with indicators of

standard deviations Difference between the regression and the actual fit

Next we look at the strategy itself over the trading period (365 days) with a standard

deviation multiplier for the residual spread of 1.5*σ .We have invested 100 shares in AIB

and the number of shares in Bank of Ireland is slope matching from regression.

Fig (5): Summary of trade entry and exit strategies for the trading period.(Green triangle indicating entry and

red triangle indicating exit. All trades are closed at the end of the trading period)

-­‐0.3  

-­‐0.2  

-­‐0.1  

0  

0.1  

0.2  

0.3  

Res

idua

l Spr

ead

Time

Residual  spreads   Residual  Spread   +1  Std.  Dev.   +2  Std  Dev.   -­‐1  Std.  Dev.   -­‐2  Std  Dev.  

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

Res

idua

l Spr

ead

Trades  -­‐  Entry  and  Exit   Entry   Exit   Residual  Spread  

Mean  of  Residual  spreads   +1.5  Std.  Dev.   -­‐1.5  Std.  Dev.  

Page 11: Pairs Trading

8

Fig (6). Trade performance of the strategy. Blue line indicating the cumulative profit of the strategy blue diamond’s indicating profit and loss. As you can see this strategy has experienced both.

During this trading period the two stocks were very volatile and there was a very wide spread

in the profit/loss margin over this time period. The maximum loss of any trade exiting at that

point would have been €489.25. Conversely the maximum loss at any trade point could have

been -€247.76. So there was quite a volatile spread during the period.

Table (1): Table of the trades list from this strategy.

-­‐400  

-­‐200  

0  

200  

400  

600  

800  

1000  

1200  

Pro

fit/L

oss(

Eur

os)

Trade  Performance   Profit(Loss)   Excursion   CumulaOve  P&L  

Trades  List  

        No.  of   Price  (A)  

Price  (B)  

Qty  (A)   Qty  (B)   Entry/Exit  

Cumulative  

Individual  

Cumulative  

Date   Entry/Exit  

Trading  Days  

ALBK  ID  Equity  

BKIR  ID  Equity  

ALBK  ID  Equity  

BKIR  ID  Equity  

Cashflow  

Cashflow  

P&L   P&L  

                                           15/0/14  

Entry       0.097   0.247   -­‐1031  

10256  

                       (2,433.)  

                 (2,433)  

       

27/08/2014  

Exit   74   0.086   0.305   1031   -­‐10256  

                           3,039.41    

                           606.19    

                           606.19    

                           606.19    

05/12/2014  

Entry       0.094   0.345   1064   -­‐7344  

                           2,433.66    

                     3,039.    

       

09/01/2015  

Exit   23   0.08   0.292   -­‐1064  

7344                          (2,059.3)  

                           980.53    

                           374.34    

                           980.53    

02/03/2015  

Entry       0.087   0.347   1149   -­‐7297  

                           2,432.10    

                     3,412.2    

       

Page 12: Pairs Trading

9

As we can see from Table (1) that the strategy has a positive cumulative profit. This would be

expected as the pairs were not correlated well and thus the spread between the two stocks was

existent and arbitrage opportunities arose. This profit is large mainly because of the volatility

at the time of trading and the trade spread at which we were trading at.

4.1.2 Christian Dior SE vs. Moet Hennessy Louis Vuitton SE The next pair for test of correlation is Christian Dior and Moet Hennessy Louis Vuitton. I

choose this pair because over the 10 year period they were 99% correlated on the Euronext

Paris. Again we had the same conditions of above initial investment standard deviation again

etc. From this we see that the number of crossings is high which is unusual considering its

correlation. So the series is slightly mean reverting. The residual spread initially stays within

2std dev. in the spread chart until it goes outside near the end (Figure.8).Because of the

spread within the two series the trader would enter and exit the strategy a lot more as the

spread narrows and returns to equilibrium as show in Figure.9.

Fig(7): Linear regression of the Dior and Moet as we can see from the R2 is very high indicating it is a good

correlation fit over the trading period.

y  =  1.1019x  -­‐  0.4587  R²  =  0.97372  

4.7  

4.8  

4.9  

5  

5.1  

5.2  

5.3  

4.65   4.7   4.75   4.8   4.85   4.9   4.95   5   5.05   5.1   5.15   5.2  

CDI  FP  Equity  

MC  FP  Equity  

Page 13: Pairs Trading

10

Fig (8): Residual spread of the stocks showing the deviation from the statistical mean with indicators of

standard deviations Difference between the regression and the actual fit

The spread between the max loss and max profit at any trade point was just under €10. So

there was not much volatility in the trade positions. Thus because of this small spread

throughout the whole trading period, returns would be low thus the cumulative profit over

the whole trading period is €11.77.Which is poor if your take into account trading costs and

commission.

-­‐0.06  

-­‐0.04  

-­‐0.02  

0  

0.02  

0.04  

0.06  

0.08  

Res

idua

l Spr

eads

Residual  spreads  

Residual  Spread   +1  Std.  Dev.   +2  Std  Dev.   -­‐1  Std.  Dev.   -­‐2  Std  Dev.  

Page 14: Pairs Trading

11

Fig(9): Summary of trade entry and exit strategies for the trading period.(Green triangle indicating entry and

red triangle indicating exit. All trades are closed at the end of the trading period)

Fig(10). Trade performance of the strategy. Blue line indicating the cumulative profit of the strategy blue

diamond’s indicating profit and loss. As you can see this strategy has experienced both.

4.2 Co-integrated Pairs

4.2.1 Google US Equity vs. Apple US Equity

From implementing the ADF test we find that the ADF t-statistic from both stocks is quite

low indicating good performance from the ADF test result on both stocks. I did not provide

these graphs as they have not much connotation behind the strategy other to present that the

-0.06

-0.04

-0.02

0

0.02

0.04

0.06

0.08

Res

idua

l Spr

ead

Trades  -­‐  Entry  and  Exit   Entry   Exit   Residual  Spread  

Mean  of  Residual  spreads   +1.5  Std.  Dev.   -­‐1.5  Std.  Dev.  

-­‐8  -­‐6  -­‐4  -­‐2  0  2  4  6  8  

10  12  14  

Pro

fit/L

oss(

Eur

os)

Trade  Performance   Profit(Loss)   Excursion   CumulaOve  P&L  

Page 15: Pairs Trading

12

two stocks are non-stationary. From looking at the OLS regression we find that the R2 is

0.0095 showing that there is not much correlation which is good for this approach. We look

at the residual plot which we are interested in. The p-value is quite low and is statistically

significant relating that the residual plot is stationary.

Fig(11): Summary of trade entry and exit strategies for the trading period(Yellow triangle indicating long entry

and red triangle indicating short entry and green square is exit position.)

We have a max lag of 10 lags on and a standard deviation of 1.5*, note that this is just the

threshold range of when to place trades with 2*σ being the max due to the properties of the

normal distribution. Further research can be done into changing this for different thresholds

but we are going to keep it constant for the purpose of this report.

-­‐0.2  

-­‐0.15  

-­‐0.1  

-­‐0.05  

0  

0.05  

0.1  

0.15  

0.2  

27/03/2014   16/05/2014   05/07/2014   24/08/2014   13/10/2014   02/12/2014   21/01/2015   12/03/2015  

Res

idua

l Spr

ead

Residual   Residual   Mean   +1STD   -­‐1STD   +2STD  

-­‐2STD   ShortEntry   LongEntry   ExitPoint  

Page 16: Pairs Trading

13

Fig(12): Profit and loss chart indicates unrealised profit while positions are open with indications of the

strategy entry and exit points

Fig(13): this is a threshold analysis graph it show the max number of trades that should be executed when the

threshold reaches a certain point to maximise profit opportunities Max number of trades at 0.24*σ is 11 and the

min number of trade at1.84σ is 1

From looking at cumulative profit/loss summary table we can see that the cumulative profit

for this strategy is $4713.84 with an execution of 4 trades with an average holding period of

-­‐1500  

-­‐1000  

-­‐500  

0  

500  

1000  

1500  

27/03/2014   16/05/2014   05/07/2014   24/08/2014   13/10/2014   02/12/2014   21/01/2015   12/03/2015  

Pro

fit/L

oss(

$)

Time

 P&L  CumulaOve  P&L   ShortEntry   LongEntry   ExitPoint  

0  

2  

4  

6  

8  

10  

12  

14  

16  

18  

0   0.5   1   1.5   2   2.5  

Num

ber  o

f  Trade

s  

Threshold  of  Standard  DeviaOon  

Page 17: Pairs Trading

14

40 days with the long threshold being -0.089σ and the short threshold 0.089σ.Overall this is a

very profitable pairs trading strategy.

4.2.2 Nike US Equity vs. Adidas US Equity In this case we are going to look at two stocks that should be correlated and thus co-

integration should not be present for profit. From looking at the looking at the p value and

ADF t-statistic it looks like the plot of the residuals is stationary.

Fig(14): Summary of trade entry and exit strategies for the trading period(Yellow triangle indicating long

entry and red triangle indicating short entry and green square is exit position.)

But if we look at the OLS regression we see that the R2 ≈0.5 showing forms of correlation.

-­‐0.2  

-­‐0.15  

-­‐0.1  

-­‐0.05  

0  

0.05  

0.1  

0.15  

0.2  

02/06/2014   22/07/2014   10/09/2014   30/10/2014   19/12/2014   07/02/2015  

Res

idua

l Spr

ead

Residual   Residual   Mean   +1STD   -­‐1STD   +2STD  

-­‐2STD   ShortEntry   LongEntry   ExitPoint  

Page 18: Pairs Trading

15

Fig(15): Profit and loss chart indicates unrealised profit while positions are open with indications of the

strategy entry and exit points

Fig(16): this is a threshold analysis graph it show the max number of trades that should be executed when the

threshold reaches a certain point to maximise profit opportunities Max number of trades at 0.19*σ is 17 and the

min number of trade at1.85σ is 1

-­‐1500  

-­‐1000  

-­‐500  

0  

500  

1000  

1500  

02/06/2014   22/07/2014   10/09/2014   30/10/2014   19/12/2014   07/02/2015  

Pro

fit/L

oss(

$)

 P&L  CumulaOve  P&L   ShortEntry   LongEntry   ExitPoint  

0  

2  

4  

6  

8  

10  

12  

14  

16  

18  

0   0.5   1   1.5   2   2.5  

Num

ber  o

f  Trade

s    

Standard  DeviaOon  

Page 19: Pairs Trading

16

From the P&L summary we see an execution of 2 trades with a loss of -$807.50. Although

the residuals do look stationary and that is fine for co-integration. I feel the stocks may be too

correlated to make a profit opportunity and that is why we see negative returns from this

strategy.

5 Conclusion

5.1 Summary of results In this report the concept of Pairs Trading has been introduced. The report has given a broad

overview of the trading topic and a look at the academic and industrial research that is still

on-going in this field of statistical arbitrage. Some theory about how to test for correlation

and co-integration has been presented and discussed through concise theory.

Lastly we looked at an approach to analysing pairs trading through the powerful Bloomberg

database tool. From this approach my results coincided with my academic approach giving

the reader a clear indication of the methodology and the expected outcome from each of the

strategy’s approaches.

Page 20: Pairs Trading

17

6 Bibliography

Alexander, C., Giblin, I., & Weddington, W. (2001). Conintegration and Asset Allocation: A

new Hedge Fund Strategy. ISMA Centre Discussion Papers in Finance 2001-03.

Do, B., & Faff, R. (2010). Does Simple Pairs Trading Still Work? Financial Analysts

Journal, 66(4), 83-95.

Ganapthy, V. (2004). Pairs Trading: Quantitative Methods and Analysis . New Jersey: Wiley

& Sons Inc.

Gatev, E., Goetzmann, W., & K.G., R. (2006). Pairs Trading:Performance of a Relative-

Value Arbitrage Rule . Review of Financial Studies , 19, 797-827.

Herlemont, D. (2000). Pairs Trading, convergence trading, cointegration. YATS Finances &

Technologies .

Quant, G. (2012, December 17). Gekko Quant -Quantative Finance Blog. Retrieved from

http://gekkoquant.com/2012/12/17/statistical-arbitrage-testing-for-cointegration-

augmented-dicky-fuller/

UBS Investment Research. (2010). Understanding Pairs Trading. UBS, Global Equity

Research. UBS.