Identify Trading Opportunities – Pair Trading

At the end of the previous chapter, we discussed about the density curve and how we can find out pair trading opportunities by looking at the value of the density curve. In this chapter, we will try to learn how we can identify those trading opportunities and make a real trade. Along with this, we will also learn other things related to it.

Here, I would like to remind you once again that the pair trading technique we are discussing right now is based on a book called Trading Pairs and it is written by Mark Wissler. The good thing about this technique is that it is quite straightforward and simple. But I do not like its simplicity. That is why I have improved this technique according to my understanding and created a new technique. Which I will start discussing from the next chapter.

I did not tell my technique in the beginning because I think that with this technique of Mark Wissler, it will be easy for you to understand pair trading and after that, when I explain a difficult technique, it will also be easy for you to understand it. I will try to conclude my discussion on Mark Wissler’s technique in this chapter so that I can introduce a new technique in the next chapter.

So, now in this chapter, instead of going into the technical details of Mark Wissler’s pair trading, let me move straight to its application. Let us see how trade setups can be made using it.

Using the Density Curve

The density curve acts as a trigger to identify a trade opportunity. Here I would like to draw your attention to two things.

The density curve is derived from a time series data. In our context, this time series data is of ratios. As you saw in the previous chapter, the main inputs of the density curve are the time series data of the ratio, the mean of the ratio and the standard deviation of the ratio.

The value of the density curve is between 1 and 0 and the density curve tells us the probability of the ratio returning to its mean.
This second point above may not be understood by some people properly. But I am sure that you will understand it as you go along.

Now let us look at the normal distribution again for a while.

Generally, any time series data (such as ratios) has an average/mean value. For example, the mean of our time series of ratios is 1.87 (we calculated this in the previous chapter). Most of the time, the ratio remains close to this mean value. If the ratio moves away from its mean value, you can expect it to revert to the mean.

For example, if the current value of the ratio is 2.5, you can expect it to revert to 1.87 after some time. Similarly, if the value of the ratio goes far below its mean, it also reverts to the mean.

Now the question is, when the ratio moves away from the mean (which happens almost every time, every day), is there any way to measure the probability of the ratio reverting to the mean?

For example, If the ratio is at 2.5 and we know it will go back to 1.87, what is the probability of that happening 10%, 20% or 90%.

This is where the density curve helps. The value of the density curve tells us how far the ratio has moved from the mean in terms of standard deviation. Now if we know the value in terms of standard deviation, we also know its probability as they are related. Then, we can set up our trade accordingly.

Let us understand this with an example

Look at this data –

New/Latest Ratio – 2.87

Mean of Ratio – 1.87

Density Curve – 0.92

You can understand this data in this way – Density curve being at 0.92 means that the ratio which was at 2.87 has gone up to about 2nd standard deviation and hence there is a 95% probability that the ratio from 2.87 will come back to 1.87.

How did we conclude that the ratio going up to 2.87 means it has gone up to 2nd standard deviation? In fact, for this we just looked at the value of the density curve which is 0.92.

The value of the density curve between 0 to 1 also tells us the standard deviation. Let us take an example –

0.16 on the density curve means it is at -1 standard deviation and is below the mean.

0.84 on the density curve means it is at +1 standard deviation and is above the mean.

0.997 on the density curve means it is at the 3rd standard deviation and is above the mean.

Once we know the standard deviation, we also know the probability.

A question may arise in your mind that where did we get 0.16, 0.84, 0.997 from? Actually these are all the values ​​of standard deviation. But now is not the time to discuss this, I am giving you a table of it which you can use –

Value Of Density Curv Distance from Standard Deviation Probability
0.16 – 1 SD 65%
0.025 – 2 SD 95%
0.003 –  3 SD 99.7%
0.84 + 1 SD 65%
0.974 + 2 SD 95%
0.997 + 3 SD 99.7%

From the above table, we can see that if the density curve is near 0.19 then the ratio is near -1 standard deviation and hence the probability of it reverting to the mean is about 65%. If the value of the density curve is 0.999 then the ratio is near -3 standard deviation and the probability of it reverting to the mean is 99.7%.

This is how we can use this table.

First Pair Trade

So now it is time to start our first pair trade. Here are a few things to remember –

The ratio is calculated by dividing the price of stock A by the price of stock B. In our example Stock A is Axis Bank and Stock B is ICICI Bank, so Ratio = Axis Bank / ICICI Bank

The ratio changes every day and this change occurs because the stock price of Axis Bank and ICICI Bank keeps changing

The value of ratio and density curve also has to be calculated every day

Here our trading philosophy is –

If two businesses operate in the same way and their business environment is the same, say Axis Bank and ICICI Bank, then their stock prices move in the same way.

Any change in the business environment will affect the prices of both these stocks.

Any event affecting one company will affect the price of that company only and its price movement will change, the ratio of the stock will also change on such days.

We have to look for such changes because that is what gives the right trading opportunities.

So, what we see here is that the pair trader always tracks the value of the ratio and the associated density curve. Whenever the ratio (and the density curve) move a significant distance from the mean, a trade is set up.

The next question is what is that significant distance, or what should be the value of the density curve when we initiate a trade?

Here I am giving some general rules for this –

Which Trade Trigger (Desity Curve) Standard Deviation Target Stop Loss
Long Between 0.025 & 0.003 Between 2nd & 3rd 0.25 or below 0.003 or above
Short Between 0.975& 0.997 Between 2nd & 3rd 0.975 or below 0.997 or above

While entering a trade, try to enter the trade when the ratio is between the 2nd and 3rd standard deviation. When the ratio goes below the 2nd standard deviation, the position should be squared off. However, the closer it gets to the mean, the higher will be your profit.

