Pair Trading

Big Short

Active Member
#1
Although there are a couple of threads on pair trading on this forum , i found them lacking on a number of levels and mostly all of them were experimental in nature.
I am doing pair trading since the last 3-4 years and i believe i have finally tailored the model to generate winning trades in excess of 90 percent.
This thread will serve as a platform for people who want to get their questions answered regarding pair trading and statistical arbitrage as well as a journal for my trades.
 

sr114

Well-Known Member
#2
Although there are a couple of threads on pair trading on this forum , i found them lacking on a number of levels and mostly all of them were experimental in nature.
I am doing pair trading since the last 3-4 years and i believe i have finally tailored the model to generate winning trades in excess of 90 percent.
This thread will serve as a platform for people who want to get their questions answered regarding pair trading and statistical arbitrage as well as a journal for my trades.
1. How is this pair : Bnak Nifty futures current month and Nifty futures current month ?

2. How to determine when to sell Banknifty buy Nifty or vice versa?

rgds
 

Riskyman

Well-Known Member
#3
Although there are a couple of threads on pair trading on this forum , i found them lacking on a number of levels and mostly all of them were experimental in nature.
I am doing pair trading since the last 3-4 years and i believe i have finally tailored the model to generate winning trades in excess of 90 percent.
This thread will serve as a platform for people who want to get their questions answered regarding pair trading and statistical arbitrage as well as a journal for my trades.
Nice initiative. Keep us posted. Just out of curiosity.. Do you use any software to compute correlation and co-integration of stocks or do you run your own excel sheet?

I have done a lot of pair trading myself in the past. While it can be rewarding, in some case waiting for the pair to revert to mean can be frustrating. Im the edgy kind of guy so i need my stock doing something or the other all the time.

Good luck.
 

Big Short

Active Member
#4
1. How is this pair : Bnak Nifty futures current month and Nifty futures current month ?

2. How to determine when to sell Banknifty buy Nifty or vice versa?

rgds

Doing pair trading in between indices is not supported by theory as the 2 indices may diverge due to a variety of reasons. Some of the reasons may be sectoral churning, dependency of a certain index on a single macro factor etc.
Like in the case of banknifty the macro variable can be interest rates or some action by the Central Bank. ( like raising the MSF etc.) or in the case of CNX IT the macro variable may be currency ( specifically USD/INR).

However a pair trading model is not based on fundamentals, the execution is based on statistical inputs and data points. I have traded the pair of nifty and banknifty several times not because i expect it to converge based on fundamentals but just purely out of mean reversion.

On your second question on when to buy nifty or sell it, thats actually a million dollar question. I will try to answer that after i have my dinner :)
Hope you got some help and information regarding your 1st question.
 

amitrandive

Well-Known Member
#5
Although there are a couple of threads on pair trading on this forum , i found them lacking on a number of levels and mostly all of them were experimental in nature.
I am doing pair trading since the last 3-4 years and i believe i have finally tailored the model to generate winning trades in excess of 90 percent.
This thread will serve as a platform for people who want to get their questions answered regarding pair trading and statistical arbitrage as well as a journal for my trades.
Great Big Short!!!
Looking forward to this thread.
:thumb:
 

Big Short

Active Member
#6
Nice initiative. Keep us posted. Just out of curiosity.. Do you use any software to compute correlation and co-integration of stocks or do you run your own excel sheet?

I have done a lot of pair trading myself in the past. While it can be rewarding, in some case waiting for the pair to revert to mean can be frustrating. Im the edgy kind of guy so i need my stock doing something or the other all the time.

Good luck.
Thanks.
I do run my own excel sheet. Correlation can be done in excel easily. Its the co-integration part which takes time. Co-integration can be calculated by 2-3 different methods, specifically ADF test ( Augmented Dicky-Fueller Test ) or by Johansons Test and using OLS ( Ordinary Least Square ) as well.

Although the theortical papers and books tell us that co-integration is a must, it actually is a hindrance while doing pairs trading. I had run Co-integration test on the entire F&O universe ( well almost the entire F&O) and came up with no pairs which were fully integrated. Hence i do not use co-integration. I rarely look at correlation as well. I ll explain it in future posts. Hope to see you around here more :) and learn from your experiences as well
 

