{"id":1927221,"date":"2014-02-25T12:56:07","date_gmt":"2014-02-25T07:26:07","guid":{"rendered":"http:\/\/stockviz.biz\/index.php\/?p=1927221"},"modified":"2014-02-25T12:56:07","modified_gmt":"2014-02-25T07:26:07","slug":"simple-bollinger-band-trading-model","status":"publish","type":"post","link":"https:\/\/stockviz.biz\/index.php\/2014\/02\/25\/simple-bollinger-band-trading-model\/","title":{"rendered":"A Simple Bollinger Band Trading Model"},"content":{"rendered":"<p>Bollinger Bands have quickly become one of the most commonly used tools in technical analysis. <a title=\"introduction to Bollinger Bands\" href=\"http:\/\/stockviz.biz\/index.php\/2012\/07\/27\/bollinger-bands\/\" target=\"_blank\">Bollinger Bands<\/a> consist of three bands &#8211; an upper, middle and lower band &#8211; that are used to spotlight extreme short-term prices in a security. The upper band represents overbought territory, while the lower band can show you when a security is oversold. Most technicians will use Bollinger Bands in conjunction with other analysis tools.<\/p>\n<p>A simple BBand strategy is buying stocks that break the lower Bollinger Band. It is expected that the price of the stock will revert back above the lower band and head toward the middle band.<\/p>\n<p>You can build you own Bollinger Band based strategy that scans all the <a title=\"Nifty 50\" href=\"http:\/\/stockviz.biz\/Indices?TICKER=NIFTY\" target=\"_blank\">Nifty 50<\/a> stocks for a potential break using the <a title=\"Technical Analysis API\" href=\"https:\/\/www.mashape.com\/drona\/stockviz#!endpoint-Equity-Technicals\" target=\"_blank\">StockViz Technical API<\/a> in a few lines of code.<\/p>\n<pre><small># get the index constituents and loop through them\r\nconstituents = common.getConstituents(\"CNX NIFTY\") \r\n\r\nfor cc in cleanConsts:\r\n     ticker = cc[\"SYMBOL\"]\r\n     # get the latest technicals\r\n     techs = common.getTechnicals(ticker) \r\n     t = techs[len(techs)-1]\r\n     # get the latest price\r\n     price = common.getLivePrice(ticker)\r\n\r\n     #make the decision\r\n     if t[\"BB_DN\"] &gt; price:\r\n\t\t#there was a breakdown\r\n\r\n\t\tprint \"Buy:\", ticker\r\n\t\tcommon.placeTrade(ticker, 1, \"buy\")<\/small><\/pre>\n<p>You can read the whole code on <a title=\"sample code for Bollinger Band trading strategy\" href=\"https:\/\/github.com\/shyams80\/StockViz\/tree\/master\/equity\/04-bollinger-bands-trading\" target=\"_blank\">GitHub<\/a><\/p>\n<p>Source: <a href=\"http:\/\/www.investopedia.com\/articles\/trading\/07\/bollinger.asp\" target=\"_blank\">investopedia<\/a><\/p>\n<h6>Related<\/h6>\n<ul>\n<li><a title=\"hack your own news reading app\" href=\"http:\/\/stockviz.biz\/index.php\/2014\/02\/18\/news-reading-sentiment-analysis-app\/\" target=\"_blank\">Build your own News Reading and Sentiment Analysis App<\/a><\/li>\n<li><a title=\"Permalink to Building a Cross-Over Trading System\" href=\"http:\/\/stockviz.biz\/index.php\/2014\/02\/19\/building-cross-trading-system\/\" target=\"_blank\">Building a Cross-Over Trading System<\/a><\/li>\n<li><a title=\"technical trading model\" href=\"http:\/\/stockviz.biz\/index.php\/2014\/02\/20\/stochastic-macd-model-trading-nifty-stocks\/\" target=\"_blank\">A Stochastic-MACD Model for Trading Nifty Stocks<\/a><\/li>\n<li><a title=\"calculate PE using your own methodology for all indices\" href=\"http:\/\/stockviz.biz\/index.php\/2014\/02\/20\/calculate-pes-indices\/\" target=\"_blank\">Calculate PEs for all Indices<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Bollinger Bands have quickly become one of the most commonly used tools in technical analysis. Bollinger Bands consist of three bands &#8211; an upper, middle and lower band &#8211; that are used to spotlight extreme short-term prices in a security. The upper band represents overbought territory, while the lower band can show you when a &hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3131,9],"tags":[3161],"class_list":["post-1927221","post","type-post","status-publish","format-standard","hentry","category-api","category-your-money","tag-api-technical","entry"],"_links":{"self":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/1927221","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=1927221"}],"version-history":[{"count":0,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/1927221\/revisions"}],"wp:attachment":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media?parent=1927221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/categories?post=1927221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/tags?post=1927221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}