0% found this document useful (0 votes)
124 views15 pages

Analysis Pairs Trading

The document summarizes a student group's analysis of a pairs trading strategy. It discusses what pairs trading entails, the methodology used, results, risks, limitations, and conclusions. The group implemented a technical analysis-based pairs trading strategy selecting stock pairs based on correlation between residuals from regression lines fit to one year of price data. Fifteen stock pairs were identified, with most involving a large and small stock across industries. Trading signals were based on comparing ranks of 60-day residual values, with average rank spreads and standard deviations analyzed. Overall returns were benchmarked against the S&P 500 and risks, limitations, and potential improvements were discussed.

Uploaded by

abujidan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views15 pages

Analysis Pairs Trading

The document summarizes a student group's analysis of a pairs trading strategy. It discusses what pairs trading entails, the methodology used, results, risks, limitations, and conclusions. The group implemented a technical analysis-based pairs trading strategy selecting stock pairs based on correlation between residuals from regression lines fit to one year of price data. Fifteen stock pairs were identified, with most involving a large and small stock across industries. Trading signals were based on comparing ranks of 60-day residual values, with average rank spreads and standard deviations analyzed. Overall returns were benchmarked against the S&P 500 and risks, limitations, and potential improvements were discussed.

Uploaded by

abujidan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Stockholm School of Economics

4106: Advanced Investments


Prof. Andrei Simonov

SIMULATED TRADING-AN
ANALYSIS OF PAIRS
TRADING
________________________________

Group 5
Nikesh Agarwal 91164
Vikash Madhogaria 91166
Supreena Narayanan 80293
1. Introduction

In this report, we explain and analyze a trading strategy, popularly known as Pairs trading.
We begin by explaining what a pair trading strategy entails. Since there are various ways of
implementing the strategy, we describe the methodology selected by us in section 3.
Thereafter, we look at the returns from the strategy and benchmark it to the S&P 500 index in
Section 4. In section 5, we examine the risks involved in pairs trading. Section 6 looks at
some of the limitations we faced while trading and Section 7 points out some mistakes we
made. Finally, we discuss some risk control measures in Section 8 and conclude in Section 9
with comments on whether we would implement the strategy in real life and if so, with what
changes.

2. Pairs Trading

Pairs trading involves the simultaneous purchase of a stock and sale of another stock in order
to gain from the spread between the two securities. The aim is to find two securities which
have deviated from their historical relationship and are expected to revert back to the mean
relation.

There are two groups of pairs trading strategies based respectively on fundamental and
technical analysis. In the fundamental analysis, extensive company research is conducted to
identify stocks, generally within the same industry, which are expected to move together. This
strategy is limited to large investors with substantial funds to carry out the detailed analysis.
In the more common technical analysis based pairs trading, stocks are analyzed using
statistical techniques to identify pairs and deviations are recognized with convergence-
divergence frameworks using historical means or more sophisticated indicators like Bollinger
bands or Relative Strength Index. Here, the pairs identified may or may not be from the same
industry.
3. Methodology

We selected to implement pairs trading based on technical analysis for ease and convenience.
Such a strategy involves two main steps – selecting the pairs and identifying trading signals.
There are various alternatives available for both the steps leading to different strategies. For
the first step of identifying the pairs, the following are some of the techniques used:

• A simple correlation of prices of pairs of securities is computed. Pairs with the highest
correlation are then selected for trading purpose.
• A regression line is estimated for each stock using the stock price series and then pairs
are selected based on correlation between the residuals from these regression lines.
• Stock prices are normalized by subtracting the mean prices and dividing by the
standard deviation. Correlation between these normalized prices is then used to select
pairs.

For identifying the trading signals, the trader monitors certain indicators against their
historical averages and takes any deviation beyond reasonable limits as a signal for trade.
Here, the options are in the indicator which can be monitored:

• In the most simplistic case, one can monitor the spread between the prices of the two
stocks.
• An improvement is to monitor the price ratio instead of absolute price levels. This
helps to make the analysis dollar neutral and based on the pair rather than individual
securities.
• Ranks can be computed for absolute price levels or for the residuals of regression lines
estimated above. The spread between these ranks can then be used to signal possible
trades.

