Heikin-Ashi MACD
Mar 19, 2021

The Heikin-Ashi MACD indicator combines the trend-smoothing capabilities of Heikin-Ashi price data with the momentum-tracking of the MACD oscillator to filter out market noise and identify high-probability trend reversals. By calculating MACD components based on Heikin-Ashi "average bars" rather than standard candle closes, this tool aims to eliminate a significant portion of false signals and provide a clearer view of trend persistence.
Usage
The Heikin-Ashi MACD is used to identify trend direction and momentum shifts while reducing the whipsaws common in standard MACD applications. Traders typically look for the crossover of the MACD line and the signal line, or the histogram crossing the zero line, to determine entry and exit points.
- Bullish Signal: Occurs when the histogram (delta) crosses above zero, suggesting a shift toward upward momentum.
- Bearish Signal: Occurs when the histogram (delta) crosses below zero, suggesting a shift toward downward momentum.
- Trend Filtering: Because Heikin-Ashi candles smooth out minor price fluctuations, the resulting MACD stays in a trend longer, helping traders avoid premature exits during minor pullbacks.
Details
This tool calculates internal Heikin-Ashi values (Open, High, Low, Close) to serve as the source for the MACD calculation. Specifically, it utilizes Double Exponential Moving Averages (DEMA) for the fast and slow lines to further reduce lag while maintaining smoothness. The resulting "delta" (the difference between the MACD line and the signal line) is plotted as a histogram to visualize the strength of the trend. The script also includes built-in strategy logic for backtesting, incorporating percentage-based target profits and stop losses.
Settings
Strategy Parameters
- Target Profit %: Sets the desired profit percentage for the strategy exit.
- Stop Loss %: Sets the maximum loss percentage allowed before the strategy exits a position.
MACD Configuration
- MACD Fast Line Length: The lookback period for the fast DEMA component.
- MACD Slow Line Length: The lookback period for the slow DEMA component.
- Signal Line Length: The smoothing period for the signal line.
Date Range
- Year/Month/Day From/Until: These settings define the specific time window during which the strategy will execute trades on the chart.
FAQ
How do I use the Heikin-Ashi MACD?
You can use it to identify trend reversals and momentum shifts by watching for histogram zero-crosses and signal line crossovers, which are smoothed by the Heikin-Ashi calculation.
How does this differ from a standard MACD?
Standard MACD uses raw close prices, which can be volatile; this version uses Heikin-Ashi values and DEMA smoothing to eliminate approximately 75% of noise-induced signals.
How can I access this script?
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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.