{"id":1989481,"date":"2014-04-28T21:01:20","date_gmt":"2014-04-28T15:31:20","guid":{"rendered":"http:\/\/stockviz.biz\/index.php\/?p=1989481"},"modified":"2014-09-09T12:06:22","modified_gmt":"2014-09-09T06:36:22","slug":"bank-nifty-vs-hdfc-bank-icici-bank","status":"publish","type":"post","link":"https:\/\/stockviz.biz\/index.php\/2014\/04\/28\/bank-nifty-vs-hdfc-bank-icici-bank\/","title":{"rendered":"Bank Nifty vs. HDFC Bank and ICICI Bank"},"content":{"rendered":"<p>We recently discussed <a href=\"http:\/\/stockviz.biz\/index.php\/2014\/04\/24\/relationship-pair-stocks\/\" target=\"_blank\">linear regression<\/a> by using it to inspect the relationship between two banking stocks. Lets try and extend that treatment to an index and its predominant constituents.<\/p>\n<h3>Bank Nifty<\/h3>\n<p>The <a href=\"http:\/\/stockviz.biz\/Indices?TICKER=CNX%20BANK\" target=\"_blank\">Bank Nifty<\/a> is composed of 12 bank stocks with <a href=\"http:\/\/stockviz.biz\/Equity?TICKER=ICICIBANK\" target=\"_blank\">ICICIBANK<\/a> and <a href=\"http:\/\/stockviz.biz\/Equity?TICKER=HDFCBANK\" target=\"_blank\">HDFCBANK<\/a> making up 29.27% and 28.26% of the index, respectively. Lets start with the scatterplot of daily log returns of the nearest to expiration futures.<\/p>\n<p><a href=\"http:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/bank-futures.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1989491\" alt=\"bank-futures\" src=\"http:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/bank-futures.png\" width=\"1024\" height=\"768\" srcset=\"https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/bank-futures.png 1024w, https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/bank-futures-300x225.png 300w, https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/bank-futures-400x300.png 400w, https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/bank-futures-900x675.png 900w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>Notice the strong relationship between the index and the banks?<\/p>\n<h3>Q-Q Plots<\/h3>\n<p><a href=\"http:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/ICICIBANKHDFCBANK-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1989501\" alt=\"ICICIBANK~HDFCBANK-q-q-plot\" src=\"http:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/ICICIBANKHDFCBANK-2.png\" width=\"640\" height=\"480\" srcset=\"https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/ICICIBANKHDFCBANK-2.png 640w, https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/ICICIBANKHDFCBANK-2-300x225.png 300w, https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/ICICIBANKHDFCBANK-2-400x300.png 400w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/BANKNIFTYICICIBANK-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1989511\" alt=\"BANKNIFTY~ICICIBANK-q-q-plot\" src=\"http:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/BANKNIFTYICICIBANK-2.png\" width=\"640\" height=\"480\" srcset=\"https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/BANKNIFTYICICIBANK-2.png 640w, https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/BANKNIFTYICICIBANK-2-300x225.png 300w, https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/BANKNIFTYICICIBANK-2-400x300.png 400w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/BANKNIFTYHDFCBANK-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1989521\" alt=\"BANKNIFTY~HDFCBANK-q-q-plot\" src=\"http:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/BANKNIFTYHDFCBANK-2.png\" width=\"640\" height=\"480\" srcset=\"https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/BANKNIFTYHDFCBANK-2.png 640w, https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/BANKNIFTYHDFCBANK-2-300x225.png 300w, https:\/\/portalvhds29z8xdrqhczq.blob.core.windows.net\/wordpress\/2014\/04\/BANKNIFTYHDFCBANK-2-400x300.png 400w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Index vs. Banks have a predominantly Gaussian distribution. HDFC vs. ICICI &#8211; not so much.<\/p>\n<h3>Pairs trading<\/h3>\n<p>With this knowledge in hand, can we trade pairs made out of these three? The rules for <a class=\"zem_slink\" title=\"Pairs trade\" href=\"http:\/\/en.wikipedia.org\/wiki\/Pairs_trade\" rel=\"wikipedia\">pairs trading<\/a> is fairly straightforward:<\/p>\n<ol>\n<li>find stocks that move together<\/li>\n<li>take a long\u2013short position when they diverge and unwind on convergence<\/li>\n<\/ol>\n<p>The execution of a pairs trading strategy involves answering these questions:<\/p>\n<ol>\n<li>How do you identify &#8220;stocks that move together?&#8221;<\/li>\n<li>Should they be in the same industry?<\/li>\n<li>How far should they have to diverge before you enter the trade?<\/li>\n<li>When is a position unwound?<\/li>\n<\/ol>\n<p>Bank Nifty, HDFC Bank and ICICI Bank certainly fit the criteria.<\/p>\n<h3>Co-integrated prices<\/h3>\n<p>If the long and short components fluctuate due to common factors, then the prices of the component portfolios would be co-integrated and the pairs trading strategy should work.<\/p>\n<p>If we have two non-stationary time series X and Y that become stationary when differenced (these are called integrated of order one series, or I(1) series) such that some linear combination of X and Y is stationary (aka, I(0)), then we say that X and Y are cointegrated. In other words, while neither X nor Y alone hovers around a constant value, some combination of them does, so we can think of cointegration as describing a particular kind of long-run equilibrium relationship.<\/p>\n<p>For a light introduction to co-integration, read this post on <a href=\"http:\/\/qr.ae\/rODnO\" target=\"_blank\">Quora<\/a>.<\/p>\n<p><em>To be continued&#8230;<\/em><\/p>\n<div class=\"zemanta-pixie\" style=\"margin-top: 10px;height: 15px\"><img decoding=\"async\" class=\"zemanta-pixie-img\" style=\"border: none;float: right\" alt=\"\" src=\"http:\/\/img.zemanta.com\/pixy.gif?x-id=560a1887-4a5c-4caf-b197-2acefe92d085\" \/><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We recently discussed linear regression by using it to inspect the relationship between two banking stocks. Lets try and extend that treatment to an index and its predominant constituents. Bank Nifty The Bank Nifty is composed of 12 bank stocks with ICICIBANK and HDFCBANK making up 29.27% and 28.26% of the index, respectively. Lets start &hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3471,9],"tags":[3371,2761],"class_list":["post-1989481","post","type-post","status-publish","format-standard","hentry","category-investing-insight","category-your-money","tag-pair-trading","tag-quant","entry"],"_links":{"self":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/1989481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/comments?post=1989481"}],"version-history":[{"count":0,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/1989481\/revisions"}],"wp:attachment":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media?parent=1989481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/categories?post=1989481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/tags?post=1989481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}