Professional Documents
Culture Documents
Statistical Arbitrage and Pairs Trading: Nikos S. Thomaidis, PHD
Statistical Arbitrage and Pairs Trading: Nikos S. Thomaidis, PHD
Outline
Outline
Outline
Outline
What is pairs trading? Developing a pairs trading system from scratch Empirical study: statistical arbitrage between Dow Jones Industrial Average (DJIA) stocks
Outline
What is pairs trading? Developing a pairs trading system from scratch Empirical study: statistical arbitrage between Dow Jones Industrial Average (DJIA) stocks Conclusions
Outline
What is pairs trading? Developing a pairs trading system from scratch Empirical study: statistical arbitrage between Dow Jones Industrial Average (DJIA) stocks Conclusions Trading risks
Outline
What is pairs trading? Developing a pairs trading system from scratch Empirical study: statistical arbitrage between Dow Jones Industrial Average (DJIA) stocks Conclusions Trading risks Opportunities
Outline
What is pairs trading? Developing a pairs trading system from scratch Empirical study: statistical arbitrage between Dow Jones Industrial Average (DJIA) stocks Conclusions Trading risks Opportunities Future challenges
2 See [Pole, 2007, Vidyamurthy, 2004] and http://www.pairtradefinder.com/forum/viewtopic.php?f=3&t=14 for interesting facts and information on the history of the topic. Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
2 See [Pole, 2007, Vidyamurthy, 2004] and http://www.pairtradefinder.com/forum/viewtopic.php?f=3&t=14 for interesting facts and information on the history of the topic. Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
2 See [Pole, 2007, Vidyamurthy, 2004] and http://www.pairtradefinder.com/forum/viewtopic.php?f=3&t=14 for interesting facts and information on the history of the topic. Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
2 See [Pole, 2007, Vidyamurthy, 2004] and http://www.pairtradefinder.com/forum/viewtopic.php?f=3&t=14 for interesting facts and information on the history of the topic. Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
Capitalise on market imbalances between two or more securities, in anticipation of making money when the inequality is corrected in the future [Whistler, 2004]
Capitalise on market imbalances between two or more securities, in anticipation of making money when the inequality is corrected in the future [Whistler, 2004] Find two securities that have moved together over the near past
Capitalise on market imbalances between two or more securities, in anticipation of making money when the inequality is corrected in the future [Whistler, 2004] Find two securities that have moved together over the near past When the distance (spread) between their prices goes above a threshold, short the overvalued and buy the undervalued one
Capitalise on market imbalances between two or more securities, in anticipation of making money when the inequality is corrected in the future [Whistler, 2004] Find two securities that have moved together over the near past When the distance (spread) between their prices goes above a threshold, short the overvalued and buy the undervalued one If securities return to the historical norm, prices will converge in the near future and you will end up with a prot
a market-neutral trading strategy: generates prot under all market conditions (uptrend, downtrend, or sideways movements)
a market-neutral trading strategy: generates prot under all market conditions (uptrend, downtrend, or sideways movements) a statistical arbitrage trading strategy: prot from temporal mispricings of an asset relative to its fundamental value.
a market-neutral trading strategy: generates prot under all market conditions (uptrend, downtrend, or sideways movements) a statistical arbitrage trading strategy: prot from temporal mispricings of an asset relative to its fundamental value. a long/short equity strategy: long positions are hedged with short positions in the same or related sectors, so that the investor should be little aected by sector-wide events
a market-neutral trading strategy: generates prot under all market conditions (uptrend, downtrend, or sideways movements) a statistical arbitrage trading strategy: prot from temporal mispricings of an asset relative to its fundamental value. a long/short equity strategy: long positions are hedged with short positions in the same or related sectors, so that the investor should be little aected by sector-wide events relative-value trading,
a market-neutral trading strategy: generates prot under all market conditions (uptrend, downtrend, or sideways movements) a statistical arbitrage trading strategy: prot from temporal mispricings of an asset relative to its fundamental value. a long/short equity strategy: long positions are hedged with short positions in the same or related sectors, so that the investor should be little aected by sector-wide events relative-value trading, convergence trading,
a market-neutral trading strategy: generates prot under all market conditions (uptrend, downtrend, or sideways movements) a statistical arbitrage trading strategy: prot from temporal mispricings of an asset relative to its fundamental value. a long/short equity strategy: long positions are hedged with short positions in the same or related sectors, so that the investor should be little aected by sector-wide events relative-value trading, convergence trading, and so on...
a market-neutral trading strategy: generates prot under all market conditions (uptrend, downtrend, or sideways movements) a statistical arbitrage trading strategy: prot from temporal mispricings of an asset relative to its fundamental value. a long/short equity strategy: long positions are hedged with short positions in the same or related sectors, so that the investor should be little aected by sector-wide events relative-value trading, convergence trading, and so on... Pairs trading group trading
A humorous metaphor adapted from [Murray, 1994] to the context of pairs trading.
A humorous metaphor adapted from [Murray, 1994] to the context of pairs trading. A drunk customer sets out from the pub (Gin Palace) and starts wandering in the streets (random walk, unit-root, integrated stochastic process)
A humorous metaphor adapted from [Murray, 1994] to the context of pairs trading. A drunk customer sets out from the pub (Gin Palace) and starts wandering in the streets (random walk, unit-root, integrated stochastic process) The accompanying dog thinks: I cant let him get too far o; after all, my role is to protect him!
A humorous metaphor adapted from [Murray, 1994] to the context of pairs trading. A drunk customer sets out from the pub (Gin Palace) and starts wandering in the streets (random walk, unit-root, integrated stochastic process) The accompanying dog thinks: I cant let him get too far o; after all, my role is to protect him! So, the dog assesses how far the drunk is and moves accordingly to close the gap
1.05 1 0.95 0.9 0.85 0.8 0.75 0.7 0.65 Mar93 Dec95 Sep98 May01 Feb04 Nov06 Aug09 May12 GT HPQ
Figure 1: Normalised price paths of Goodyear (GT) and Hewlett Packard (HPQ).
Group trading
Determine the direction of the relationship (divergence, re-convergence) Find suitable trade-open and trade-close points
Group trading
Determine the direction of the relationship (divergence, re-convergence) Find suitable trade-open and trade-close points
Risk management
Minimise divergence risk (the gap between stocks further widens) Fine-tune parameters with respect to a trading performance criterion (maximise expected return, maximise a reward-risk ratio, etc)
Choose a charting time-frame Compute the correlation of historical price series, e.g. Correlation coecient 0.91 0.87 0.81 0.76 0.26 0.17
1 2 3 4 19 20
1 1 2 8 13 26
3 5 4 10 26 27
Pick the top 20% of pairs (i.e 4 pairs) with the highest historical correlation Formed groups: {1, 3, 5}, {2, 4}, {8, 10}
Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
crt,i
(1 + r,i ), t = 1, 2, ..., T
=1
where cr0,i = 1 and rt,i is the t-periods return on stock i . Introduce a distance measure: e.g. Euclidean distance
T
d(i , j) |cr
,i
cr ,j |
t=1
(crt,i crt,j )2
Rank stock pairs based on increasing values of d - pick the top a% of the list for group formation
Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
Applying techniques from co-integration analysis [Engle and Granger, 1987, Burgess, 2000, Vidyamurthy, 2004] Assume that a group of stocks with price vector Pt = (Pt1 , Pt2 , . . . , PtN ) satisfy the relationship Pt1 = c + 2 Pt2 + + n PtN + Zt where Zt is the mispricing index (captures temporal deviations from equilibrium) The coecients of the relationship can be estimated using Ordinary Least Squares (OLS)
where i is the OLS estimate of i and + (-) indicates a long (short) position The portfolio value Zt Pt , where (1, 2 , 3 , . . . , N ) is by construction mean-reverting (uctuates around c , the OLS estimate of c)
15
Stock 1 Stock 2
Prices
10
5 0
50
200
250
14.5 14 13.5 Stock 2 13 12.5 12 11.5 11 5.5 6 6.5 7 Stock 1 7.5 negative mispricing
Equilibrium relationship: P2 = 14.843 0.257 P1
8.5
50
200
250
The average capital invested on each stock (average price number of shares) must be below 80% and above 5% The ratio between the maximum and the minimum number of shares held from each asset should not exceed 10. etc These place restrictions on the beta coecients (stock holdings) restricted OLS estimation
Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
Group trading
Trading strategya
a
Trading strategya
a
Open a position in a group, over the trading period, when the mispricing index diverges by a certain threshold
Buy the portfolio, if Zt < ZtL, tH, Sell the portfolio, if Zt > Z
where ZtL, , ZtH, is a 100 (1 2)% condence envelope on the value of the mispricing.
Trading strategya
a
Open a position in a group, over the trading period, when the mispricing index diverges by a certain threshold
Buy the portfolio, if Zt < ZtL, tH, Sell the portfolio, if Zt > Z
where ZtL, , ZtH, is a 100 (1 2)% condence envelope on the value of the mispricing. Unwind the position after h periods of time
Trading strategya
a
Open a position in a group, over the trading period, when the mispricing index diverges by a certain threshold
Buy the portfolio, if Zt < ZtL, tH, Sell the portfolio, if Zt > Z
where ZtL, , ZtH, is a 100 (1 2)% condence envelope on the value of the mispricing. Unwind the position after h periods of time unless
Trading strategya
a
Open a position in a group, over the trading period, when the mispricing index diverges by a certain threshold
Buy the portfolio, if Zt < ZtL, tH, Sell the portfolio, if Zt > Z
where ZtL, , ZtH, is a 100 (1 2)% condence envelope on the value of the mispricing. Unwind the position after h periods of time unless the mispricing index continues to diverge (does not cross up the lower bound or cross down the upper bound)
Trading strategya
a
Open a position in a group, over the trading period, when the mispricing index diverges by a certain threshold
Buy the portfolio, if Zt < ZtL, tH, Sell the portfolio, if Zt > Z
where ZtL, , ZtH, is a 100 (1 2)% condence envelope on the value of the mispricing. Unwind the position after h periods of time unless the mispricing index continues to diverge (does not cross up the lower bound or cross down the upper bound) Close the position earlier and open a new position if the synthetic re-converges and crosses the opposite bound
Trading strategya
a
Open a position in a group, over the trading period, when the mispricing index diverges by a certain threshold
Buy the portfolio, if Zt < ZtL, tH, Sell the portfolio, if Zt > Z
where ZtL, , ZtH, is a 100 (1 2)% condence envelope on the value of the mispricing. Unwind the position after h periods of time unless the mispricing index continues to diverge (does not cross up the lower bound or cross down the upper bound) Close the position earlier and open a new position if the synthetic re-converges and crosses the opposite bound ZtL, , ZtH, is of the form c z Z , where c , Z are the sample mean and standard deviation of the synthetic value over the formation period and z is the critical value from a N(0, 1) distribution.
Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
18
16
14
20
40
60 Trading period
80
100
120
12
24 23 Mispricing 22 21 20 19 18 0
Mispricing index
Confidence bounds 80
60 Trading period
Figure 3:
Price ($)
1.6 Normalised prices 1.4 1.2 1 0.8 0 0 1 2 3 4 0 AA AXP CAT IBM Long positions Short positions
50
150
200
250
Mispricing
Mispricing index 50
10 0
50
150
200
250
Experimental set-up
Daily prices of 30 stock members of Dow Jones Industrial Average (DJIA) index (with dividends reinvested) Sample period: 3 Jan 1994 to 24 Feb 2010 Group formation:
Window length (WL) {125, 250} days Screen out DJIA stocks with one or more days without a trade (identify relatively liquid stocks and facilitate pairs formation) Choose matching stocks based on MNPD and MPC criteria (form groups from the 5%, 20% or 50% highest-ranking pairs of the list)
Trading strategy
Trading period: subsequent {50, 125, 150} days Hold-out period (HOP): {1, 5, 10, 25} days L , H {1, 5, 10, 20, 40}%
3 WL: Length of moving window, TP: Trading period, GFC: Group formation criterion, HOP: Position holdout period. Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
Trading measures
Best strategy Best strategy (IR) Buy & hold portfolio (Mean return) Sample: 1994-2010 (784 observations) 11.65 7.78 5.92 26.44 9.94 22.00 23.75 6.48 16.54 0.44 0.78 0.27 0.49 1.20 0.36
No investor would risk putting all his money in a single strategy Mixing-up dierent parameter combinations
No investor would risk putting all his money in a single strategy Mixing-up dierent parameter combinations Bundles of trading strategies:
Percentage of trading strategies 100 90 65 35 10 1.98 2.46 3.42 4.64 6.48 3.65 3.63 3.69 4.00 6.19 2.26 2.19 2.10 2.16 2.71 0.54 0.68 0.93 1.16 1.05 0.88 1.12 1.63 2.15 2.39
Best Buy & strategy hold 11.65 5.92 26.44 22.00 23.75 16.54 0.44 0.27 0.49 0.36
Table 2: Average weekly performance on the full sample period (annualised measures).
Percentage of trading strategies 100 90 65 35 10 1.98 2.46 3.42 4.43 5.93 3.65 3.63 3.66 3.65 4.31 2.26 2.19 2.09 2.18 2.55 0.54 0.68 0.93 1.22 1.37 0.88 1.12 1.64 2.03 2.32
Best Buy & strategy hold 7.78 5.92 9.94 22.00 6.48 16.54 0.78 0.27 1.20 0.36
Table 3: Average weekly performance on the full sample period (annualised measures).
IRmaximising strategies 350 300 250 Cumulative return (%) 200 150 100 50 0 50 top100 top90 top65 top35 top10 best strategy buy & hold
Dec95
Sep98
May01
Feb04
Nov06
Aug09
150
100
50
50 Mar93
Dec95
Sep98
May01
Feb04
Nov06
Aug09
May12
Figure 7: Historical performance of the top-10% portfolio (IR) and systematic factors of risk.
Trading costs
Trading costs
Trading costs
Trading costs
Trading costs
Trading costs
Trading costs
Trading costs
Transaction costs, margin requirements, etc How the strategies are expected to perform in a more realistic market environment?
Trading costs
Transaction costs, margin requirements, etc How the strategies are expected to perform in a more realistic market environment? Can generated prots oset trading costs?
Notes: (1) Averages over all parametrisations, (2) Standard deviation in parentheses.
3.21
26.31
57.13 13.34
Buy & hold Best 5.34 4.28 2.55 1.25 2.10 5.92 22.00 16.54 0.27 0.36
160 140 120 cumulative return (%) 100 80 60 40 20 0 20 Mar93 Dec95 Sep98 May01 Feb04 Nov06 Aug09 May12 0 bps 10 bps 50 bps
Figure 8: Historical performance of the top-10% (IR) portfolio assuming dierent levels of transaction costs.
Is the seemingly outstanding performance due to genuine superiority? or... due to luck?
5 Random Walk: Taleb on Mistakes that Market Traders can make, http://equity.blogspot.com/2008/11/taleb-on-mistakes-that-market-traders.html Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
Statistical techniques
Little sensitivity to market conditions Helps exploring new market scenarios (beyond those present in the dataset)
150 100 50 0
2009
50 Mar93
Dec95
Sep98
May01
Feb04
Nov06
Aug09
May12
756 days
756 days
756 days
1041 days
Validation period 1 10 150 25 20 cumulative return (%) cumulative return (%) 100 15 10 5 0 0 Apr00 5 Oct99
Validation set 2
IR=0.27
cumulative return (%)
IR=1.21
50 0
IR=1.28
Jun96
Jan97
Jul97
Feb98
Sep98
Mar99
Oct99
Apr00
Nov00
Dec01
Jul02
IR=0.52
Top10% (IR) Buy & hold cumulative return (%) cumulative return (%)
10
IR=0.05
50
5 Jul02
Jan03
Aug03
Feb04
Sep04
Mar05
Oct05
50 May06
10 Oct05
May06
Nov06
Jun07
Dec07
Jul08
Jan09
Aug09
100 Mar10
Statistical techniques
Statistical techniques
Random portfolios [Burns, 2006] How skillful is our strategy in terms of picking the right stocks
Statistical techniques
Random portfolios [Burns, 2006] How skillful is our strategy in terms of picking the right stocks at the right combination?
Statistical techniques
Random portfolios [Burns, 2006] How skillful is our strategy in terms of picking the right stocks at the right combination? Monkey trading Is our trading system superior to a monkey, which opens and closes trading positions at random points?
Statistical techniques
Random portfolios [Burns, 2006] How skillful is our strategy in terms of picking the right stocks at the right combination? Monkey trading Is our trading system superior to a monkey, which opens and closes trading positions at random points? Other more sophisticated approaches:
Reality Check [White, 2000] Test of Superior Predictive Performance [Hansen, 2005] False discovery rate [Bajgrowiczy and Scailletz, 2009]
1 Probability of superior group formation skills 0.8 0.6 0.4 0.2 0 0.3 90th percentile 0.2 Monthly return 0.1 0 0.1 0.2 Median 10th percentile Dec95 Sep98 May01 Feb04 Nov06 Aug09 Top10% (IR) strategy
months of consecutive out performarnce
Dec95
Sep98
May01
Feb04
Nov06
Aug09
Based on the probability of superiority Percentage of skilled months: 63.10% Percentage of unskilled months: 36.90% Average number of consecutive skillful-picking months: 2.51 Average number of consecutive unskilled-picking months: 1.47
200
150
100
50
50
100 Mar93
Dec95
Sep98
May01
Feb04
Nov06
Aug09
May12
6 This particular monkey-trader was recruited from http://www.free-extras.com/images/monkey_thinking-236.htm . Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
1 Probability of superior group formation skills 0.8 0.6 0.4 0.2 0 0.2
Sep98
May01
Feb04
Aug09
0.1 Median 0.2 10th percentile Dec95 Sep98 May01 Feb04 Nov06 Aug09
Percentage of skilled months: 66.31% Percentage of unskilled months: 32.62% Average number of consecutive skilled months: 2.88 Average number of consecutive unskilled months: 1.49
200
150
100
50
50
100 Mar93
Dec95
Sep98
May01
Feb04
Nov06
Aug09
May12
Event-response analysis
1.35 1.3 1.25 1.2 1.15 local minima 1.1 1.05 1 0.95 0 local maxima
Normalised price
20
40
100
120
140
Epilogue
Epilogue
Epilogue
Pairs trading is a statistical arbitrate trading strategy Performs better under limiting conditions
Epilogue
Pairs trading is a statistical arbitrate trading strategy Performs better under limiting conditions
innitely-dimensional asset universe
Epilogue
Pairs trading is a statistical arbitrate trading strategy Performs better under limiting conditions
innitely-dimensional asset universe innite amount of trading time, etc
Epilogue
Pairs trading is a statistical arbitrate trading strategy Performs better under limiting conditions
innitely-dimensional asset universe innite amount of trading time, etc
Computational challenges (processing huge amounts of information, asset selection, ne-tuning, model estimation)
Epilogue
Pairs trading is a statistical arbitrate trading strategy Performs better under limiting conditions
innitely-dimensional asset universe innite amount of trading time, etc
Computational challenges (processing huge amounts of information, asset selection, ne-tuning, model estimation) Implementation challenges (high portfolio turnover, trading costs, execution risk)
Epilogue
Pairs trading is a statistical arbitrate trading strategy Performs better under limiting conditions
innitely-dimensional asset universe innite amount of trading time, etc
Computational challenges (processing huge amounts of information, asset selection, ne-tuning, model estimation) Implementation challenges (high portfolio turnover, trading costs, execution risk) If benets exceed costs your system is a hit!
References I
Andrade, S., Vadim, P., and Seasholes, M. (2005). Understanding the protability of pairs trading. working paper. Bajgrowiczy, P. and Scailletz, O. (2009). Technical trading revisited: False discoveries, persistence tests, and transaction costs. working paper. Burgess, N. (2000). Statistical arbitrage models of the FTSE 100. In Abu-Mostafa, Y., LeBaron, B., Lo, A. W., and Weigend, A. S., editors, Computational Finance 1999, pages 297312. The MIT Press.
References II
Burns, P. (2006). Random portfolios for evaluating trading strategies. working paper. Engle, R. F. and Granger, C. W. J. (1987). Co-integration and error correction: Representation, estimation, and testing. Econometrica, 55:251276. Gatev, E., Goetzmann, W., and Rouwenhorst, K. (2006). Pairs trading: performance of a relative-value arbitrage rule. The Review of Financial Studies, 19(3):797827. Hansen, P. (2005). A test for superior predictive ability. Journal of Business & Economic Statistics, 23(5):365380.
Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
References III
Jensen, M. and Bennington, G. (1970). Random walks and technical theories: some additional evidence. The Journal of Finance, 25:469 482. Murray, M. (1994). A drunk and her dog: An illustration of cointegration and error correction. The American Statistician, 48(1):3739. Pole, A. (2007). Statistical arbitrage: algorithmic trading insights and techniques. John Wiley and Sons, Inc.
References IV
Sullivan, R., Timmermann, A., and White, H. (1999). Data-snooping, technical trading model performance and the bootstrap. The Journal of Finance, 54:16471691. Thomaidis, N. S. and Kondakis, N. (2012). Detecting statistical arbitrage opportunities using a combined neural network - GARCH model. Working paper available from SSRN. Thomaidis, N. S., Kondakis, N., and Dounias, G. (2006). An intelligent statistical arbitrage trading system. Lecture Notes in Articial Intelligence, 3955:596599. Vidyamurthy, G. (2004). Pairs trading: quantitative methods and analysis. John Wiley and Sons, Inc.
Nikos S. Thomaidis, PhD Statistical arbitrage and pairs trading
References V
Whistler, M. (2004). Trading pairs: capturing prots and hedging risk with statistical arbitrage strategies. John Wiley and Sons, Inc. White, H. (2000). A reality check for data snooping. Econometrica, 68(5):10971126.