## Bollinger Bands ® - indicator for MetaTrader 5

Allow the use of cookies to log in to the MQL5.com website.

Please enable the necessary setting in your browser, otherwise you will not be 什麼是布林通道(Bollinger Band) able to log in.

Bollinger Bands ® technical indicator (BB) is similar to Envelopes. The only difference is that the bands of Envelopes are plotted a fixed distance (%) away from the moving average, while the Bollinger Bands are plotted a certain number of standard deviations away from it. Standard deviation is a measure of volatility, therefore Bollinger Bands adjust themselves to the market conditions. When the markets become more volatile, the bands widen and they contract during less volatile periods.

Bollinger Bands are usually plotted on the price chart, but they can be also added to the indicator chart. Just like in case of the Envelopes, the interpretation of the Bollinger Bands is based on the fact that the prices tend to remain in between the top and the bottom line of the bands. A distinctive feature of the Bollinger Band indicator is 什麼是布林通道(Bollinger Band) its variable width due to the volatility of prices. In periods of considerable price changes (i.e. of high volatility) the bands widen leaving a lot of room to the prices to move in. During standstill 什麼是布林通道(Bollinger Band) periods, or the periods of low volatility the band contracts keeping the prices within their limits.

The following traits are particular to the Bollinger Band:

- abrupt changes in prices tend to happen after the band has contracted due to decrease of volatility;
- if prices break through the upper band, a continuation of the current trend is to be expected;
- if the pikes and hollows outside the band are followed by pikes and hollows inside the band, a reverse of trend may occur;
- the price movement that has started from one of the band’s lines usually reaches the opposite one.

The last observation is useful for forecasting price guideposts.

Bollinger Band indicator

**Calculation:**

Bollinger bands are formed by three lines. The middle line (ML) is a usual Moving Average.

ML = SUM (CLOSE, N) / N = SMA (CLOSE, N)

The top line (TL) is the same as the middle line a certain number of standard deviations (D).什麼是布林通道(Bollinger Band)

TL = ML + (D * StdDev)

The bottom line (BL) is the middle line shifted down by the same number of standard deviations.

BL = ML - (D * StdDev)

- SUM (. N) - sum over N periods;
- CLOSE - close price;
- N - number of periods used in calculation;
- SMA - Simple Moving Average;
- SQRT - square root;
- StdDev - standard deviation:

StdDev = SQRT (SUM ((CLOSE — SMA (CLOSE, N))^2, N)/N)

It is recommended to use 20-period Simple Moving Average as the middle line, and plot top and bottom lines two standard deviations away from it. Besides, 什麼是布林通道(Bollinger Band) moving averages of less than 10 periods are of little effect.

## 什麼是布林通道(Bollinger Band)

Bollinger Bands have become a widely used technical analysis tool because they work so well. On the simplest level they tell the analyst if prices are high or low on a relative basis, but that is just the beginning. I wrote "Bollinger on Bollinger Bands" to explain how I use Bollinger Bands, to tell which indicators I recommend for confirmation, and to present some trading ideas. Readers asked me for a way to implement these trading 什麼是布林通道(Bollinger Band) tools and techniques, and that was the birth of the Bollinger Band Tool Kit. If you have not read my book it is the most comprehensive coverage of how to use Bollinger Bands successfully.

NinjaTrader is a very powerful platform and integrating the Bollinger Band tools makes it that much more powerful. In my official Bollinger Band Took Kit you'll find Bollinger Bands and Envelopes along with the classic Bollinger Band indicators, %b and BandWidth. Next you'll discover the newest Bollinger Band indicators like BBImpulse, Accumulation and BBTrend.

The Bollinger Band Tool Kit features charts with Bollinger Bars, my unique charting style, and 什麼是布林通道(Bollinger Band) a broad array of indicators including many volume indicators. There is the option to receive alerts for signals generated from four trading approaches.

I think you will agree that the combination of NinjaTrader and the Bollinger Band Tools is a winner.

Good Trading!

John Bollinger

The Tool Kit contains:

Bollinger Bands 什麼是布林通道(Bollinger Band) 什麼是布林通道(Bollinger Band)

Bollinger Envelopes

Classic Bollinger Band indicators

New Bollinger Band Indicators

Bollinger Bar charts for easy price action visualization 什麼是布林通道(Bollinger Band)

Bollinger and Chandelier stops

Four Bollinger Band trading method alerts

For the complete list of contents click here

The Bollinger Band Tool Kit was created for NinjaTrader 7.

Bollinger Bands can be applied in all the financial markets including equities, forex, commodities, and futures and they can be used in most time frames from very short-term periods, to hourly, daily, weekly or monthly.

Trading is easy using your NinjaTrader Brokerage for futures and forex or your regular broker.

## Bollinger Band Trading Strategy

A Bollinger Band is a technical analysis tool defined by a set of trendlines plotted two standard deviations away from a simple moving average of a security’s price.

