OPEN-SOURCE SCRIPT
Обновлено

Volume Weighted Bollinger Bands

1 122
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.
Информация о релизе
2026-01-31 0.2.0
(Mod) Updated libraries LibTmFr, LibWght, LibMvAv, and LibBrSt to version 2.
(Mod) Renamed inputs (e.g., bbMA -> maType) and updated Estimator enum for library compatibility.
(Mod) Refactored logic to calculate volatility using variances for mathematical accuracy.
(Add) Enabled log-space statistics in LibBrSt for correct log-normal distribution handling.
(Add) Added runtime error check for non-positive prices when using 'Normalize' (Log-Mode).
(Ref) Refactored stable array initialization in the multi-timeframe conversion logic.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.