OPEN-SOURCE SCRIPT

Volume Weighted LR Standard Deviation

197
This indicator analyzes market character by decomposing total volatility into three distinct, interpretable components based on a Linear Regression model.

Key Features:

Three-Component Volatility Decomposition: The indicator separates volatility based on the 'Estimate Bar Statistics' option.

Standard Mode (Estimate Bar Statistics = OFF): Calculates volatility based on the selected Source (dies führt hauptsächlich zu 'Trend'- und 'Residual'-Volatilität).

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 separates volatility into:

Trend Volatility (Green/Red): Volatility explained by the regression's slope (Momentum).

Residual Volatility (Yellow): Volatility from price oscillating around the regression line (Mean-Reversion).

Within-Bar Volatility (Blue): Volatility from the high-low range of each bar (Noise/Choppiness).

Dual Display Modes: The indicator offers two modes to visualize this decomposition:

Absolute Mode: Displays the total standard deviation as a stacked area chart, partitioned by the variance ratio of the three components.

Normalized Mode: Displays the direct variance ratio (proportion) of each component relative to the total (0-1), ideal for identifying the dominant market character.

Calculation Options:

Normalization: An optional 'Normalize Volatility' setting calculates an Exponential Regression Curve (log-space), making the analysis suitable for growth assets.

Volume Weighting: An option (Volume weighted) applies volume weighting to all regression and volatility calculations.

Multi-Component Pivot Detection: Includes a pivot detector that identifies significant turning points (highs and lows) in both the Total Volatility and the Trend Volatility Ratio. (Note: These pivots are only plotted when 'Plot Mode' is set to 'Absolute').

Note on Confirmation (Lag): Pivot signals are confirmed using a lookback method. A pivot is only plotted after the Pivot Right Bars input has passed, which introduces an inherent lag.

Multi-Timeframe (MTF) Capability:

MTF Volatility Lines: The volatility lines can be calculated on a higher timeframe, with standard options to handle gaps (Fill Gaps) and prevent repainting (Wait for...).

Limitation: The Pivot detection (Calculate Pivots) is disabled if a Higher Timeframe (HTF) is selected.

Integrated Alerts: Includes 9 comprehensive alerts for:

Volatility character changes (e.g., 'Character Change from Noise to Trend').

Dominant character emerging (e.g., 'Bullish Trend Character Emerging').

Total Volatility pivot (High/Low) detection.

Trend Volatility pivot (High/Low) detection.

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.

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

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