OPEN-SOURCE SCRIPT

Volume Weighted Bollinger Bands

119
This indicator provides a customizable version of Bollinger Bands, enhanced with optional volume weighting and a method for decomposing market volatility.

Key Features:

Volatility Decomposition: The indicator's primary feature is its ability to separate total volatility, controlled by the 'Estimate Bar Statistics' option.

Standard Mode (Estimate Bar Statistics = OFF): The indicator functions as a customizable Bollinger Band. It calculates the standard deviation of the user-selected Source and plots a single set of bands.

Decomposition Mode (Estimate Bar Statistics = ON): The indicator uses a statistical model ('Estimator') to calculate within-bar volatility. (Assumption: In this mode, the Source input is ignored, and an estimated mean for each bar is used instead). This mode displays two sets of bands:

Inner Bands: Show only the contribution of the 'between-bar' volatility.

Outer Bands: Show the total volatility (the sum of between-bar and within-bar components).

Customizable Construction: The indicator is a hybrid:

Basis Line: The central line is calculated using a selectable Moving Average type (e.g., EMA, SMA, WMA).

Volume Weighting: An option (Volume weighted) allows for volume to be incorporated into the calculation of both the basis MA and the volatility decomposition.

Logarithmic Scaling: An optional 'Normalize' mode calculates the bands on a logarithmic scale. This results in bands that maintain a constant percentage distance from the basis, suitable for analyzing exponential markets.

Multi-Timeframe (MTF) Engine: The indicator includes an MTF conversion block. When a Higher Timeframe (HTF) is selected, advanced options become available: Fill Gaps handles data gaps, and Wait for timeframe to close prevents repainting by ensuring the indicator only updates when the HTF bar closes.

Integrated Alerts: Includes a full set of built-in alerts for the source price crossing over or under the central MA line and the outermost calculated volatility band.

DISCLAIMER

For Informational/Educational Use Only: This indicator is provided for informational and educational purposes only. It does not constitute financial, investment, or trading advice, nor is it a recommendation to buy or sell any asset.

Use at Your Own Risk: All trading decisions you make based on the information or signals generated by this indicator are made solely at your own risk.

No Guarantee of Performance: Past performance is not an indicator of future results. The author makes no guarantee regarding the accuracy of the signals or future profitability.

No Liability: The author shall not be held liable for any financial losses or damages incurred directly or indirectly from the use of this indicator.

Signals Are Not Recommendations: The alerts and visual signals (e.g., crossovers) generated by this tool are not direct recommendations to buy or sell. They are technical observations for your own analysis and consideration.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.