For the purpose of this project, we chose to select the stocks based on correlation between the
residuals and used ranks for these residuals as signals for trades. The consideration set
consisted of the top 100 stocks and the bottom 50 stocks on the S&P 500 based on market
capitalization. This was done to see if there were greater correlations between large small
stocks rather than within large stocks. This can be expected since the small stocks tend to
follow the larger stocks within the same industry. For calculating the residuals, we estimate a
regression line using the stock price data for the last one year from October 9, 2003 to
October 8, 2004. The residuals, computed using this regression line, were used to compute the
correlation and stocks with a correlation above 0.87 were selected. This resulted in 15 pairs of
stocks comprising of 20 stocks with certain stocks repeated in multiple pairs. A summary of
the pairs is given below:
Correlati
Company 1 Company 2 on
Scrip Scrip
Code Name Industry Mkt. Cap. Code Name Industry Mkt. Cap.
Communications
CSCO Cisco Systems Equipment 126 030 000 000 TWX Time Warner Inc. Media 73 209 824 336 0,8801
Communications
CSCO Cisco Systems Equipment 126 030 000 000 HPQ Hewlett-Packard Computers & Peripherals 54 297 340 973 0,8900
Semiconductor &
Communications Semiconductor
CSCO Cisco Systems Equipment 126 030 000 000 TER Teradyne Inc. Equipment 2 839 490 713 0,8967
AIG American Int'l. Group Insurance 196 003 188 260 DCN Dana Corp. Auto Components 2 817 757 731 0,8732
Health Care Equipment
AIG American Int'l. Group Insurance 196 003 188 260 PKI PerkinElmer & Supplies 2 536 709 801 0,8736
JPMorgan Chase & Diversified Financial
JPM Co. Services 82 917 542 380 PGL Peoples Energy Gas Utilities 1 571 672 544 0,8723
MWD Morgan Stanley Capital Markets 61 469 619 733 MER Merrill Lynch Capital Markets 55 746 022 057 0,8842
TWX Time Warner Inc. Media 73 209 824 336 GM General Motors Automobiles 31 256 636 919 0,9231
Semiconductor &
Goldman Sachs Texas Semiconductor
GS Group Capital Markets 49 331 900 937 TXN Instruments Equipment 33 962 934 792 0,8802
Semiconductor &
Computers & Semiconductor
HPQ Hewlett-Packard Peripherals 54 297 340 973 TER Teradyne Inc. Equipment 2 839 490 713 0,8740
GM General Motors Automobiles 31 256 636 919 F Ford Motor Automobiles 25 919 369 170 0,8769
Communications Communications
MOT Motorola Inc. Equipment 38 157 652 320 ANDW Andrew Corp. Equipment 2 080 000 000 0,8721
Commercial Services &
CD Cendant Corporation Supplies 27 936 048 572 CR Crane Company Machinery 1 955 505 753 0,8826
Semiconductor & Semiconductor &
Semiconductor Semiconductor
TER Teradyne Inc. Equipment 2 839 490 713 NVDA NVIDIA Corp. Equipment 2 420 000 000 0,8736
Semiconductor &
Semiconductor Cendant
NVDA NVIDIA Corp. Equipment 2 420 000 000 CR Corporation Machinery 27 936 048 572 0,8954
As can be seen from the table, only 4 out of the 15 pairs have stocks in the same industry.
Also, 8 of the 15 pairs have combinations of large and small stocks while only 1 pair is
between small stocks. This result was somewhat surprising since we would have expected
small stocks in an industry to follow the large stocks in the same industry. However, we find
that small stocks even tend to follow larger stocks in different industries.

In order to decide on the trading signals, we compute ranks for the residuals of the stocks.
These ranks are based on the previous 60 trading days’ residuals. This method is borrowed
from “A Simplified Approach to Pairs Trading” by Ron McEwan. We then compute the
average rank spread between the stocks in each pair and the standard deviation for the rank
spreads. A trading signal is recognized as the deviation of the rank spread from Mean ± 2*Std
Deviation. The position is doubled if the rank spread crosses Mean ± 3*Std Deviation and
closed if the spread falls to within Mean ± Std Deviation.

For simplicity, we computed the rank spreads at the end of each trading day and placed trades
to be executed at the start of the next trading day.

We provide at the end of the paper, graphs showing the ranks and their spreads for 5 of the 5
pairs. These were some of the most active pairs. The graph shows how the trading
opportunities arise over time. The first graph for each pair shows the ranks of the residuals. In
the second graph, rank spreads are shown together with the average spread (black line) and
the range of ± Std Deviation and ± 2* Standard deviation. It must be noted that the entering
signal is provided when the spread moves out of the 2 standard deviation range and thereafter
an exit signal is provided when the spread converges to within 1 standard deviation.

4. Results

