All indicators

LinReg-MACD Alerts

Oct 6, 2022

Static chart image
SignalsOscillatorsMoving Averages

The LinReg-MACD Alerts indicator provides trend-based buy and sell signals by combining linear regression price data with MACD histogram crossovers and LSMA slope filters. It is designed to filter out market noise and identify high-probability trend reversals on various timeframes, particularly the 1-hour chart.

Usage

The tool generates visual labels on the chart to indicate potential entry points based on a confluence of conditions.

  • Buy Signals: Occur when the MACD histogram crosses above zero, the linear regression candle structure turns bullish, and (if enabled) the LSMA slope is positive.
  • Sell Signals: Occur when the MACD histogram crosses below zero, the linear regression candle structure turns bearish, and (if enabled) the LSMA slope is negative.

Users can toggle the linear regression calculations to switch between standard candle logic and smoothed regression logic. The multi-candle conditions allow users to determine how many consecutive trend-aligned candles are required before a signal is confirmed.

Details

The script functions by transforming standard OHLC data into linear regression values. This smoothing process helps identify the underlying trend direction more clearly than standard price action.

To ensure signal quality, the script utilizes:

  1. MACD Histogram: Acts as the primary momentum trigger, requiring a zero-line crossover to initiate a signal.
  2. Linear Regression Candles: Filters signals based on the relationship between open and close regression values.
  3. LSMA Filter: An optional Least Squares Moving Average slope check that ensures trades are only taken in the direction of the broader trend.

Settings

Core Settings

  • Signal Smoothing: Adjusts the period used for the signal line calculation (SMA or EMA).
  • Simple MA (Signal Line): When enabled, uses a Simple Moving Average for the signal line; otherwise, an Exponential Moving Average is used.
  • Lin Reg: Toggles whether the indicator uses Linear Regression values for price data.
  • Linear Regression Length: Sets the lookback period for the linear regression calculation.

Signal Conditions

  • Condition for the 2nd candle: Requires two consecutive bullish/bearish candles to validate a signal.
  • Condition for 3rd candle: Requires three consecutive bullish/bearish candles to validate a signal.

LSMA Filter

  • LSMA Source: The price source used for the LSMA calculation (default is Close).
  • Use LSMA filter: Enables or disables the requirement for the LSMA slope to match the signal direction.
  • LSMA Length: The lookback period for the LSMA slope filter.

FAQ

How do I use the LinReg-MACD Alerts signals?

You can use the "Buy" and "Sell" labels as potential entry points when they align with your broader market analysis. Many traders find the signals most effective on higher timeframes like the 1H chart.

What is the purpose of the Linear Regression toggle?

The Linear Regression toggle smooths the price data used for the signal logic. When on, it helps filter out minor price fluctuations that might cause false signals in a choppy market.

How do I access LinReg-MACD Alerts?

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

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.