Bollinger Bands were developed and copyrighted by famous technical trader John Bollinger, designed to discover opportunities that give investors a higher probability of properly identifying when an asset is oversold or overbought.

Very well known in the trading community, Bollinger Bands contain all trading activity occurring between the two standard deviations of the expected norm, which is also known as the trend line.

Overall, Bollinger Bands make it easy for traders to buy low and sell high.

## Bollinger Bands Indicator

The Bollinger Band is an excellent indicator for measuring market volatility. The bands sum up the price movement of a stock and provide relatively high and low boundaries.

The Bollinger Band indicator is based on a moving average, which defines the ‘trend’ on the basis of the time frame that you choose to view.

### How to Calculate Bollinger Bands using Formula?

The Bollinger Band formula consists of the Upper and Lower band, which make use of the Moving Average (ma). Before we move on to the formula for the bands, we have to calculate the ma.

The formula for Moving Average is:

**Moving Average(ma)** = SimpleMovingAverage(close, period)

The Upper Bollinger Band is the sum of the Moving Average and the standard deviations. The formula is:

**Upper Band**= ma+ devfactor * StandardDeviation(data, 什麼是布林通道(Bollinger Band) **什麼是布林通道(Bollinger Band)** period)

The Lower Bollinger Band is the difference between the Moving Average and the standard deviations. The formula is:

**Lower band**= ma – devfactor * StandardDeviation(data, period)

## Why use Bollinger Bands Trading Strategy?

To measure market volatility, the standard deviation formula is used. It showcases how the stock price may vary from its original value.

Bollinger Bands measure this market volatility and then adjust themselves to the market conditions accordingly. This makes the Bollinger Bands Trading Strategy so handy for traders.

Through this trading strategy, traders can find most of the price data required between the two bands, ensuring the correct market entry and exit.

## How to use Bollinger Bands Trading Strategy?

There are three lines that compose Bollinger Bands: A simple moving average (middle band) and an upper and lower band.

The upper and lower bands are typically 2 standard deviations +/- from a 20-day simple moving average but can be modified.

Prices have a tendency to bounce within the bands’ envelope, touching one band then moving to the other band. You can use these swings to help identify potential profit targets. For example, if a price bounces off the lower band and then crosses above the moving average, the upper band then becomes the profit target.

Price can exceed or hug a band envelope for prolonged periods during strong trends. A strong trend continuation can be expected when the price moves out of the bands.

#### Bullish Scenario

- When the price touches the lower bands, it signifies that the 什麼是布林通道(Bollinger Band) price is oversold and has a tendency to bounce back.
- When n the prices stay above the upper band for some time, it signifies that the uptrend is extremely strong

#### Bearish Scenario

- When the price touches the upper bands, it signifies that the price is overbought and has a tendency to return back.什麼是布林通道(Bollinger Band)
- When the prices stay below the lower band for some time, it signifies that the downtrend is extremely strong.

## Building Bollinger Bands Strategy on Mudrex

You can create crypto strategies on Mudrex using simple ‘blocks’. You can connect multiple blocks and define conditions on those connections or ‘paths’ to create your strategy on Mudrex.

As discussed above, lets first write our entry/exit conditions so that we know what to do:

BUY: When the price goes below the lower band, it signifies that the price is oversold. When it starts recovering, 什麼是布林通道(Bollinger Band) then one should take a long position.

Buy when the price crosses up the lower band.

SELL: To close the long, wait for the price to go above the middle line, and then when the trend 什麼是布林通道(Bollinger Band) has exhausted, one should sell.

## Bollinger Bands Breakout Strategy

**Bollinger Bands Breakout Strategy** is the strategy version of **Bollinger Bands Filter** study version, which can be found under my scripts page. The strategy goes long when price closes above the upper band and goes short signal when price closes below the lower band.

Bollinger Bands is a classic indicator that uses a simple moving average of 20 periods, along with plots of upper and lower bands that are 2 standard deviations away from the basis line. These bands help visualize price volatility and trend based on where the price is, in relation to the bands.

The strategy doesn't take into account any other parameters such as Volume / RSI / Fundamentals etc, so user must use discretion based on confirmations from another indicator or based on fundamentals. The strategy results are based on purely long and short trades and doesn't take into account any user defined targets or stop losses.

The strategy works great when the price closes above/below upper/lower bands with continuation on next bar. It is definitely useful to have this strategy or the Bollinger Bands filter along with other indicators to get early glimpse of breach/fail of bands on candle close during BB squeeze or based on volatility .

This can be used on Heikin Ashi candles for spotting trends, but HA candles are not recommended for trade entries 什麼是布林通道(Bollinger Band) as they don't reflect true price of the asset.

The strategy settings default is 55 SMA and 1 standard deviation for Bollinger Bands filter, but these can be changed from settings.

It is definitely worth reading the 22 rules of Bollinger Bands written by John Bollinger if interested in trading Bollinger Bands successfully.