We made a total of 55 trades during the trading period from October 11, 2004 to December 3,
2004. Each pair normally required 4 trades, 2 while entering the position and 2 while exiting.
In addition, if there were any opportunities for doubling up, an additional 2 trades were made
for the pair. This meant a commission of minimum $100 for each position taken. During the
last week, we did not enter any new positions since it was risky if the position did not
converge within the last week. Three of our positions, two of which we had doubled up in,
were open on the close of December 3, 2004.
We started with cash of $1,000,000. The portfolio value of our position as on December 3,
2004 was $1,011,192. This means a return of 1.12% over 39 trading days or 7.17% annual
returns. The S&P 500 index grew from 1124.39 to 1191.17 points during the same time
implying a return of 5.94% or 8.07% annually.

This shows that we underperformed the index. This is mainly due to two reasons. First, we
were unable to execute the strategy completely from the first day onwards as explained in
Section 7. Second, we had three open positions as at the end of the trading. These were
currently trading at a loss but were expected to converge in the near future.

As compared to the class, we performed almost at the average as can be seen from the
following graph. We were ranked between 5th and 6th for most of the trading days.

1300000

1200000

1100000

1000000

900000

800000

700000
42 43 44 45 46 47 48 49
Highest Lowest Average Our Performance

In order to explain the trading strategy better, we now illustrate an example of a pair trade.
For the pair Cisco Systems and Time Warner, we found a trading opportunity based on the
rank spread as on November 10, 2004. The rank spread had widened to 28 as against the
average of -1.17 and standard deviation of 10.73. This indicated a trading opportunity since
the spread was higher than the average spread + 2*standard deviation. We entered the
position on November 11, 2004 where we bought 9300 shares of Cisco and short sold 9300
shares of Time Warner at a price of 18.50 and 17.11 respectively. On November 15, 2004 the
spread converged to 4 which was within the average + standard deviation. Hence, we chose to
close this position. On November 16, 2004 we closed the position by selling the shares of
Cisco and buying back shares of Time Warner at 19.43 and 17.39 respectively. Thus the
spread between the prices changed from 1.39 to 2.04 giving us a profit of 0.65 per share or
$6045. From this we deduct the transaction cost paid ($100) which gives us a profit of $5945.

A summary of all the trades entered into by us is given in the following table:
Date Security 1st Signal Date Double up Date Exit Profit
Qty Price Amount Qty Price Amount Qty Price Amount
2004-11-03 CSCO 13875 19,62 -272 252,50 2004-11-05 -13875 19,79 274 561,25
TWX -13875 16,47 228 496,25 13875 16,95 -235 206,25 -4 401,25
2004-11-03 AIG -5925 62,01 367 384,25 2004-11-11 5925 60,95 -361 153,75
PKI 5925 21,83 -129 367,75 -5925 21,60 127 955,00 4 817,75
2004-11-03 JPM -6000 39,34 236 015,00 2004-11-11 6000 39,20 -235 225,00
PGL 6000 44,00 -264 025,00 -6000 44,16 264 935,00 1 700,00
2004-11-03 MOT -7900 17,33 136 882,00 2004-11-11 7900 17,35 -137 090,00
ANDW 7900 14,22 -112 363,00 -7900 14,54 114 841,00 2 270,00
2004-11-03 NVDA 5725 15,19 -87 127,75 2004-11-05 -5725 17,72 101 422,00
CR -5725 28,27 161 820,75 5725 28,90 -165 477,50 10 637,50
2004-11-05 TWX 4425 16,95 -75 028,75 2004-11-11 -4425 17,11 75 686,75
GM -4425 39,74 175 824,50 4425 39,72 -175 786,00 696,50
2004-11-05 CD -4950 21,65 107 142,50 2004-11-11 4950 22,80 -112 885,00
CR 4950 28,90 -143 080,00 -4950 29,28 144 911,00 -3 911,50
2004-11-11 CSCO 9300 18,50 -172 075,00 2004-11-16 -9300 19,43 180 674,00
TWX -9300 17,11 159 098,00 9300 17,39 -161 752,00 5 945,00
2004-11-11 CSCO 8825 18,50 -163 287,50 2004-11-16 -8825 19,43 171 444,75
HPQ -8825 18,91 166 855,75 8825 19,35 -170 788,75 4 224,25
2004-11-11 AIG 4000 60,95 -243 825,00 2004-11-30 -4000 63,45 253 775,00
PKI -4000 21,60 86 375,00 4000 21,20 -84 825,00 11 500,00
2004-11-11 JPM 3975 39,20 -155 845,00 2004-11-17 2650 38,50 -102 050,00
PGL -3975 44,16 175 511,00 -2650 44,05 116 707,50 Open
2004-11-11 TWX -5850 17,11 100 068,50 2004-11-22 -5850 17,42 101 882,00
GM 5850 39,72 -232 387,00 5850 38,76 -226 771,00 Open
2004-11-11 MOT 10425 17,35 -180 898,75 2004-11-22 -10425 18,03 187 937,75
ANDW -10425 14,54 151 554,50 10425 14,35 -149 623,75 8 969,75
2004-11-17 CD 9650.00 22,58 -217 922,00
CR -9650.00 29,50 284 650,00 Open
Some of the interesting results from our trading experience are now described. When we began trading
we were under the impression that we might not get too many trading opportunities and those that arise
will take some time to close. However, during the trading we found frequent opportunities and the
positions were really held short term over a few days. Hence, while initially we were thinking of using
ARMA model for trading currency with the excess funds we had, we found that there was no need since
we were almost always locked in with some position in pairs trading. As a result, ARMA model and
currency trading has not been discussed in this paper.

