OPEN-SOURCE SCRIPT
Volume Weighted Linear Regression Channel

This indicator plots a dynamic channel around a Linear Regression trendline. It provides a framework for identifying the prevailing trend and assessing price extremes based on volatility.
Key Features:
Linear Regression Baseline: The channel's centerline is a (Volume-Weighted) Linear Regression line. This line represents the 'best fit' for the recent price action, serving as a responsive baseline for the trend.
Volatility Decomposition: The indicator's primary feature is its ability to decompose volatility, controlled by the 'Estimate Bar Statistics' option.
Standard Mode (Estimate Bar Statistics = OFF): Calculates a standard linear regression channel. The bands represent the standard deviation of the residuals (the error) between the Source price and the regression line.
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 for the regression). This mode displays two sets of bands:
Inner Bands: Show only the contribution of the 'residual' (trend noise) volatility, calculated proportionally.
Outer Bands: Show the total volatility (the sum of residual and within-bar components).
Volume Weighting: An option (Volume weighted) allows for volume to be incorporated into the calculation of both the linear regression and the volatility decomposition, giving more influence to high-participation bars.
Trend Projection: The calculated channel is plotted as a projection, which can be extended forward (Extend Forward) and backward (Extend Backward) in time to provide a visual guide for potential support and resistance.
Integrated Alerts: Includes a full set of built-in alerts for the Source price crossing over or under the calculated upper band, lower band, and the central regression line.
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.
Key Features:
Linear Regression Baseline: The channel's centerline is a (Volume-Weighted) Linear Regression line. This line represents the 'best fit' for the recent price action, serving as a responsive baseline for the trend.
Volatility Decomposition: The indicator's primary feature is its ability to decompose volatility, controlled by the 'Estimate Bar Statistics' option.
Standard Mode (Estimate Bar Statistics = OFF): Calculates a standard linear regression channel. The bands represent the standard deviation of the residuals (the error) between the Source price and the regression line.
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 for the regression). This mode displays two sets of bands:
Inner Bands: Show only the contribution of the 'residual' (trend noise) volatility, calculated proportionally.
Outer Bands: Show the total volatility (the sum of residual and within-bar components).
Volume Weighting: An option (Volume weighted) allows for volume to be incorporated into the calculation of both the linear regression and the volatility decomposition, giving more influence to high-participation bars.
Trend Projection: The calculated channel is plotted as a projection, which can be extended forward (Extend Forward) and backward (Extend Backward) in time to provide a visual guide for potential support and resistance.
Integrated Alerts: Includes a full set of built-in alerts for the Source price crossing over or under the calculated upper band, lower band, and the central regression line.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.