tartigradia

Generalized Bollinger Bands %B And Bandwidth (Tartigradia)

tartigradia Cập nhật   
Bollinger Band is simply a representation of the rolling average of price and its standard deviation around the average (called the "basis").
This indicator generalizes the Bollinger Band by implementing many different equations to calculate the Bollinger Bands beyond the standard deviation and sma, and then plot the %B (where the current price falls inside the Bollinger Band), Bandwidth (size of the Bollinger Band) as well as the Bollinger Band itself and a reproduction of the OHLC price candles in a separate pane.

Whereas other Bollinger Bands indicators often just change the basis but not the stdev calculation, the correct way to change the basis is to also change it inside the stdev calculation.

Advanced features such as temporal discounting (ie, newer bars can have more weights), median absolute deviation and multiple sigma bands (eg, 3-sigma) are available.
Up to 3 different Bollinger Bands can be displayed, and the background can be highlighted when price is overbought/oversold (beyond the Bollinger Band of choice). Tip: BB3, which is the bollinger band with standard deviation of 3, which represents 99% of observed values in the lookback period, is a good choice to highlight overbought/oversold conditions.
Three "Sentiment Bars" are provided to see at a glance the sentiments on the price action relative to the Bollinger Bands as reflected by the %B value.

Usage:
  • Use the %B as a measure of sentiment: bullish if > 0.5, bearish if < 0.5. You can use the Sentiment Bars at the bottom for a quick reference: aqua if bullish, red if bearish, gray if undefined (too close to the middle line).
  • Use the bandwidth as a measure of volatility: higher is more volatile, lower is less.
  • When overbought, it can be a good time to sell/short. Use a higher Bollinger Band Multiplier such as 3 or more to reduce false positives.
  • When oversold, it can be a good time to buy/long. Use a higher Bollinger Band Multiplier such as 3 or more to reduce false positives.
  • Consider setting a much tighter lookback period of 4 as recommended in backtested works (en.wikipedia.org/wik...ising_moving_average), use zlma instead of sma, and finally set a higher timeframe for the Bollinger Bands than the one you are currently studying. Then, the Bollinger Bands can help in detecting overbought and oversold regions (price going "out of bands").

Note that I tried to automate the setting of a higher timeframe, but for some reason the output is different when I manually do it using request.security() than when it's in indicator(timeframe=""). If someone has any suggestion as to why it happens, please let me know! (You can try it for yourself by uncommenting the auto_timeframe parameter line).
Phát hành các Ghi chú:
Update:
- Documentation of an internal function. No new feature in this release.
Phát hành các Ghi chú:
Update:
* Changed default bollinger band deviation for background highlight from 3-sigma down to 2-sigma. New instructions:

The background is highlighted when the current value is outside of the specified bollinger band, to the upside or downside. When selecting BB2 (2-sigma Bollinger Band, which includes 95% of the price deviations), the background highlight seems to correlate with price action momentum, and when the background disappears, the momentum appears to be exhausted. One strategy can be to enter a position when the background highlight disappears. This appears to work in all timeframes: from weekly down to 4h.
Phát hành các Ghi chú:
Update:
* Clarify background highlight tooltip.
Phát hành các Ghi chú:
Update:
* Minor comment update.
Phát hành các Ghi chú:
* Remove dead code that caused failure with composite tickers (and for a feature that was not even implemented!).
Phát hành các Ghi chú:
* Comment out more dead code
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?