Analyzing nifty Cointegration for pair stocks trading

Stocks
2 min readOct 27, 2019

--

tldr; one can use pairwise stocks lets say for example when TCS + INFY targets similar target and there is a good chance that one's profit might take a portion of the profit from other. This kind of relationship can be found by cointegration. This article talks about recent analysis of NIFTY stocks using same technique.

First let's look at the graph

Pair stock analysis for last 3 years (nifty)

If you carefully look into dark green colored cells those are ones with low p value which means there could be relationship makes them co-integrated.

For example, HDFCBANK on 4th row has a strong possible relationship with KOTAKBANK(0.00000135), BAJAJFINSV (value of 0.000585). That means on average they both keep the ratio of stock value somewhat the same.

Well, how to use this in practice. I think experts at this can explain better Read more about pair stock trading from Zerodha varsity

By no means I am recommending pairs here, its just analysis and outcome suggest possibility of a relationship. For example, consider INDUSINDBK indicates relationship with DRREDDY which needs further analysis to rule out the possibility.

For Better filtering, showing only with p value < .05

Further comparing ratios will give you a better understanding of what are we dealing with here. Generally for a good dependable relationship should have ratio line moving back and forth the mean. In other words ratio of HDFCBANK and KOTAKBANK is fairly stable in last 3 years.

Ratios of HDFCBANK with ICICIBANK and KOTAKBANK

As shown in the above image, HDFCBANK is not maintaining a stable relationship with ICICIBANK but with KOTAK it is a bit credible.

Let me know your thoughts! I am not an expert in the field just trying to learn every day! and exploring different techniques.

--

--

Stocks

Experimenting on stocks, strategies and everything related.