OPEN-SOURCE SCRIPT

Candle Volume Decomposition [MarkitTick]

849
💡 Standard volume analysis often falls short by presenting trading activity as a single, one-dimensional aggregate figure per period. This limitation obscures the true dynamics of market microstructure, leaving analysts guessing whether the volume was concentrated in the directional move of the body, or absorbed at the extremes as rejection wicks. This indicator reconstructs the volume profile of every single price candle by decomposing it into three distinct spatial zones: the Upper Wick, the Body, and the Lower Wick. By leveraging lower-timeframe data polling, it builds an intraday volume distribution for higher-timeframe candles, extracting critical insights such as Delta Pressure, Zone Concentration, Absorption, and Exhaustion, wrapping it all into an on-chart dashboard and advanced histogram.

✨ Originality and Utility
Most volume indicators attempt to map buying and selling pressure by looking at the close relative to the open or high/low range, applying a uniform formula to the entire bar's volume. This indicator breaks away from aggregate estimations by fetching strict lower-timeframe data and physically mapping it to the structural boundaries of the chart timeframe's candle.

The primary utility lies in its ability to reveal hidden liquidity mechanics. A candle with seemingly standard bullish volume might actually contain massive localized selling pressure entirely trapped within its upper wick. By isolating these zones, traders can definitively identify absorption, measure the efficiency of directional body moves, and detect localized exhaustion before price reverses. It effectively bridges the gap between basic volume bars and complex Order Flow footprint charts, delivering high-granularity data without requiring specialized tick-data feeds.

🔬 Methodology and Concepts
The script utilizes a lower timeframe polling array to dissect the current chart's candle structure. The mathematical methodology is broken down into the following core concepts:

  • Spatial Decomposition: The indicator calculates the precise price boundaries of the candle's body (Open to Close) and wicks (High to Body Top, Low to Body Bottom). As lower timeframe volume data is fed into the array, it allocates the volume proportionally based on where the lower timeframe price action occurred relative to the parent candle's zones.
  • Net Signed Volume: Instead of arbitrary coloring, the script calculates a net directional flow. Lower wick volume (demand/buying) is added, upper wick volume (supply/selling) is subtracted, and body volume is directionally signed based on whether the candle closed green or red.
  • Delta Pressure Index: A normalized ratio ranging from -1.0 to +1.0. It calculates the net difference between lower wick volume and upper wick volume relative to total volume. Positive values indicate demand dominance in the wicks, while negative values indicate supply dominance.
  • Volume Concentration (HHI): The Herfindahl-Hirschman Index is adapted here to measure zone dominance. By squaring the volume ratios of all three zones and summing them, it provides a score from 0.33 (perfectly equal distribution) to 1.0 (a single zone contains 100% of the volume).
  • Absorption & Exhaustion: Absorption is modeled by combining high total wick volume with a compressed body range. Exhaustion is triggered mathematically when the total volume residing in the wicks exceeds the body volume multiplied by a user-defined threshold, signaling potential structural failure.


🎨 Visual Guide
The indicator's visual outputs are highly detailed, split between the main price pane and the indicator pane.

● Main Chart Elements
  • Price Candles: The standard price candles are dynamically colored and faded. By default, they use "Net Signed Volume" coloring, transitioning between Deep Teal (Bullish Net) and Deep Red (Bearish Net). Furthermore, the transparency of the candles is completely dynamic; candles with absolute directional dominance are fully opaque, while candles with weak or highly contested net volume become transparent.
  • Wick Exhaustion Highlight: A distinct purple background flash appears on specific bars where wick volume overwhelmingly eclipses body volume, visually alerting the user to structural exhaustion.
  • Divergence Labels: Small, precise text labels reading "Vol ▲Div" (Teal) or "Vol ▼Div" (Red) appear above or below candles when volume divergences are detected between the price trend and the total volume trend over the specified lookback period.
  • Dashboard Table: Positioned in the top right, this matrix provides real-time scoring. It displays block-meters and color-coded text for Delta Pressure, Dominant Zone, CVD Bias, Body Efficiency, Absorption Score, Wick Exhaustion status, Zone Concentration, and the exact percentage breakdown of the three spatial zones.


