Log-space MACD
Sep 15, 2017

The Log-space MACD indicator provides a modified approach to the classic Moving Average Convergence Divergence by performing calculations in logarithmic space to better analyze long-term price trends and volatility. By applying log transformations, the script aims to provide a more proportional perspective on price movements, especially useful for assets with significant price growth over time.
Usage
The Usage of the Log-space MACD is similar to the traditional MACD but optimized for long-term trend analysis. Traders can use it to identify momentum shifts and potential trend reversals.
- Histogram Analysis: The histogram represents the difference between the Log MACD line and the signal line. Increasing bars suggest strengthening momentum, while decreasing bars suggest weakening momentum.
- Crossovers: Bullish signals occur when the Log MACD line crosses above the signal line, while bearish signals occur when it crosses below.
- Zero-Line Crosses: Crosses over the zero line can indicate a shift in the primary trend direction.
- Buy/Sell Signals: The script includes optional visual markers for buy and sell signals based on crossovers occurring relative to the midpoint, filtered by the rate of change in the moving average.
Details
This script utilizes several advanced signal processing techniques to enhance the standard MACD formula:
- Logarithmic Scaling: The source price is converted to log-space before calculations. This ensures that a 10% move at $100$ is treated with the same weight as a 10% move at $1000$.
- Ehlers SuperSmoother: The script applies John Ehlers' SuperSmoother filter to the raw MACD difference. This reduction in noise helps provide a smoother signal line without introducing excessive lag.
- Extra Log Compression: An optional setting allows for further log-clipping of the resulting signal, which can help normalize extreme outliers in momentum.
Settings
Main Settings
- Fast Length: The period for the fast exponential moving average (default is 12).
- Slow Length: The period for the slow exponential moving average (default is 26).
- MA Length: The period for the Simple Moving Average (SMA) applied to the signal line (default is 9).
- Signal Smoothing: The smoothing factor for the Ehlers SuperSmoother filter.
- Buy/Sell Signals: Toggles the visibility of plot markers for specific entry/exit conditions.
- Extra Log Compression: Enables an additional logarithmic transformation on the MACD signal to compress volatility.
- Source: The price data used for calculation (e.g., Close, HL2).
FAQ
How do I use the Log-space MACD for long-term charts?
Because it calculates differences in log-space, this tool is ideal for weekly or monthly charts where price appreciation has been exponential. It helps maintain a consistent visual scale for momentum.
What is the advantage of Ehlers Smoothing in this script?
Ehlers SuperSmoother is designed to remove aliasing noise and high-frequency interference more effectively than a standard EMA, resulting in cleaner crossovers.
How can I access this indicator?
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.