Advanced Volume [v3.1]Advanced Volume Indicator & Divergence Dashboard -
Volume is the fuel that drives market structure. While price dictates *where* the market is going, volume reveals *how much conviction* is behind the move.
The **Advanced Volume Indicator** is a comprehensive, multi-factor analysis toolkit designed to move beyond single-metric volume analysis. By aggregating seven distinct volume indicators, a cooldown-aware divergence engine, and a dynamic scoring dashboard, this tool provides a complete, institutional-grade picture of market participation and order flow.
Core Metrics Included
You can select any of the following primary oscillators to display on your main indicator pane. Regardless of your visual selection, the background engine continuously tracks all of them:
* **Chaikin Money Flow (CMF):** Measures the balance of accumulation and distribution over a rolling period.
* **Money Flow Index (MFI):** A volume-weighted relative strength index used to spot volume exhaustion and overbought/oversold extremes.
* **Volume RSI:** Applies momentum calculations strictly to volume, identifying periods of expanding or contracting participation.
* **Relative Volume (RVOL):** Compares the current bar's volume against a rolling baseline average to highlight significant spikes.
* **Volume Oscillator:** Tracks the percentage spread between short-term and long-term volume moving averages to determine volume trend direction.
* **VWAP Position:** Evaluates price action relative to the session's Volume Weighted Average Price (an institutional benchmark).
* **Estimated Cumulative Volume Delta (CVD):** Approximates net buying and selling pressure.
The Weighted Aggregate Dashboard
The centrepiece of this indicator is the on-chart Heads-Up Display (HUD). It provides real-time status updates for all seven metrics and combines them into a **Weighted Aggregate Signal**.
The engine evaluates all data points simultaneously and outputs a directional score ranging from **-9 (Strong Sell)** to **+9 (Strong Buy)**.
The scoring is weighted based on metric reliability:
* **CMF:** ±2 points (Primary money flow driver)
* **MFI:** +2 (oversold), +1 (neutral bullish), or -1 (overbought/bearish bias)
* **Volume Oscillator:** ±1 to ±2 points (Based on trend expansion strength)
* **Volume RSI:** ±1 point
* **VWAP Position:** ±1 point
* **Volume Trend (vs 20 SMA):** ±1 point
Smart Divergence Engine
The script features a robust momentum divergence engine applied to your chosen primary oscillator. It includes three distinct filters to prevent false signals and alert spam:
1. **Divergence Strength Scoring:** Evaluates the severity of both the price displacement and the oscillator displacement.
2. **Minimum Strength Filter:** Allows you to ignore weak, insignificant divergences. (A typical strong signal scores between 1.0 and 5.0).
3. **Cooldown Gate:** Requires a minimum number of bars between signals of the same direction, preventing the engine from spamming repeated alerts during a slow, grinding trend.
Actionable Signals & Alerts
The indicator provides visual markers and fully configurable alerts for:
* **Bullish & Bearish Divergences:** Confirmed momentum shifts.
* **Volume Spikes:** Bars exceeding your custom RVOL threshold (default 2.0x average).
* **Hidden Liquidity:** High-volume Doji candles. These represent extreme volume participation resulting in price indecision—often a footprint of institutional absorption or hidden liquidity resting in the order book.
Recommended Settings by Trading Style
* **Scalping (1m–5m):** Lookback = 3, Cooldown = 5, Min Strength = 0.5, Session CVD Reset = ON
* **Day Trading (15m–1H):** Lookback = 5, Cooldown = 10, Min Strength = 1.0, Session CVD Reset = ON
* **Swing Trading (4H–D):** Lookback = 5, Cooldown = 15, Min Strength = 2.0, Session CVD Reset = OFF
* **Portfolio/Macro (D–W):** Lookback = 8, Cooldown = 20, Min Strength = 1.0, Session CVD Reset = OFF
Strategy Integration
This script exports its internal data silently to the TradingView Data Window. You can easily import these values into your own automated strategy scripts using the `request.security()` function. The exported plots are: `Export_CMF`, `Export_MFI`, `Export_RVOL`, and `Export_DivStrength`.
---
MANDATORY MODERATION DISCLOSURES
**1. Historical Plotting / Offset Confirmation**
By design, the divergence markers plotted by this script appear in the past. To ensure a divergence signal is permanently locked in and mathematically valid, the engine waits for `div_lookback` bars to close *after* the suspected pivot high/low before confirming it. Once confirmed, it plots the marker backward onto the actual pivot bar using a negative offset. **This is not a repainting bug.** It is a strict, standard confirmation feature to prevent repainting and false signals mid-move. Alerts can be set to fire only upon bar close.
**2. Estimated CVD Calculation**
True Cumulative Volume Delta requires tick-by-tick bid/ask order flow data, which is not available on standard TradingView chart feeds. The CVD in this script is explicitly an **Estimated CVD**. It uses the intra-bar close position relative to the high/low range as a mathematical proxy to approximate net buying and selling pressure. A "Session Reset" toggle is included (and recommended) for equities and futures to restart the accumulation daily, mitigating gap-open distortion.
Indicatore Pine Script®






















