Linear Regression [Anchored, Band, Signals]

Mar 10, 2026

Static chart image
Support and Resistance
Signals
Channels
Volatility

The Linear Regression [Anchored, Band, Signals] indicator is a comprehensive statistical analysis tool that plots dynamic regression channels and deviation bands to help traders visualize price distribution and momentum quality. It offers a flexible framework for identifying support and resistance levels through least-squares calculations, supporting both rolling windows and anchored timeframes.

Usage

This tool is used to identify mathematical price extremes and momentum shifts. By analyzing where price sits relative to the regression mean, users can identify potential mean-reversion zones or trend breakouts.

Key Usage Examples:

  • Mean Reversion: When price stretches to the outer deviation bands, it indicates a statistical extreme. Traders often look for price to return to the central orange regression line.
  • Breakout Identification: A price break outside the primary deviation boundaries, especially when accompanied by a high slope angle (Theta), signals a significant momentum shift.
  • Market Filtering: Use the Pearson’s R (correlation) value to avoid choppy markets. A high R-value suggests a strong linear trend, while a low value indicates a sideways or non-linear market.
  • Historical Auditing: Enable "Band (Historical Plots)" to see the non-repainting historical state of the bands, allowing for an honest backtest of how price interacted with the levels in real-time.

Details

The indicator utilizes the least-squares method to determine the line of best fit for price data over a specified lookback. Unlike standard regression channels that only show the current state (and thus "repaint" their historical lines), this script includes a historical plotting feature that locks in the values at each bar.

It calculates several advanced metrics:

  • Pearson’s R: Measures the strength of the linear relationship between time and price.
  • Theta (θ): Represents the slope of the channel in degrees.
  • Dynamic Deviations: Calculates standard deviation and historical absolute highest/lowest limits relative to the mean.

Settings

Main Inputs

  • Period: The lookback length for the calculation.
  • Length Unit: Choose between "Bar" (fixed rolling window) or specific Time Frames (anchored window that resets daily, weekly, etc.).
  • Source: The price data point used for calculation (default is Close).
  • Scale: Choose between Linear or Logarithmic to match your chart's scale settings.

Levels & Display

  • Regression Line: Toggles the central mean line.
  • Upper/Lower/Custom: Standard deviation band toggles and multiplier settings.
  • Highest/Lowest: Toggles bands based on the historical maximum/minimum price deviations.
  • Band (Historical Plots): Enables non-repainting historical visualization of the channel levels.
  • Labels: Toggles for Pearson’s R, Theta angle, and Daily Percentage change metrics.

Signals

  • Channel Strategy: Select from five different logic modes including Break-Out and Mean Reversion strategies.
  • Filters: Thresholds for Theta angle and Pearson's R to gate entry signals based on trend strength and slope.

FAQ

How do I interpret the Theta (θ) angle? The Theta angle represents the slope of the trend. A positive angle indicates an uptrend, while a negative angle indicates a downtrend. Using the Theta filter helps ensure you only take signals when the trend has a minimum required steepness.

What is the benefit of the "Highest & Lowest" bands? While standard deviation bands are based on volatility, the Highest and Lowest bands track the actual historical maximum excursions of price from the regression line within the lookback period, providing "hard" mathematical boundaries.

How can I access the Linear Regression [Anchored, Band, Signals] indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.