MACD VPT lag issue
Oct 2, 2019

The MACD VPT lag issue tool utilizes a Volume Price Trend (VPT) derived source instead of standard price data to reduce the inherent lag found in traditional MACD calculations. By incorporating volume-based data into the oscillator, the script provides a more responsive signal that aims to anticipate price shifts faster than standard close-based indicators.
Usage
The MACD VPT lag issue indicator is used to identify trend changes and momentum shifts with reduced delay. Traders can observe the crossovers between the MACD line and the Signal line to determine potential entry and exit points.
Because volume-based indicators can sometimes be more volatile or "overshoot," the script includes a smoothing parameter. Users should adjust the VPT Smoothing Length to find a balance between responsiveness and signal clarity based on the specific asset or timeframe being traded.
Details
Traditional indicators often use the "Close" price as their primary source, which can result in a lag of one or more candles. This script addresses this by substituting the price source with a calculated VPT value.
The underlying logic calculates a synthetic price based on volume-weighted spreads and standard deviations. This "shadow" price reflects the intensity of volume relative to price movement. By applying the standard MACD formula (the difference between a Fast and Slow moving average) to this VPT-based source, the resulting oscillator reacts more dynamically to market activity than one based solely on closing prices.
Settings
- VPT Smoothing Length: Controls the EMA smoothing applied to the VPT source. Higher values reduce noise but may reintroduce some lag.
- Fast Length: The period for the shorter moving average used in the MACD calculation.
- Slow Length: The period for the longer moving average used in the MACD calculation.
- Signal Smoothing: The period for the Signal line (the moving average of the MACD line).
- Simple MA(Oscillator): If enabled, uses a Simple Moving Average (SMA) for the MACD calculation instead of an EMA.
- Simple MA(Signal Line): If enabled, uses a Simple Moving Average (SMA) for the Signal line instead of an EMA.
FAQ
How do I interpret the histogram colors?
The histogram uses four colors to represent momentum: bright green for strong bullish momentum, faded green for weakening bullish momentum, bright red for strong bearish momentum, and faded red for weakening bearish momentum.
What should I do if the indicator is too "jittery"?
If the indicator reacts too sharply to minor movements, increase the "VPT Smoothing Length" or adjust the "Signal Smoothing" to create a more stable output.
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.