All indicators

Volume Divergence by MM

Jun 22, 2020

Static chart image
Volume BasedSignalsDivergencesMoving Averages

The Volume Divergence by MM indicator utilizes smoothed volume calculations to identify potential trend reversals and momentum shifts through the detection of regular and hidden divergences. This tool assists traders in spotting market exhaustion and trend strength by comparing price action against a specialized volume oscillator.

Usage

The Usage section focuses on interpreting the oscillator movements and the divergence labels generated by the script. Traders can use this tool to identify when volume flow no longer supports the prevailing price trend.

  • Trend Reversals: Regular bullish or bearish labels indicate potential reversals. For example, a regular bullish divergence occurs when the price makes a lower low while the volume oscillator makes a higher low, suggesting selling pressure is fading.
  • Trend Continuation: Hidden divergences often signal that the primary trend is likely to continue. A hidden bullish divergence occurs when price makes a higher low but the oscillator makes a lower low, indicating a strong reload of buying interest.
  • Volume Breaks: Users can monitor the crossing of the zero baseline or breaks in the oscillator’s directional trend to confirm changes in market participation.

Details

The script constructs a unique volume oscillator using a cascading series of weighted moving averages (WMA). The lengths for these averages are derived from the Fibonacci sequence to create a smoothed output that filters out market noise while remaining responsive to significant shifts in participation.

The calculation uses a custom "Pine WMA" logic that assigns positive or negative values to volume based on whether the candle closed higher or lower than its open. This creates a cumulative representation of buying versus selling volume. The divergence detection logic identifies pivot points within a user-defined lookback range and compares these local peaks and troughs with the corresponding price action.

Settings

  • First Moving Average length: Sets the initial lookback period for the primary volume smoothing.
  • Second Moving Average length: Sets the second lookback period; subsequent smoothing lengths are automatically derived from the sum of previous lengths.
  • Pivot Lookback Right: The number of bars to the right of a pivot point required for confirmation.
  • Pivot Lookback Left: The number of bars to the left of a pivot point required for identification.
  • Max of Lookback Range: The maximum number of bars the script will look back to find a preceding pivot for divergence comparison.
  • Min of Lookback Range: The minimum number of bars required between two pivots to qualify for a divergence.
  • Plot Bullish: Toggles the visibility of regular bullish divergence labels.
  • Plot Hidden Bullish: Toggles the visibility of hidden bullish divergence labels.
  • Plot Bearish: Toggles the visibility of regular bearish divergence labels.
  • Plot Hidden Bearish: Toggles the visibility of hidden bearish divergence labels.

FAQ

How do I interpret the color of the volume line? The oscillator line changes color based on its position relative to the zero baseline; a green line indicates positive volume flow (bullish), while a red line indicates negative volume flow (bearish).

What is the difference between regular and hidden divergence? Regular divergence typically signals a potential trend reversal, whereas hidden divergence suggests the current trend is likely to persist after a temporary retracement.

How can I access this tool? 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.