Skip to content
All library documents

Linear Regression Trend Bands with Directional Entries

Article Strategy library · Author: Zer3192

Summary

This strategy fits a linear regression to a configurable price series over a lookback window, then measures the root mean square residual from that fitted line. It uses the residual size multiplied by a deviation setting to form upper and lower bands. A trailing update to the bands and a trend state determine which band becomes the active reference line.

The system buys when price crosses above the active line and sells short when price crosses below it. Its parameters select the input price, lookback length, and deviation multiplier; the listed defaults are close, 200 bars, and 4. The source includes chart markers and alert conditions as well as strategy entries. Published backtest settings cover BTC/USDT Binance futures from May 2021 to May 2022, but no return, drawdown, or trade statistics are given. The document is code-focused and does not explain validation, costs, or risk controls, so the settings alone do not show whether the approach performs reliably. Regression-based bands can also be sensitive to the chosen window and deviation.

Key ideas

  • A rolling linear regression estimates the central trend from a selected price series.
  • The standard deviation-like residual measure scales upper and lower bands around the regression.
  • The active band trails according to price behavior and the strategy’s trend state.
  • Crossing above or below the active line triggers long or short entries.
  • Backtest settings are provided, but no performance or risk statistics are reported.

Tags

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