{"id":15440,"date":"2023-03-21T05:02:13","date_gmt":"2023-03-20T21:02:13","guid":{"rendered":"https:\/\/www.tejwin.com\/?post_type=insight&#038;p=15440"},"modified":"2026-02-03T17:07:22","modified_gmt":"2026-02-03T09:07:22","slug":"bollinger-bands-trading-strategy","status":"publish","type":"insight","link":"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/","title":{"rendered":"Bollinger Bands Trading Strategy"},"content":{"rendered":"\n<figure class=\"wp-block-image aligncenter\" id=\"b576\"><img decoding=\"async\" src=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/0-6kbhWI37NKFWhqp.jpg\" alt=\"\"\/><figcaption class=\"wp-element-caption\">Photo by <a class=\"markup--anchor markup--figure-anchor\" href=\"https:\/\/unsplash.com\/@nampoh?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"photo-creator noopener\" data-href=\"https:\/\/unsplash.com\/@nampoh?utm_source=medium&amp;utm_medium=referral\" data->Maxim Hopman<\/a> on&nbsp;<a class=\"markup--anchor markup--figure-anchor\" href=\"https:\/\/unsplash.com?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"photo-source noopener\" data-href=\"https:\/\/unsplash.com?utm_source=medium&amp;utm_medium=referral\" data->Unsplash<\/a><\/figcaption><\/figure>\n\n\n\n<p id=\"b946\">&nbsp;<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a10c5424d320\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a10c5424d320\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Highlights\" >Highlights<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Difficulties%EF%BC%9A%E2%98%85%E2%98%86%E2%98%86%E2%98%86%E2%98%86\" >Difficulties\uff1a\u2605\u2606\u2606\u2606\u2606<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Preface\" >Preface<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Strategy\" >Strategy:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#The_Editing_Environment_and_Module_Required\" >The Editing Environment and Module Required<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Database\" >Database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Data_Import\" >Data Import<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Trading_Strategy\" >Trading Strategy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Transaction_Record\" >Transaction Record<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Performance_Evaluation\" >Performance Evaluation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Source_Code\" >Source Code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/bollinger-bands-trading-strategy\/#Related_Link\" >Related Link<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"8011\"><span class=\"ez-toc-section\" id=\"Highlights\"><\/span>Highlights<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"bd5e\"><span class=\"ez-toc-section\" id=\"Difficulties%EF%BC%9A%E2%98%85%E2%98%86%E2%98%86%E2%98%86%E2%98%86\"><\/span>Difficulties\uff1a\u2605\u2606\u2606\u2606\u2606<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"365a\">Using the Moving Average and standard deviation to construct a Bollinger Band, determine when to buy and sell.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"c10a\"><span class=\"ez-toc-section\" id=\"Preface\"><\/span>Preface<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"e085\">Bollinger Band is a technical indicator that John Bollinger invents in the 1980s. Bollinger Bands consist of the concepts of statistics and moving averages. The moving Average(MA) is the average closing price of a past period. Normally the period of MA in Bollinger Band is 20 days, and Standard Deviation(SD) is usually represented by \u03c3 in mathematical sign, which is used to evaluate the data\u2019s degree of discrete<em>.<\/em><\/p>\n\n\n\n<p id=\"b19e\">Bollinger Band is composed of three tracks:<br><strong>\u25cf The upper track\uff1a20 MA\uff0bdouble standard deviation<br>\u25cf The middle track\uff1a20 MA<br>\u25cf The lower track\uff1a20 MA\uff0bdouble standard deviation<\/strong><\/p>\n\n\n\n<p id=\"5802\">During the long-term observation period, the investment target price distribution will be Normal Distribution. According to statistics, there is a 95% of probability that the price will present between \u03bc \u2212 2\u03c3 and \u03bc + 2\u03c3, which is also called a 95% Confidence Interval(CI). Bollinger Band is the technical indicator base on the theories above.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"7984\"><span class=\"ez-toc-section\" id=\"Strategy\"><\/span>Strategy:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"d215\">When the closed price touches the upper track, we consider it a signal of price fall, and then we will sell our holding position at tomorrow\u2019s open price.<\/p>\n\n\n\n<p id=\"487f\">When the closed price touch the lower track, we consider it to be a signal of price rise, and then we\u2019re going to buy 1 unit at tomorrow\u2019s opened price; when the conditions above are already satisfied, we remain adequate principal, both the holding position and the closed price are lower than last time buying price, we will buy one more unit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"99e3\"><span class=\"ez-toc-section\" id=\"The_Editing_Environment_and_Module_Required\"><\/span>The Editing Environment and Module Required<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"9d53\">This article uses Mac OS as a system and jupyter as an editor.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"87df\"><span class=\"ez-toc-section\" id=\"Database\"><\/span>Database<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Listed company adjusted price(day)-average price(TWN\/AAPRCDA)<\/li>\n\n\n\n<li>Unadjusted(day) technical indicators(TWN\/AVIEW1)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"334c\"><span class=\"ez-toc-section\" id=\"Data_Import\"><\/span>Data Import<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"088b\">For the period from 2021\u201306\u201301 to 2022\u201312\u201331, we take <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">AUO Corporation(2409) <\/mark><\/strong>as an example, we will use unadjusted closed price\u3001BB-Upper(20)\u3001BB-Lower(20) to construct the Bollinger Band, and then we will compare the return with Market Return Index(Y9997)<\/p>\n\n\n\n<p id=\"2900\">After acquiring the investment target price and technical indicator data, let\u2019s draw the Bollinger Band first. Here we use Plotly. express to draw the line chart. In the diagram, bbu20 will be the upper track \u3001bbl20 will be the lower track, and close_d will be the closed price.<\/p>\n\n\n\n<figure id=\"a7ce\" class=\"graf graf--figure graf-after--pre\">\n<\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter caption-align-center graf-image\"><img decoding=\"async\" src=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/1Rc7vsaq3kxptP946PcwNhQ-4.png\" alt=\"\u53cb\u9054\u5149\u96fb(2049) 2021\u201306\u201301~2022\u201312\u201331 \u5e03\u6797\u901a\u9053\"\/><figcaption class=\"wp-element-caption\">Bollinger Band of AUO Corporation(2049). Date: 2021\u201306\u201301~2022\u201312\u201331<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"c738\"><span class=\"ez-toc-section\" id=\"Trading_Strategy\"><\/span>Trading Strategy<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"abd1\">We define some parameters here.<br>\u25cf principal\uff1a the total amount of funds invested by investors. In this study, we invest 500000 dollars.<br>\u25cf position\uff1a the number of units investors held.<br>\u25cf cash\uff1a the amount of funds investors held after each trade.<br>\u25cf order_unit\uff1a each trade\u2019s amount of share unit<\/p>\n\n\n\n<p>Next, we start building our trading strategy based on these parameter, such as position, cashm and order_unit. We set our principal amount and decide the timing of market entry and exit conditions. <\/p>\n\n\n\n<pre id=\"9958\" class=\"wp-block-preformatted\"><span class=\"pre--content\">principal = <span class=\"hljs-number\">500000<\/span><br>cash = principal<br>position = <span class=\"hljs-number\">0<\/span><br>order_unit = <span class=\"hljs-number\">0<\/span><br>trade_book = pd.DataFrame()<br><br><span class=\"hljs-keyword\">for<\/span> i <span class=\"hljs-keyword\">in<\/span> <span class=\"hljs-built_in\">range<\/span>(data.shape[<span class=\"hljs-number\">0<\/span>] -<span class=\"hljs-number\">2<\/span>):<br>    <br>    cu_time = data.index[i]<br>    cu_close = data.loc[cu_time, <span class=\"hljs-string\">'close_d'<\/span>]<br>    cu_bbl, cu_bbu = data.loc[cu_time, <span class=\"hljs-string\">'bbl20'<\/span>], data.loc[cu_time, <span class=\"hljs-string\">'bbu20'<\/span>]<br>    n_time = data.index[i + <span class=\"hljs-number\">1<\/span>]<br>    n_open = data[<span class=\"hljs-string\">'open_d'<\/span>][i + <span class=\"hljs-number\">1<\/span>]<br>    <br>    <br>    <span class=\"hljs-keyword\">if<\/span> position == <span class=\"hljs-number\">0<\/span>: <span class=\"hljs-comment\">#entry condition<\/span><br>        <span class=\"hljs-keyword\">if<\/span> cu_close &lt;= cu_bbl <span class=\"hljs-keyword\">and<\/span> cash &gt;= n_open*<span class=\"hljs-number\">1000<\/span>: <br>            position += <span class=\"hljs-number\">1<\/span><br>            order_time = n_time<br>            order_price = n_open<br>            order_unit = <span class=\"hljs-number\">1<\/span><br>            friction_cost = (<span class=\"hljs-number\">20<\/span> <span class=\"hljs-keyword\">if<\/span> order_price*<span class=\"hljs-number\">1000<\/span>*<span class=\"hljs-number\">0.001425<\/span> &lt; <span class=\"hljs-number\">20<\/span> <span class=\"hljs-keyword\">else<\/span> order_price*<span class=\"hljs-number\">1000<\/span>*<span class=\"hljs-number\">0.001425<\/span>)<br>            total_cost = -<span class=\"hljs-number\">1<\/span> * order_price * <span class=\"hljs-number\">1000<\/span> - friction_cost<br>            cash += total_cost<br>            trade_book = trade_book.append(<br>                pd.Series(<br>                [<br>                    stock_id, <span class=\"hljs-string\">'Buy'<\/span>, order_time, <span class=\"hljs-number\">0<\/span>, total_cost, order_unit, position, cash<br>                ]), ignore_index = <span class=\"hljs-literal\">True<\/span>)<br>            <br>    <span class=\"hljs-keyword\">elif<\/span> position &gt; <span class=\"hljs-number\">0<\/span>:<br>        <span class=\"hljs-keyword\">if<\/span> cu_close &gt;= cu_bbu: <span class=\"hljs-comment\"># exit condition<\/span><br>            order_unit = position<br>            position = <span class=\"hljs-number\">0<\/span><br>            cover_time = n_time<br>            cover_price = n_open<br>            friction_cost = (<span class=\"hljs-number\">20<\/span> <span class=\"hljs-keyword\">if<\/span> cover_price*order_unit*<span class=\"hljs-number\">1000<\/span>*<span class=\"hljs-number\">0.001425<\/span> &lt; <span class=\"hljs-number\">20<\/span> <span class=\"hljs-keyword\">else<\/span> cover_price*order_unit*<span class=\"hljs-number\">1000<\/span>*<span class=\"hljs-number\">0.001425<\/span>) + cover_price*order_unit*<span class=\"hljs-number\">1000<\/span>*<span class=\"hljs-number\">0.003<\/span><br>            total_cost = cover_price*order_unit*<span class=\"hljs-number\">1000<\/span>-friction_cost<br>            cash += total_cost<br>            trade_book = trade_book.append(pd.Series([<br>                stock_id, <span class=\"hljs-string\">'Sell'<\/span>, <span class=\"hljs-number\">0<\/span>, cover_time, total_cost, -<span class=\"hljs-number\">1<\/span>*order_unit, position, cash<br>            ]), ignore_index=<span class=\"hljs-literal\">True<\/span>)<br>                <br>trade_book.columns = [<span class=\"hljs-string\">'Coid'<\/span>, <span class=\"hljs-string\">'BuyOrSell'<\/span>, <span class=\"hljs-string\">'BuyTime'<\/span>, <span class=\"hljs-string\">'SellTime'<\/span>, <span class=\"hljs-string\">'CashFlow'<\/span>,<span class=\"hljs-string\">'TradeUnit'<\/span>, <span class=\"hljs-string\">'HoldingPosition'<\/span>, <span class=\"hljs-string\">'CashValue'<\/span>]<\/span><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"fa6a\"><span class=\"ez-toc-section\" id=\"Transaction_Record\"><\/span>Transaction Record<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"cd04\">Let\u2019s review our transaction record after executing above trading strategy code. You can find the source code about how to make this transaction record table at the bottom of the article.<\/p>\n\n\n\n<figure id=\"85cb\" class=\"graf graf--figure graf-after--p\">\n<\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter caption-align-center graf-image\"><img decoding=\"async\" src=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/1FCyH2OZvi766xrvZyzHiAA-4.png\" alt=\"\u90e8\u5206\u4ea4\u6613\u7d00\u9304(2021\/07\/15~2022~03\/15)\"\/><figcaption class=\"wp-element-caption\">Part of Transaction Record(2021\/07\/15~2022~03\/15)<\/figcaption><\/figure>\n\n\n\n<p id=\"b4bc\">By observing the following graph, we can find out that there is a rising trend from 2021\/11 to 2021\/12(the light blue area) because<span style=\"text-decoration: underline;\" class=\"ek-underline\"> the closed price can\u2019t touch the lower track of the Bollinger band; no action of buying. The result is that we can not earn any profit from this upward trend.<\/span><\/p>\n\n\n\n<p id=\"2b10\">The same issue also appears in the continuous falling downward trend, like the interval starting from 2022\/04(light green area), repeatedly touching the lower track of the Bollinger band and then back up slightly. <span style=\"text-decoration: underline;\" class=\"ek-underline\">Because the upper track of the Bollinger band is too low, which means easy to touch, the holding position will be sold sooner, leading to a negative return in this interval.<\/span><\/p>\n\n\n\n<p id=\"52d0\">In fact, because of the hysteresis of the 20MA Bollinger band, a short-term fluctuation in price can not be reflected by the 20MA Bollinger band.<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">We suggest shortening the term of the MA or use with other technical indicators which observe the trend of the investment target if the target stock you are analyzing has a higher rate of fluctuation.<\/mark><\/p>\n\n\n\n<figure id=\"7a47\" class=\"graf graf--figure graf-after--p\">\n<\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter caption-align-center graf-image\"><img decoding=\"async\" src=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/1AmnVV-WZNk8LEeqjmuTTug-4.png\" alt=\"\u8cb7\u8ce3\u9ede\u793a\u610f\u5716\"\/><figcaption class=\"wp-element-caption\">The points of transactions<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"9b85\"><span class=\"ez-toc-section\" id=\"Performance_Evaluation\"><\/span>Performance Evaluation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Then, we can examine the performance of these trading strategies and calculate the returns of the market, average transactions, trading gains and losses, etc.<\/p>\n\n\n\n<p>There have been only 29 transactions in one and a half years. The way to increase the number of transactions is to improve the strategy by following the suggestions we mentioned before.<\/p>\n\n\n\n<figure id=\"baad\" class=\"graf graf--figure graf-after--p\">\n<\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter caption-align-center graf-image\"><img decoding=\"async\" src=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/1YKKTz3ewCgyleTkaZejRBg-3.png\" alt=\"\u8207\u5927\u76e4\u7e3e\u6548\u8207\u5e02\u5834\u5927\u76e4\u6bd4\u8f03\"\/><figcaption class=\"wp-element-caption\">Compare with the market<\/figcaption><\/figure>\n\n\n\n<p>Furthermore, we visualize the performance and accumulated returns of these trading strategies&nbsp;to better compare&nbsp;the distinct between the&nbsp;\u201cbuy and hold\u201d strategy, trading strategy, and market index.&nbsp;<\/p>\n\n\n\n<figure id=\"bce8\" class=\"graf graf--figure graf-after--pre\">\n<\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter caption-align-center graf-image\"><img decoding=\"async\" src=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/1OXW4-M391i7TFL6Ytpg0zw-3.png\" alt=\"2409\u7d2f\u7a4d\u5831\u916c\u5716\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"5454\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"f93b\">From the second half of 2021 to the end of 2022, the trend of AUO Corporation(2409) is going down. If taking the \u201cbuy and hold\u201d strategy,<br>Eventually, the accumulated return will be terrible, about -40% to -50%.<br>On the other hand, if we choose the Bollinger band strategy, the performance will be better than \u201cbuy and hold.\u201d Besides, although AUO Corporation\u2019s (2409) price trend is worse than the market average price trend during the observation period, the return performance of the Bollinger band strategy beats the Market.<\/p>\n\n\n\n<p id=\"e8a9\">However, this is the simplest Bollinger band strategy. We can find out that during the price recovery interval, which is just after the vast falling period, we will face the predicament of selling stock too early; Further, during the upward trend, there is prone to encounter the other predicament of seldom buying.<\/p>\n\n\n\n<p id=\"72c3\">In light of the above predicaments, combining the strategy with other price-trend-detecting indicators is recommended for a considerable fluctuation investment target to optimize the strategy.<\/p>\n\n\n\n<p id=\"f082\">Last but not least, please note that \u201c<strong>Stocks this article mentions are just for the discussion, please do not consider it to be any recommendations or suggestions for investment or products.\u201d<\/strong>&nbsp;Hence, if you are interested in issues like Creating Trading Strategy , Performance Backtesting , Evidence-based research , welcome to purchase the plans offered in&nbsp;<a href=\"https:\/\/eshop.tej.com.tw\/E-Shop\/index\" rel=\"noreferrer noopener\" target=\"_blank\">TEJ E Shop<\/a>&nbsp;and use the well-complete database to create your own optimal trading strategy.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-100 is-style-fill\"><a class=\"wp-block-button__link has-background has-custom-font-size wp-element-button\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/databank-solution\/market-data\/\" style=\"border-radius:13px;background:linear-gradient(135deg,rgb(240,215,106) 0%,rgb(75,209,200) 50%,rgb(76,132,205) 100%);font-size:23px\"><strong>Optimize your investment workflow with TEJ Back-testing Platform.<br>Explore Comprehensive Databank Today!<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<div style=\"height:16px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"7765\"><span class=\"ez-toc-section\" id=\"Source_Code\"><\/span>Source Code<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/gist.github.com\/tej87681088\/ec1ef990a9bd0ff6c13e210c887f0255#file-tejapi_medium_bollingerband-ipynb\" class=\"ek-link\" target=\"_blank\" rel=\"noopener\">Github<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"fe39\"><span class=\"ez-toc-section\" id=\"Related_Link\"><\/span>Related Link<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"64bf\">\u25cf <a href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/\" class=\"ek-link\">TEJ Website<\/a><br>\u25cf <a href=\"https:\/\/eshop.tej.com.tw\/E-Shop\/Edata_intro\" class=\"ek-link\" target=\"_blank\" rel=\"noopener\">LinkedIn<\/a><\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Highlights Difficulties\uff1a\u2605\u2606\u2606\u2606\u2606 Using the Moving Average and standard deviation to construct a Bollinger Band, determine when to buy and sell. Preface Bollinger Band is a technical indicator that John Bollinger invents in the 1980s. Bollinger Bands consist of the concepts of statistics and moving averages. The moving Average(MA) is the average closing price of [&hellip;]<\/p>\n","protected":false},"featured_media":6019,"template":"","tags":[3063,2962],"insight-category":[690,50],"class_list":["post-15440","insight","type-insight","status-publish","has-post-thumbnail","hentry","tag-backtesting-2","tag-market-data","insight-category-data-analysis","insight-category-fintech"],"acf":[],"_links":{"self":[{"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/insight\/15440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/insight"}],"about":[{"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/types\/insight"}],"version-history":[{"count":4,"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/insight\/15440\/revisions"}],"predecessor-version":[{"id":43567,"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/insight\/15440\/revisions\/43567"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/media\/6019"}],"wp:attachment":[{"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/media?parent=15440"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/tags?post=15440"},{"taxonomy":"insight-category","embeddable":true,"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/insight-category?post=15440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}