Skip to content
All library documents

Building a Linear Regression Channel with Fibonacci Levels

Article ProRealCode

Summary

This ProRealTime indicator fits a linear regression line to closing prices over a configurable lookback window. It calculates the regression coefficients from sums of the time index and price, then draws the line across the window. A channel width is selected using either standard deviation or standard error, multiplied by a configurable deviation factor.

The indicator overlays fractional levels of that width above and below the regression line, including 0.236, 0.382, 0.5, and 0.618, with outer channel boundaries at one full width. The article presents these bands as a way to visualize trend, volatility, and possible support or resistance areas. It provides code and conceptual rationale, but no market examples, backtest, or evidence that the levels predict reversals. The lookback and channel settings are user choices, and the indicator’s usefulness will depend on instrument, timeframe, and testing.

Key ideas

  • The indicator estimates a linear regression from closing prices over a chosen lookback window.
  • Channel width uses either standard deviation or standard error, scaled by a deviation multiplier.
  • Fibonacci fractions of the channel width are drawn above and below the regression line.
  • The displayed bands are proposed as trend and possible support or resistance references.
  • No trading performance evidence or validation of reversal signals is provided.

Tags

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