Dynamic Linear Regression Channels Reset After Price Breakouts
Summary
This indicator fits a linear regression line to the bars since the latest channel reset and draws upper and lower bands at configurable standard-deviation distances. When price closes beyond a band, the script finalizes the preceding channel and begins a new regression segment, so channel length varies with the time between breaks. The resulting lines can help visualize trend direction, potential support and resistance, and possible mean-reversion areas.
The source calculates the regression slope and intercept, residual dispersion, and channel boundaries, then updates the active drawing as new bars arrive. It gives no backtest, trade rules, or quantitative evidence that channel touches or breaks predict returns. The author notes that large deviation settings may prevent a break for too long, eventually exceeding the script’s supported historical-bar references; use also depends on how the plotted channel is interpreted.
Key ideas
- A least-squares line is fitted over the interval since the most recent channel break.
- Upper and lower boundaries are set at configurable multiples of residual standard deviation.
- A close beyond either boundary ends the current segment and starts a new dynamic-length channel.
- The channels can be used to inspect trends, support and resistance, or mean-reversion setups.
- Large deviation settings may delay resets until the script exceeds its historical-bar limits.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.