5. Risks involved in the Strategy

Market Risk: the strategy of pairs trading is attractive since it is market neutral. This means that the
trader does not bear any market risk and can expect to make profits irrespective of rising or falling
prices. This is because the trader bets on the spread between the two stocks instead of betting on the
absolute price levels.

Fundamental Risk: one of the main risks involved with pairs trading based only on technical analysis is
that a fundamental change in the relationship between the two stocks can get masked and the trader can
enter positions when the prices are not expected to revert to historical means. This can happen when for
example, there is a fundamental change in the strategy of one of the companies as a result of which the
price level changes permanently.

Industry risk: while fundamental analysis based pairs trading normally looks at stocks within the same
industry, technical analysis based trading does not. This is evident from our pairs as well where only 4
out of 15 were one industry pairs. This means that the trader is somewhat protected against adverse
movements affecting any particular industry since he is diversified. However, the diversification may not
be large enough given only two stocks in the pair.

Noise Trader risk: like any other contrarian, mean reversion strategy, our strategy was subject to noise
trader risk. This is the risk that the deviations which signal a trading opportunity may not converge in the
short run and therefore, lead to higher losses, also resulting in larger margin requirements.
6. Limitations

Low priced stocks: since Stocktrak does not allow us to trade in stocks with a price of below $5, we had
to exclude some stocks while choosing the lowest 50 on the S&P 500. We do not feel, however, that this
limitation resulted in any significant losses although it might have reduced the potential number of pairs
available for trading.

Price discrepancy: our trading signals were based on actual market prices at the end of each day. Since
the prices in Stocktrak were somewhat different from these, there was a discrepancy in the price at which
we wanted to place the trade and the price at which we could actually place it.

7. Mistakes

Opposite positions: one of the most obvious mistakes we made was that when taking positions based on
our trade signals, we misunderstood the signal and took opposite positions. This happened since the
signals were based on ranks and higher ranks are lower numbers! This mistake cost us $4401.25 as we
ha to close one of the positions at a loss. For the other positions where we made this mistake we were
able to close the position at a profit since the spread had widened instead of converging.

Delay in starting: we were also unable to start trading early. This was mainly due to time constraints. In
order to select the pairs we had to individually download stock price data for one year for 150 stocks.
Thereafter, run regressions for each one of them and compute residuals. This took quite a lot of time and
given the exams at the end of last term, there was a delay before we started trading. Also, our strategy
required us to compute ranks everyday. However, due to other classes and projects, there were some
days when we were unable to do so. We feel that we did lose out on some opportunities due to the delay.
However, missing out on some days did not cost us heavily since we were generally able to take
positions or close the same the next day.

Use of Market orders: when placing orders, we placed market orders to be executed at the opening prices
of the next day. This meant that the prices were not the same as the ones implied by the trading signals
we received. This could have been averted by placing limit orders. It is difficult to estimate the impact of
this mistake, however it could have been substantial.
Pure technical analysis strategy: as mentioned earlier, a pairs trading strategy based solely on technical
analysis can be risky since fundamental relationship between stocks can change permanently. However,
we followed the technical heuristics assuming them to be correct indicators of deviations which would
mean revert.

8. Risk Control Measures

We did not implement any risk control measures for the strategy except monitor the positions daily.
However, there are several ways in which one can control the risks. A common way is to use limit orders
and to place stop-loss orders. The problem with using the stop-loss method for the pairs trading strategy
is that we enter the position as soon as there is a deviation and it can be expected to widen before
reverting back to the mean. A stop-loss in such a scenario would lead to pre-mature termination of
positions which could lead to losses.

