Skip to content
All library documents

Periodic Linear Regression Channels for Trend and Support Analysis

Article TradingView scripts

Summary

The indicator fits linear regressions over a user-selected anchor period and plots the estimated price trend. Its rolling mode updates the regression with new observations and displays the fitted value as a changing line; its static mode extends a regression fit through the active period. The anchor can reset on each selected interval or accumulate from the first available bar. Optional upper and lower bands are based on the regression error, scaled by a user-set multiple, and can help visualize potential channel boundaries.

The indicator colors the line according to slope or correlation-based gradient, and includes a small display of the chosen anchor timeframe. The accompanying explanation presents the lines as possible trend, support, resistance, or range references, rather than a complete trading system. It cautions that the static fit can repaint as data arrives, while early calculations require enough observations to form a regression. The document describes the method and implementation but supplies no tests of predictive performance.

Key ideas

  • Regression fits are calculated over a selected interval that can reset periodically or accumulate from the first bar.
  • Rolling mode updates the line as new data arrives, while static mode adjusts a fit across the active anchor period.
  • Optional channel boundaries use a scaled root mean squared regression error.
  • Slope and correlation-based colors provide a visual indication of trend direction and fit relationship.
  • The static display can repaint, and the indicator is presented as an analytical aid rather than a tested trading strategy.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.