All indicators

MACD+ Strategy

Aug 24, 2020

Static chart image
SignalsOscillatorsDivergencesMoving AveragesTrailing-StopVolatility

The MACD+ Strategy indicator is a comprehensive trend-following trading tool that enhances the standard MACD oscillator with multi-layered trend filters, dynamic exit mechanisms, and divergence detection. It aims to provide a robust framework for capturing momentum while minimizing false signals across various asset classes like crypto, forex, and stocks.

Usage

The strategy can be used by identifying MACD crossovers that are validated by the selected trend filters. For example, a user may choose to only enter a long position when the MACD crosses above its signal line AND the price is above a specific Moving Average.

Examples of usage include:

  • Trend Filtering: Selecting "ADX" to ensure trades are only taken during high-momentum periods or "Moving Average" to align trades with the long-term price direction.
  • Dynamic Exits: Using the ATR Trailing Stop to protect capital by adjusting the stop loss level as the price moves in a favorable direction.
  • Divergence Analysis: Identifying regular and hidden divergences to spot potential trend reversals or continuations before they are fully reflected in price action.

Details

The strategy builds upon the classic MACD (Moving Average Convergence Divergence) logic. Instead of relying solely on zero-line or signal-line crossovers, it introduces a modular filtering system:

  • Trend Filters: Users can toggle between ADX, Moving Averages, and Parabolic SAR to act as a confluence requirement for trade entry.
  • Exit Logic: The tool incorporates sophisticated exit logic including ATR-based trailing stops and take-profit targets, as well as timed exits based on bar counts (with optional profitability conditions).
  • Divergence: The script calculates and highlights divergences between the MACD and price, providing additional context for trade entries.

Settings

MACD Parameters

  • Fast Length: The period for the shorter EMA used in MACD calculation.
  • Slow Length: The period for the longer EMA used in MACD calculation.
  • MACD Length: The period for the signal line EMA.

Filters

  • Trend Filters: Selection menu to choose between ADX, MA, SAR, or a combination of all three.
  • TF MA Type: Defines the type of Moving Average (Simple or Exponential) used for filtering.
  • TF MA Period: The lookback period for the filter Moving Average.

Exit & Risk Management

  • Stop Loss Type: Choose between ATR-based trailing stops or Parabolic SAR trailing stops.
  • ATR Trailing Stop Multiplier: The multiplier used to calculate the distance of the ATR stop loss.
  • Take Profit Type: Selection for ATR-based targets or a fixed percentage.
  • ATR Take Profit Multiplier: The multiplier used to calculate the ATR-based profit target.

Strategy Execution

  • Trade Direction: Restricts the strategy to Long, Short, or Both.
  • Timed Exit: Enables exiting a trade after a set number of bars, with conditions for profitable or losing positions.
  • Backtest Date Range: Set the start and end dates for historical performance analysis.

FAQ

How do I access the MACD+ Strategy?

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

Which timeframe works best for this strategy?

While developed for the Daily timeframe, it is effective on the 15-minute timeframe or higher, particularly when used with Heikin Ashi candles to smooth out price noise.

Can I use the filters independently?

Yes, the settings allow you to choose specific filters like the ADX or MA, or you can use the "All" setting to require all conditions to be met simultaneously for higher conviction 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.