Diversification is another common way of decreasing the risks involved. From the point of view of pairs
trading, it could mean two things. Firstly, it might mean investing only a portion of total capital in the
pairs trading strategy so that there is adequate diversification through other investments. Secondly, it
could mean holding positions in several pairs and limiting the amount invested in any pair like we did.
However, this may not be easy to implement since it is reasonable to assume that trading opportunities
would not arise in many pairs at the same time.

9. Conclusion

In the end, we feel that pairs trading is an attractive strategy since it does not require very high levels of
skills from the traders. However, as a stand alone strategy, it is faced with some risks which can be
diversified away. Thus, we believe that a pairs trading strategy makes sense as part of a larger portfolio.
It is, however, trade intensive and thus, entails high transaction costs. In real life these costs might be
higher than those in Stocktrak which could make this strategy unprofitable.
0
10
20
30
40
50
60

-30
-20
-10
0
10
20
30
40
50
60
-30
-20
-10
0
10
20
30
04-10-01

0
10
20
30
40
50
60
70
04-10-01 04-10-03

04-10-01
04-10-01

AIG-PKI
04-10-03 04-10-05
Appendix

04-10-05 04-10-07
CSCO-HPQ

04-10-07 04-10-09

04-10-08

04-10-08
04-10-09 04-10-11

04-10-11 04-10-13

04-10-13 04-10-15

04-10-15 04-10-17

04-10-15

04-10-15
04-10-17 04-10-19

04-10-19 04-10-21

04-10-21 04-10-23

04-10-22
04-10-23 04-10-25

04-10-22
04-10-25 04-10-27

04-10-27 04-10-29

04-10-29 04-10-31

04-10-29

04-10-29
04-10-31 04-11-02

04-11-02 04-11-04

04-11-04 04-11-06

04-11-05
04-11-06 04-11-08

04-11-05
04-11-08 04-11-10

04-11-10 04-11-12

04-11-12 04-11-14
04-11-12

04-11-12
04-11-14 04-11-16

04-11-16 04-11-18

04-11-18 04-11-20
04-11-19

04-11-20 04-11-22

04-11-19
04-11-22
HPQ

PKI
AIG
CSCO

-1SD
-2SD

+2SD
+1SD

-1SD
-2SD

+2SD
+1SD
CSCO-HPQ

AIG-PKI
-60
-40
-20
0
20
40
60
80
-50
-40
-30
-20
-10
0
10
20
30
40

0
10
20
30
40
50
60
70
0
10
20
30
40
50
60
70

04-10-01
04-10-01 04-10-01

CD-CR
04-10-01
04-10-03 04-10-03
TWX-GM

04-10-05 04-10-05

04-10-07 04-10-07

04-10-08
04-10-08
04-10-09 04-10-09

04-10-11 04-10-11

04-10-13 04-10-13

04-10-15 04-10-15

04-10-15
04-10-15
04-10-17 04-10-17

04-10-19 04-10-19

04-10-21 04-10-21

04-10-22
04-10-22
04-10-23 04-10-23

04-10-25 04-10-25

04-10-27 04-10-27

04-10-29 04-10-29

04-10-29
04-10-29
04-10-31
04-10-31

04-11-02 04-11-02

04-11-04
04-11-04
04-11-06

04-11-05
04-11-05
04-11-06
04-11-08
04-11-08
04-11-10
04-11-10
04-11-12
04-11-12

04-11-12
04-11-12

04-11-14
04-11-14
04-11-16
04-11-16
04-11-18
04-11-18
04-11-20
04-11-20

04-11-19
04-11-19

04-11-22
04-11-22
GM

CR
CD
TWX

-1SD
-2SD

+2SD
+1SD

-1SD
-2SD

+2SD
+1SD
TWX-GM

CD_CR
-50
-40
-30
-20
-10
0
10
20
30
40
0
10
20
30
40
50
60
04-10-01

04-10-01
04-10-03

04-10-05

04-10-07
[Link]

04-10-09

04-10-08
04-10-11

04-10-13

04-10-15

04-10-15
04-10-17

04-10-19

04-10-21

04-10-23

04-10-22
04-10-25

04-10-27

04-10-29

04-10-29
04-10-31

h
04-11-02

04-11-04

04-11-06

04-11-05
04-11-08

04-11-10

04-11-12

04-11-12
04-11-14

04-11-16

04-11-18

04-11-20
04-11-19

04-11-22
TWX
CSCO

-1SD
-2SD

+2SD
+1SD
CSCO-TWX

You might also like