One of the commonly used technical indicators: Understanding the BOLL Bollinger Bands Indicator

What are Bollinger Bands indicator?

The Bollinger Bands indicator (Bollinger Bands) is one of the commonly used tools for stock market technical analysis. It was designed by American financial analyst John Bollinger in the 1980s based on the moving average and the standard deviation principle in statistics.

As shown in the figure above, the Bollinger Bands indicator consists of three trajectories: upper, middle and lower. The upper, middle and lower trajectories can be regarded as the pressure line, average line and support line of the stock price respectively. The stock price is in the upper and lower limits. The stock price fluctuates within the channel. The stock price channel will change with the size of the stock price fluctuation. Bollinger Bands generally take the 20th as a parameter.

Bollinger Bands Formula Explanation

Medium track = N-day moving average, N is generally 20

Upper track = middle track + X times the standard deviation, X is generally 2

Lower trajectory = middle trajectory - Y times the standard deviation, Y is generally 2

Bollinger Bands indicator calculation

  1. Using Bollinger Bands indicator in talib

import talib
 
upper, middle, lower = talib.BBANDS(close, timeperiod=20, nbdevup=2, nbdevdn=2, matype=0)
  • Return value: upper is the upper track, middle is the middle track, and lower is the lower track.

  • talib.BBANDS function parameters: close is the closing price, timeperiod is the calculation period, generally 20; nbdevup: the multiple of the standard deviation of the upper track price relative to the middle track, generally 2, the larger the value, the greater the upper limit, the channel The wider; nbdevdn: the multiple of the standard deviation of the lower track price relative to the middle track line, usually 2; matype: moving average type, 0 represents a simple moving average

  1. Using Bollinger Bands indicator in backtrader

import backtrader as bt

boll = bt.ind.BollingerBands(period=20, devfactor=2)

BollingerBands has a total of 3 parameters, period is the calculation period, usually 20; devfactor is the standard deviation multiple, usually 2; it movavis the moving average type, the default is simple moving average

Bollinger Bands Indicator Application

  • The Bollinger Bands can indicate the position of support and pressure. The upper and middle rails can put pressure on the stock price, while the middle and lower rails can support the stock market. The Bollinger Bands can indicate overbought. , Oversold: The stock price breaks out of the upper track and is likely to fall back, and the stock price falls below the lower track and is likely to rebound.

  • Bollinger Bands can indicate the trend. Strong stocks are always between the middle and upper rails, and weak stocks are always running below the middle rails. When the price line is above the middle track of the Bollinger Bands, it is mostly a long market, and you can hold shares or buy; when the price line is below the middle track of the Bollinger Bands, it is mostly a short market, so be careful when buying. , the two poles of Bollinger Bands are the upper track and the lower track, indicating extremely strong and extremely weak

  • The narrowing of the upper and lower rails of the Bollinger Band hides a sudden change, so don't rush to buy yet. When the K-line of the stock price breaks through the upper track of the Bollinger Band with volume upward, and at the same time the originally narrow Bollinger Band channel suddenly opens upward, it means that the stock price is about to enter a new rising channel, and buying should be the main option; once the stock price K-line When it breaks through the lower track of the Bollinger Band downwards, and at the same time the originally narrow Bollinger Bands channel suddenly opens downward, it means that the stock price is about to enter a new downward channel, and selling should be the main option.

  • When the K-line of the stock price breaks upward from below the middle line of the Bollinger Band, it indicates that the stock price is relatively strong and buying should be the main focus; when the K-line of the stock price rises from above the middle line of the Bollinger Band When it breaks through the Bollinger Band, it indicates that the stock price is very strong and the stock price may rise sharply in the short term. You should focus on holding shares to wait for the rise or short-term buying.

  • When the K-line of the stock price moves above the Bollinger Band for a period of time, if the K-line turns downward and breaks through the upper track of the Bollinger Band, it indicates that the short-term strong trend of the stock price may end, and stocks should be sold in a timely manner in the short-term, especially Those stocks with large short-term gains; when the stock price K-line breaks through the middle track of the Bollinger Band downwards, selling should be the main option

Conclusion & Communication

Follow the WeChat public account: Zhuge Shuo Talk for more content. At the same time, you can also get invitations to join investment exchange groups and quantitative investment seminar groups, where you can communicate and discuss with many investment enthusiasts, quantitative practitioners, and technology experts, and quickly improve your investment level.

Writing articles is not easy. If you think this article is helpful to you, please give it a like.

reference

Guess you like

Origin blog.csdn.net/richardzhutalk/article/details/125577396