January 18, 2009

NSE Pair Trading Example

There can be many types of pairs: two stocks, one stock and a group of stocks, one stock and an index, a group of stocks and an index and so on. To understand the concept of mean reversion and the instruments required to execute a pairs trade on NSE, we’ll start with two stocks: Wipro and Infosys.

According to a KRChoksey Report, the recommended strategy is to long infosys and short wipro. lets understand the reasoning, and see if this strategy would actually have worked.

Although the report refers to futures positions, I have done the complete analysis based on closing prices of these stocks (underlying) for the past 20 days. I have not understood this 20 day thing (except that it represents the number of trading days in the past month - why a month shd be taken, i don’t know), but for now, we’ll go ahead with this 20 days data.

I downloaded the closing prices of wipro and infosys for the 20 days before the day of recommendation (Dec 11, 2008). For 20 data points, I had to download data from 10-Nov-2008 to 10-Dec-2008. I figured out the following (I am guessing, since my analysis is based on actual stock prices and not the future contract prices, my results are slightly different). Pls note that this whole exercise is based on 20 most recent data points.

1. The mean price ratio of the closing prices: 5.05
2. Standard Deviation: 0.17
3. Based on 10 Dec closing stock prices, the price ratio is 4.49, which is at -3.29 times the mean price ratio.
4. So the conclusion, based on mean reversion, is to go long on Infosys and short on Wipro.

But we need two more pieces of info before we can enter this trade: when do we book profits, and whats the stop loss. How do we calculate that? There are many ways we can determine this, but for now, we’ll go with a simple rule: movement of 1 more standard deviation away from the mean we’ll cut losses, and movement of 3 standard deviations towards the mean we’ll book profits. So, a price ratio of 4.32 or 5.0, we are out of the trade.

Now, for the interesting parts. There are two interesting parts: How exactly do we implement this strategy, and, what would have been the results.

Lets postpone the “How exactly do we implement this strategy” to a separate post. I have many queries around the nature and availability of the appropriate derivative instruments.

For now, lets assume we had taken these positions, again using closing prices for the next 20 days, lets see how we would have fared.

I downloaded the data again, and did the price ratio calculations, and realized that on 24-Dec-08, the price ratio was 5.05. we would have booked profits and gotten out. Pairs Trading WORKS!

The exact percentage of profit would be decided by the investment, which depends upon the instruments we used to implement this trade. That would be the subject of the next post.

Comments (View)

Pairs Trading - Level 0 understanding

Luminous Logic provides an example and a very very high level overview of pairs trading. The basic idea is presented below:

1. Find a pair of stocks (or ETFs) whose prices tend to move together.

2. If the price movements are indeed highly correlated, then on most days the price per share of Stock A divided by the price per share of Stock B should come out to be about the same number, within a small range.

3. But occasionally, you might notice a significant divergence from this “average” ratio. If you do, enter a pairs trade. This will involve simultaneously shorting one of the stocks while taking a long position in the other.

4. At some time in the future when the price ratio (hopefully) reverts to the mean, exit the pair trade.

So the basic idea is that the price ratio reverts to a mean. We’ll test this hypothesis with some numbers in the next post.

Comments (View)
January 16, 2009

What is Pair Spotting?

Few days back, my friend introduced me to Pairs Trading. Strategies are formulated, based on the idea that the price relationship between two related instruments tends to fluctuate around its average in the short term, while remaining stable over the long term.

I plan to study pairs in more depth, and try and do actual trades based on what I find. I plan to keep my notes in this blog.

Welcome to Pair Spotting!

Comments (View)