All indicators

Linear Regression Channel Screener

Nov 25, 2024

Static chart image
SignalsChannelsDashboard

The Linear Regression Channel Screener indicator provides real-time trend detection and multi-asset monitoring by tracking price action relative to statistical regression channels. It allows traders to monitor up to 40 different symbols simultaneously to identify bullish or bearish momentum across an entire watchlist.

Usage

The Usage section describes how the script can be used to monitor market sentiment across multiple instruments. The tool displays a dashboard in the top-right corner of the chart, showing the current trend status and price position relative to the middle regression line for each selected symbol.

  • Trend Detection: Use the "Trend" column to identify whether an asset is in a bullish (positive slope) or bearish (negative slope) state.
  • Price Positioning: The "Price VS Middle" column indicates if the current price is trading above or below the mean regression line, which serves as a benchmark for momentum.
  • Visual Analysis: On the main chart, the indicator plots the Linear Regression Channel for the current asset, consisting of a median line and upper/lower deviation boundaries.
  • Alerts: Configure alerts for channel breakouts, trend reversals, or median line crossings to stay informed of market shifts without manual monitoring.

Details

The script utilizes a linear regression algorithm to calculate the best-fit line for a given set of price data points over a specific length. This calculation determines the intercept and slope, which are then used to project the channel boundaries based on standard deviation.

The screener functionality is powered by request.security(), allowing the script to fetch data for external symbols defined in the settings. This enables the transformation of a standard single-asset indicator into a comprehensive scanning tool. The trend status is determined by the sign of the regression slope: a positive slope indicates a bullish trend, while a negative slope indicates a bearish trend.

Settings

Symbols

  • Symbol 1 - 10: Define the ticker symbols you wish to monitor in the screener table.

Logic & Calculation

  • Source: The price data used for calculations (e.g., Close, HL2).
  • Length: The number of bars used to calculate the linear regression.
  • Deviation: The multiplier for the standard deviation to determine the width of the upper and lower channel lines.
  • Extend Lines: Determines whether the channel lines extend indefinitely to the right of the current bar.

Visuals

  • Up/Down Trend Colors: Customize the colors used for bullish and bearish indications in both the table and the chart lines.

FAQ

How do I access the Linear Regression Channel Screener? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

How many assets can I monitor at once? While the default inputs provide 10 slots, the underlying logic supports up to 40 assets, which is the maximum limit for security calls within a single Pine Script indicator.

What does it mean when the price is "Above" or "Below" the middle? "Above" suggests the price is trading in the upper half of the regression channel, often indicating stronger bullish momentum within the current trend, while "Below" suggests it is in the lower half.

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.