Skip to content
All library documents

Regression Channels from Linear Trend Residuals

Article MQL5 code base

Summary

A linear regression channel is built around a fitted trend line. Its upper and lower borders run parallel to that line, with the distance set by the largest closing-price deviation from the regression line over the lookback window. The indicator can be displayed on any chart timeframe while calculating from a separately selected timeframe.

The document lists a 30-bar default lookback and a four-hour default calculation timeframe, alongside display choices for line style and color. It describes how the channel is constructed but does not specify trading rules, signal interpretation, or evidence from a backtest. In particular, the use of the largest close deviation sets channel width from an extreme observation, so the text provides no basis for treating a boundary touch as a statistically calibrated reversal or breakout signal. Its practical value depends on the chosen timeframe and lookback, neither of which is evaluated in the material.

Key ideas

  • The channel centers on a linear regression trend line fitted over a lookback window.
  • Its parallel borders are separated from the trend line by the maximum closing-price deviation in the window.
  • The calculation timeframe can differ from the chart timeframe where the indicator is displayed.
  • The document explains construction and settings but supplies no tested entry or exit rules.

Tags

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