● Indicator Pane Elements
  • Stacked Volume Columns: When in standard mode, the volume histogram represents the true spatial distribution. The Lower Wick volume is plotted at the base in vivid Cyan. The Body volume is stacked on top in either Teal or Deep Red. The Upper Wick volume completes the stack in vivid Red.
  • Net Signed Columns: When toggled via settings, the histogram switches to a baseline-centered momentum oscillator, plotting the absolute Net Signed volume above or below the zero line, instantly revealing the true directional aggression of the period.


📖 How to Use
Traders can deploy this indicator to validate breakouts, confirm reversals, and manage risk through superior tape reading.

  • Validating Breakouts: When observing a breakout candle, refer to the Dashboard's "Body Efficiency" metric. A high efficiency score combined with an opaque body color indicates that the majority of the volume supported the directional move. Conversely, if a breakout candle prints a high "Absorption" score and high wick concentration, the move is likely being faded by larger market participants.
  • Trading Reversals: The purple background flash (Wick Exhaustion) is a prime leading indicator. When this occurs at a known support or resistance level, it mathematically confirms that counter-trend limit orders have successfully absorbed the aggressive volume, halting the candle's progression.
  • Monitoring Cumulative Pressure: The CVD Bias metric in the dashboard maintains a running sum of Net Signed Volume. If price is making higher highs but the CVD Bias flips to Bearish, a structural divergence is occurring, warning of an impending pullback.
  • Interpreting Asymmetry: Watch the dominant zone metrics. Continuous lower-wick dominance during a downtrend suggests accumulation, as market participants repeatedly buy the dips within the micro-structure of the falling candles.


⚙️ Inputs and Settings
The script provides a modular architecture allowing users to tailor the calculations and visuals to their specific strategy requirements.

● Volume Profile & Display
  • Lower Timeframe: The critical input for data resolution. This must be set lower than the chart timeframe (e.g., 1-minute data for a 15-minute chart) to provide the necessary polling granularity.
  • Coloring Mode: Allows switching the price candles between "Net Signed Volume" (accounting for wick/body math), "Body Direction" (traditional close vs open), or turning it off entirely.
  • Dynamic Transparency: A toggle that maps the opacity of the price candles directly to the strength of the volume signal.
  • Signed Volume Mode: Toggles the indicator pane histogram between the 3-tier stacked spatial volume model and the zero-centered Net Signed Volume oscillator.


● Advanced Metrics & Dashboard
  • Metric Toggles: Users can individually enable or disable internal calculations for Delta Pressure, Asymmetry, CVD, Efficiency, Wick-to-Body Ratio, HHI, and Absorption to optimize performance or clear the data window.
  • Exhaustion Threshold: A float multiplier that determines how aggressive the wick volume must be compared to the body volume to trigger the purple background flash. Lowering this increases sensitivity.
  • Volume Divergence: Toggles the on-chart pivot detection, with a customizable "Lookback Bars" setting to determine the required span for identifying volume-price discrepancies.


🔍 Deconstruction of the Underlying Scientific and Academic Framework
The theoretical foundation of this script is rooted in Market Microstructure and the mechanics of the Limit Order Book (LOB). Standard OHLC data suffers from temporal aggregation bias; it flattens the continuous auction process into discrete periods. By polling lower timeframe arrays, this indicator reconstructs the volume topology, mapping volume to price rather than just volume to time.

The integration of the Herfindahl-Hirschman Index (HHI) is a direct cross-application from macroeconomics and antitrust law, where it is traditionally used to measure market share concentration. In this script, HHI is brilliantly applied to spatial volume analysis to determine the "monopoly" of trading activity within a single candle. An HHI approaching 1.0 mathematically proves severe localized liquidity consumption, indicating an inelastic supply or demand wall at that specific price node.

Furthermore, the Delta Pressure and Absorption calculations mirror the dynamics of liquidity provision vs. liquidity taking. When a candle expands its range, aggressive market orders are consuming passive limit orders (high body efficiency). When a candle prints high volume but compresses its body range, aggressive market orders are being entirely absorbed by a dense wall of resting limit liquidity (high wick volume, high absorption score). This indicator translates these complex order-matching mechanics into a digestible visual hierarchy.

⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.