DrCryptoLandy

Bollinger Band PW Package

DrCryptoLandy 已更新   
This script creates a Bollinger Band Package with Bollinger Band Percent and Width displayed on chart. The indicator also prints signals when price closes above or below the Bollinger Bands using shapes (circles by default). Bollinger Bands were created by John Bollinger, and consist of three lines plotted on a chart: the basis line (typically a moving average, 20 sma by default), an upper line (equal to the basis plus a certain number of standard deviations of the price, 2), and a lower line (equal to the basis minus the same number of standard deviations, 2 by default).

The script calculates the Bollinger Bands for a given input parameters by taking the length of the moving average and the number of standard deviations to use for the upper and lower bands. It then calculates the Bollinger Bands using these input parameters.

The script defines two functions: get_bb_percent() and get_bb_width(). The get_bb_percent() function calculates the percentage distance between the closing price and the lower band, as a percentage of the total distance between the upper and lower bands. This value is commonly referred to as the "Bollinger Band Percent". The get_bb_width() function calculates the percentage distance between the upper and lower bands, as a percentage of the basis line. This value is commonly referred to as the "Bollinger Band Width".

The script creates a table at the middle right of the chart, where the Bollinger Band Percent and Width values are displayed. The table is designed with two rows, one for the Bollinger Band Percent value and the other for the Bollinger Band Width value.

The script plots the three Bollinger Bands lines on the chart. The basis line is plotted in blue, the upper band line in red, and the lower band line in green.

The script then plots the shapes that signify closures above and below the bands using plotshape. The shapes and colors are customizable in the settings menu.

This indicator is designed to have all three components and a visual aid to assist Bollinger Band technical analysis in one script which can be helpful in determining potential trading opportunities. We thank John Bollinger for his contribution to technical analysis and trading.

Please give feedback and modify to your liking.
發布通知:
-Updated the table showing the BB% and BB Width with a frame, border, and background colors to make the table visible on charts with light backgrounds
-Updated the BB% table cell background to display green when % is above 50% and red when below 50%
發布通知:
-Updated table position to the top right per user request

開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?