{"id":2091263,"date":"2018-11-05T14:39:37","date_gmt":"2018-11-05T09:09:37","guid":{"rendered":"http:\/\/stockviz.biz\/index.php\/?p=2091263"},"modified":"2018-11-06T11:01:06","modified_gmt":"2018-11-06T05:31:06","slug":"usdinr-and-dollar-indices-part-ii","status":"publish","type":"post","link":"https:\/\/stockviz.biz\/index.php\/2018\/11\/05\/usdinr-and-dollar-indices-part-ii\/","title":{"rendered":"USDINR and Dollar Indices, Part II"},"content":{"rendered":"<p><small><em>Please read <a href=\"http:\/\/stockviz.biz\/index.php\/2018\/11\/02\/usdinr-and-dollar-indices-part-i\/\">Part I<\/a> for the introduction.<\/em><\/small><\/p>\n<p>In Part I, we saw that if we force the intercept to be zero during linear regression between two series A and B, we end up with <strong>A = \u03b2B<\/strong>. In this post, we go one step further and define <strong>spread = A &#8211; \u03b2B<\/strong><\/p>\n<h3>Pair trading<\/h3>\n<p>Readers of our posts on <a href=\"https:\/\/stockviz.biz\/pair-trading\/\" rel=\"noopener\" target=\"_blank\">pair trading<\/a> will immediately recognize the above relationships. The idea here is that if we assume USDINR to be dependent on DTWEXB, DTWEXM and DTWEXO indices, then we:<\/p>\n<ol>\n<li>calculate the spread between USDINR and each of the indices in turn,<\/li>\n<li>check if the spread is &#8216;stable&#8217; by conducting an adf test on the residuals of the linear fit and checking if the p-value is less than a threshold,<\/li>\n<li>if the p-values confirm stability, then we can go long\/short the spread whenever it deviates from the mean.<\/li>\n<\/ol>\n<h3>Spreads<\/h3>\n<p>When we plot the spreads and p-values, we see that a 50-day period is probably the most suitable time-frame over which to calculate the spread. And, we also observe considerable mean-reversion suggesting that a trading model can be built over it.<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/usdinr%20beta\/part-2\/DEXINUS.DTWEXO.index.spread.50.2005-03-11.2018-10-25.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/usdinr%20beta\/part-2\/DEXINUS.DTWEXO.index.spread.50.2005-03-11.2018-10-25.png\" width=\"3600\" height=\"1800\" alt=\"spread between USDINR.DTWEXO\" class=\"alignnone size-full\" \/><\/a><br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/usdinr%20beta\/part-2\/DEXINUS.DTWEXM.index.spread.50.2005-03-11.2018-10-25.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/usdinr%20beta\/part-2\/DEXINUS.DTWEXM.index.spread.50.2005-03-11.2018-10-25.png\" width=\"3600\" height=\"1800\" alt=\"spread between USDINR.DTWEXM\" class=\"alignnone size-full\" \/><\/a><br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/usdinr%20beta\/part-2\/DEXINUS.DTWEXB.index.spread.50.2005-03-11.2018-10-25.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/usdinr%20beta\/part-2\/DEXINUS.DTWEXB.index.spread.50.2005-03-11.2018-10-25.png\" width=\"3600\" height=\"1800\" alt=\"spread between USDINR.DTWEXB\" class=\"alignnone size-full\" \/><\/a><\/p>\n<p>In <a href=\"http:\/\/stockviz.biz\/index.php\/2018\/11\/06\/usdinr-and-dollar-indices-part-iii\/\">Part III<\/a>, we will back-test a couple of trading models based on these spreads.<\/p>\n<p>Code and charts are on <a href=\"https:\/\/github.com\/stockviz\/blog\/tree\/master\/usdinr%20beta\/part-2\" rel=\"noopener\" target=\"_blank\">github<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Please read Part I for the introduction. In Part I, we saw that if we force the intercept to be zero during linear regression between two series A and B, we end up with A = \u03b2B. In this post, we go one step further and define spread = A &#8211; \u03b2B Pair trading Readers &hellip; <\/p>\n","protected":false},"author":2,"featured_media":2091073,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3471],"tags":[2761,2721],"class_list":["post-2091263","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-investing-insight","tag-quant","tag-usdinr","entry"],"_links":{"self":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2091263","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=2091263"}],"version-history":[{"count":0,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2091263\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media\/2091073"}],"wp:attachment":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media?parent=2091263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/categories?post=2091263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/tags?post=2091263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}