{"id":2094053,"date":"2018-12-04T12:12:44","date_gmt":"2018-12-04T06:42:44","guid":{"rendered":"http:\/\/stockviz.biz\/index.php\/?p=2094053"},"modified":"2018-12-04T12:12:44","modified_gmt":"2018-12-04T06:42:44","slug":"sp-500-sma-regimes","status":"publish","type":"post","link":"https:\/\/stockviz.biz\/index.php\/2018\/12\/04\/sp-500-sma-regimes\/","title":{"rendered":"S&amp;P 500 SMA Regimes"},"content":{"rendered":"<p>In the post <a href=\"https:\/\/stockviz.biz\/2018\/12\/04\/mixture-model-over-sp-500-returns\/\">Mixture model over S&amp;P 500 returns<\/a>, we looked at how mixture models can be used to classify returns as belonging to &#8220;bull&#8221; or &#8220;bear&#8221; regimes. Unfortunately, we found that using it to trade the index itself was a losing proposition. This lead us to ask ourselves whether a mixture model was any better than a simple moving average based classifier.<\/p>\n<h3>Daily returns<\/h3>\n<p>If we split returns that occur over different moving averages (50-, 100-, 200-days) and plot their densities, we can see how losses are more frequent when the index is trading below some moving average:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/technical\/sma\/sp500.sma.regime.density.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/technical\/sma\/sp500.sma.regime.density.png\" width=\"3600\" height=\"1800\" alt=\"S&amp;P 500 simple moving average returns density plot\" class=\"alignnone size-full\" \/><\/a><\/p>\n<p>Avoiding being long the index when it is trading below a moving average seems to be a good idea. And a quick back-test shows the 200-day average is the one to watch:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/technical\/sma\/sp500.long-only.SMA.regime.cumulative.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/technical\/sma\/sp500.long-only.SMA.regime.cumulative.png\" width=\"1400\" height=\"800\" alt=\"S&amp;P 500 long-only SMA returns\" class=\"alignnone size-full\" \/><\/a><\/p>\n<p>All the moving-average &#8220;systems&#8221; above out-performed the mixture-model based system.<\/p>\n<h3>Take-away<\/h3>\n<p>Simple beats complex, most of the time.<\/p>\n<p>Code and charts are on <a href=\"https:\/\/github.com\/stockviz\/blog\/tree\/master\/technical\/sma\" rel=\"noopener\" target=\"_blank\">github<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the post Mixture model over S&amp;P 500 returns, we looked at how mixture models can be used to classify returns as belonging to &#8220;bull&#8221; or &#8220;bear&#8221; regimes. Unfortunately, we found that using it to trade the index itself was a losing proposition. This lead us to ask ourselves whether a mixture model was any &hellip; <\/p>\n","protected":false},"author":2,"featured_media":2057031,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3471],"tags":[2761,253],"class_list":["post-2094053","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-investing-insight","tag-quant","tag-technical","entry"],"_links":{"self":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2094053","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=2094053"}],"version-history":[{"count":0,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2094053\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media\/2057031"}],"wp:attachment":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media?parent=2094053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/categories?post=2094053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/tags?post=2094053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}