All indicators

Linear Regression Trend Channel with Entries & Alerts

Apr 29, 2020

Static chart image
SignalsChannelsDashboard

The Linear Regression Trend Channel with Entries & Alerts indicator tool provides a dynamic visual framework for identifying trend direction and potential reversal zones using linear regression analysis.

Usage

The Usage section focuses on identifying mean reversion opportunities within a trending environment. The indicator plots a three-line channel consisting of a median regression line and two outer deviation bands.

  • Bullish Scenarios: When price approaches or touches the lower channel line (colored green), it indicates a potential oversold condition relative to the current trend, suggesting a Buy entry.
  • Bearish Scenarios: When price approaches or touches the upper channel line (colored red), it indicates a potential overbought condition, suggesting a Sell entry.
  • Information Panels: The script features on-chart labels that display the exact price levels for current and previous entry points based on the "Look back" setting, allowing for precise order placement.

Users should be aware that like other band-based indicators, prices can continue to ride the channel lines during strong trending periods.

Details

This script calculates a linear regression line over a user-defined period to determine the "fair value" or mean of price action. It then calculates the standard deviation from this line to create the upper and lower boundaries.

Unlike static channels, this implementation updates dynamically with each new bar. It includes a "Look back" feature for entry calculation, which compares current price action against historical channel levels to filter for specific crossover/crossunder events, reducing the impact of immediate repainting on signal generation.

Settings

Main Calculation

  • Period: Sets the number of bars used to calculate the linear regression and deviation (default is 40).
  • Deviation(s): Determines the width of the channel from the median line (default is 2.0).
  • Extend Method: Controls whether the channel lines extend to the right of the current bar or remain fixed to the calculation window.

Display & UI

  • Display info panels?: Toggles the visibility of the price labels on the chart.
  • Linear label offset: Adjusts the horizontal position of the information labels.
  • Linear label size: Changes the text size of the information labels.
  • Look back: Defines the historical reference point (in bars) used to calculate the "Previous" entry levels shown in the panels and used for alerts.

FAQ

How do I access Linear Regression Trend Channel with Entries & Alerts?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

What is the best timeframe for this indicator?

While it works on all timeframes, a common configuration is using a 40-period setting on a 5-minute timeframe for intraday trend following.

Do the alerts trigger on the current price or the bands?

Alerts can be configured for both channel touches (High/Low reaching the bands) and crossovers relative to the "Look back" price level for more confirmed entry signals.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.