Now let us setup a trade based on the above table. For this, I would suggest you to download the Excel sheet given at the end of the previous chapter.

On 25 October 2017, the value of the density curve was 0.05234 and the ratio at that time was 1.54, which is a decent setup for a long pair trade. However, it does not fit the definition of a long trade (for this the density curve should be between 0.025 to 0.003) but this is the best value in this time series.

If the ratio is obtained by dividing the price of stock A by the price of stock B then –

In a long trade you have to buy stock A and sell stock B

In a short trade you have to sell stock A and buy stock B

We have calculated the ratio based on the closing of Axis/ICICI on 25 October so

Buy Axis Bank at the price of Rs 473

Sell ICICI at the rate of Rs 305.7

The lot size of Axis is 1200 so the contract value will be 1200 * 473 = 567,600, the lot size of ICICI is 2750 so the contract value will be 2750 * 305.7 = 840,675/–

Generally, the effort should be that the price of both long and short trades should be equal in rupees. This is called Rupee Neutrality. But I will not discuss it right now. We will discuss this principle when we talk about the next technique of pair trading.

Once your trade is setup, we have to wait for the pair to revert to the mean. In theory, the best pair trade is when you initiate it near the 3rd standard deviation and wait for the ratio to revert to the mean. But sometimes this wait is too long. In such a case, Mark to Market (MTM) becomes a problem. Those who do not have the funds to bear the problem of Mark to Market (MTM) have to close the pair trade early.

On 31st October 2017, the ratio went up to 1.743 and the value of the density curve accordingly became 0.26103 which is very close to our target. So, we can close the trade here. We will sell Axis Bank at 523 and buy ICICI Bank at 300.1. The P&L of this trade will be –

Date Stock Trade Lot Size Square Off Date Square Off Price P&L
9th Aug Axis Bank Sell @ 574.1 1200 8th Sept Buy @ 571 3.1*1200 = 3.72K
9th Aug ICICI Bank Buy @ 245.3 2750 8th Sept Sell @276.33 31.03*2750 = 85.3K
Total P&L Rs.89,052/-

Here you will see that most of the profit is coming from Axis Bank, which means that Axis Bank had moved away from its usual trading pattern.

Now let’s look at a short trade

On 9th August 2016, the value of the density curve was 0.99063156 which is a good value to initiate a short trade. Remember that in the short trade we will sell Axis Bank and buy ICICI.

If you are finding it difficult to remember which one to buy and which one to sell, then you can remember it like this – the stock which is getting split i.e. the numerator stock is the more important stock. So in a pair trade when you go long, you buy the higher numerator stock. Similarly, when you go short in a pair trade, you short the numerator stock. Whatever you do with the numerator stock, you have to do the opposite with the denominator stock.

So we are selling Axis Bank (Numerator) and buying ICICI Bank (Denominator).

The details of this trade are –

Short Axis Bank @ 574.1

Buy ICICI Bank @ 245.35

Ratio – 2.34
Value of Density Curve – 0.99063156

The opportunity to close this trade was on 8th September, meaning this trade remained open for almost 1 month. At the time of closing, the details of this trade were as follows –

Bought Axis Bank @ 571

Sold ICICI Bank @ 276.33

Ratio – 2.27

Value of Density Curve – 0.979182

Some people may feel that they should have waited a little longer in this trade, so that the density curve would have fallen further. But as I said, in pair trades, one always has to maintain a balance between how much time is being given and what is the mark to market.

The P&L of this trade is like this –

Date Stock Trade Lot Size Square Off Date Square Off Price P&L
9th Aug Axis Bank Sell @ 574.1 1200 8th Sept Buy @ 571 3.1*1200 = 3.72K
9th Aug ICICI Bank Buy @ 245.3 2750 8th Sept Sell @276.33 31.03*2750 = 85.3K
Total P&L Rs.89,052/-

You will again see that most of the gains are coming from one stock i.e. ICICI, which means that ICICI stock has moved away from its normal path.

Here I must confess that in both these trades we have not followed the table that we had prepared as a guideline to enter and exit the trade. But I had said earlier that you have to use this table as a guideline and after that you have to learn from your experience.

I would suggest you to look at other examples like this in Axis and ICICI Bank.

I think here the profit made in this trade i.e. its P&L will encourage you to learn more about pair trading and use it. Now I am closing my talk here and leaving some important points for you.

What you have learned so far is only 25% of what I am going to tell you further.

The pair trading technique that I have discussed so far in the first 7 chapters is very simple and basic. But I have tried to give you a background through this.

I have not gone into the definition of stop loss and target of the trade. I have explained everything in a very simple way.

Neutrality is very important for both the positions but I have not discussed that yet.

I have also not discussed the risks associated with pair trading.

Pair trading requires a lot of margin money. So you need to have a lot of money before trading pairs but the

P&L compensates for this investment.

You get opportunities or signals in any pair only two or three times a year, so you have to track many pairs so

that you keep getting opportunities.

I hope now you would like to know more about pair trading.

Key points of this chapter

  1. The density curve acts as a trigger to initiate a pair trade.
  2. A pair trade is initiated when the ratio is between the 2nd and 3rd standard deviation.
  3. A pair trade is closed when the ratio reverts back to the mean.
  4. In a long pair trade, you buy the numerator and sell the denominator.
  5. In a short pair trade, you sell the numerator and buy the denominator.
  6. Usually, the majority of the P&L in a pair trade comes from a single stock that has moved far away from the pair’s general movement.
  7. A pair trade can be a long one, but the P&L that results from it is well worth the wait.
    Pair trading requires a lot of margin money.