DrCryptoLandy

Bollinger Band PW Package

DrCryptoLandy Mis à jour   
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.
Notes de version:
-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%
Notes de version:
-Updated table position to the top right per user request

Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?