Riskyman

Well-Known Member
#7
not because i expect it to converge based on fundamentals but just purely out of mean reversion.
The entire premise of PT is built on mean reversion only. Indices, like you mentioned can go haywire due to underlying macros. But All sub indices will eventually repeat eventually revert to mean with the primary index. Whether it happens in 1 day or 1 year or 10 it always catches up.
 

Riskyman

Well-Known Member
#8
Thanks.
I do run my own excel sheet. Correlation can be done in excel easily. Its the co-integration part which takes time. Co-integration can be calculated by 2-3 different methods, specifically ADF test ( Augmented Dicky-Fueller Test ) or by Johansons Test and using OLS ( Ordinary Least Square ) as well.

Although the theortical papers and books tell us that co-integration is a must, it actually is a hindrance while doing pairs trading. I had run Co-integration test on the entire F&O universe ( well almost the entire F&O) and came up with no pairs which were fully integrated. Hence i do not use co-integration. I rarely look at correlation as well. I ll explain it in future posts. Hope to see you around here more :) and learn from your experiences as well
These days I'm living on this forum. So, im sure we will bump in very often. :cool:

Of course we may never find anything thats fully integrated but if they are close to being "closely integrated" then it works. Correlation is a must. Correlated stocks tend to give better returns and are more predictable in nature. I've held some trades for over 4 months at a time with no sign of making profits. Ive exited such trades due to sheer boredom of watching them do nothing. Of course some day they did revert to mean and had i held on to them i would have made money. The question I ask then is " what is my opportunity cost of holding these positions?".
 

mastermind007

Well-Known Member
#9
Although there are a couple of threads on pair trading on this forum , i found them lacking on a number of levels and mostly all of them were experimental in nature.
I am doing pair trading since the last 3-4 years and i believe i have finally tailored the model to generate winning trades in excess of 90 percent.
This thread will serve as a platform for people who want to get their questions answered regarding pair trading and statistical arbitrage as well as a journal for my trades.
Great !! shall look forward to your postings....
 
#10
Of course we may never find anything thats fully integrated but if they are close to being "closely integrated" then it works. Correlation is a must. Correlated stocks tend to give better returns and are more predictable in nature. I've held some trades for over 4 months at a time with no sign of making profits. Ive exited such trades due to sheer boredom of watching them do nothing. Of course some day they did revert to mean and had i held on to them i would have made money. The question I ask then is " what is my opportunity cost of holding these positions?".
There are multiple reason due to which i dont use correlation or cointegration. I must confess in my earlier years i used to obsess over both of them but over the years i have grown to realize that its not of much use.

Out of correlation and cointegration, the latter is of course the superior statstical tool. however, there are very very few pairs which are fully or "closely integrated". I mean if you will run the test you will find very very very few pairs which are cointegrated at 90 percent confidence interval.
Even if we do find such pairs, they very rarely diverge from each other hence we dont get much trading opportunities. ( once a year types )

Correlation is a useless metric in pair trading. Firstly it does not tell you the causality. Secondly , historical correlation does not point out to future correlation. Thirdly, the coefficient of correlation will vary greatly across time frames ( monthly, 3 monthly , 6 monthly and yearly ).

Apart from their individual drawbacks, what is a common drawback with both of them is that they dont tell us about "Structural Breaks" in pairs. Structural breaks may happen in between a fully cointegrated pair as well as a fully correlated pair ( correl coefficient =1 ). It may happen due to a variety of reasons like Earnings Surprise , M&A activity, Company Specific factors like fabrication, fraud, governance, promoters selling their stake etc. etc.


About the opportunity cost of holding a pair, we break down our trading system to trade 4 types of signals.
1. Very Short Term ( 1-2 Days or even Intra Day)
2. Short Term ( 3-7 Days )
3. Positional ( 5-20 Days )
4. Tracking the Structural Break

The days mentioned are working days, obviously. Now the time frame which is the highest is obviously the 4th one when a pair undergoes structural break. We obviously dont know the reason behind the structural break until very late ( when we read about it in media ). So the opportunity cost is highest in the 4th category.