All indicators

macd linear

Sep 9, 2019

Static chart image
SignalsOscillatorsMoving Averages

The macd linear indicator combines classical Moving Average Convergence Divergence (MACD) analysis with linear regression bands to identify potential "sweet spots" and trend reversals in price momentum.

Usage

The Usage section focuses on how to interpret the interaction between the MACD lines and the linear regression bands. Users can switch between standard MACD and a Zero Lag (ZL) version depending on their preference for responsiveness versus noise reduction.

  • Trend Identification: When the MACD line is above the Signal line, the indicator colors turn green, suggesting bullish momentum. Conversely, red coloring indicates bearish momentum.
  • Linear Bands: The script calculates a central linear regression curve and two outer deviation bands based on the MACD signal.
  • Signals:
    • A "buy" signal (green cross) is generated when the MACD line crosses above the lower linear regression band.
    • A "sell" signal (red cross) is generated when the MACD line crosses below the upper linear regression band.
  • Multi-Timeframe Analysis: The tool allows users to pull data from a higher timeframe to filter signals or view broader trend momentum on a lower timeframe chart.

Details

The indicator calculates MACD using either standard Exponential Moving Averages (EMA) or Zero Lag techniques. The Zero Lag version utilizes Double EMAs (DEMA) to reduce the inherent delay found in standard calculations.

The linear regression component performs a least-squares fit over a specified lookback period to determine the slope and intercept of the MACD signal. Standard deviation bands are then projected around this regression line, creating dynamic overbought/oversold zones relative to the MACD's own historical movement rather than price itself.

Settings

  • Use Current Chart Resolution?: Toggles between using the current chart timeframe or a custom one.
  • Use Different Timeframe?: Specifies the timeframe for calculation if the above box is unchecked.
  • MACD or MACD ZERO LAG: Selects the calculation method for the MACD components.
  • Presets: Quick-select common MACD parameters (12 26 9, 20 50 50, etc.).
  • Period: The lookback length used for the linear regression calculation.
  • Deviation(s): The multiplier for the standard deviation bands around the linear regression curve.

FAQ

How do I interpret the buy/sell crosses?

The crosses appear when the MACD line exits the extreme ranges defined by the linear regression bands, suggesting a mean-reversion or a shift in momentum.

Can I change the responsiveness of the bands?

Yes, by adjusting the "Period" for the regression length or the "Deviation(s)" for the width of the bands in the settings menu.

How do I access macd linear?

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.