OPEN-SOURCE SCRIPT

Smart Fixed Volume Profile [MarkitTick]

16 260
💡 This comprehensive analysis suite integrates Auction Market Theory, structural gap analysis, and statistical liquidity strain modeling into a single, cohesive toolkit. Designed for traders who require a granular view of institutional order flow, this indicator overlays a Fixed Range Volume Profile with intelligent price gap classification and a volatility-adjusted exhaustion detector. By combining these three distinct analytical dimensions, it allows users to identify value consensus, structural breakouts, and potential market turns driven by liquidity shortages.

✨ Originality and Utility

While standard Volume Profiles display where trading occurred, this script advances the concept by contextually analyzing *how* price arrived at those levels. It solves the problem of isolated analysis by fusing three disparate methodologies:
  • Contextual Integration: It does not merely show support and resistance; it qualifies moves using "Smart Gaps" (classifying gaps based on market structure) and "Liquidity Strain" (identifying unsustainable price velocity).
  • Institutional Footprint: The inclusion of an "Unusual Volume" highlighter within the profile bars helps traders spot hidden institutional accumulation or distribution blocks that standard profiles miss.
  • Hybrid Logic: By combining a fixed-time profile (anchored to specific dates) with dynamic, developing gap analysis, it provides both a static roadmap of the past and a dynamic interpretation of current price action.


🔬 Methodology and Concepts

• Fixed Volume Profile Engine
The core of the indicator constructs a volume distribution histogram over a user-defined time window. It utilizes a custom aggregation engine that:
  • Fetches higher-timeframe volume and price data to ensure accuracy.
  • Segments the price range into specific "bins" or rows.
  • Allocates volume to these bins based on price action within the bar, separating Buying Volume (Up bars) from Selling Volume (Down bars).
  • Calculates the Point of Control (POC)—the price level with the highest traded volume—and the Value Area, which contains 70% (customizable) of the total volume centered around the POC.


• Smart Gap Logic
The script systematically identifies price gaps and classifies them based on their location relative to market pivots (Highs/Lows):
  • Breakaway Gaps: Occur when price gaps beyond a significant structural pivot (Lookback High/Low), signaling a potential trend initiation.
  • Runaway Gaps: Occur within an existing trend without breaking structure, indicating trend continuation.
  • Exhaustion Gaps: Identified when a gap occurs late in a mature trend (measured by bar count since the last pivot) accompanied by a volume spike, suggesting the trend is overextended.


• Liquidity Strain Detector
This module utilizes a statistical approach to measure market stress. It calculates "Illiquidity" by analyzing the ratio of True Range to Volume (Price Impact).
  • It applies a Logarithmic transformation to normalize the data.
  • It calculates a Z-Score (Standard Deviation from the mean) of this impact.
  • If the Z-Score exceeds a threshold (e.g., 2.0 Sigma) while the trend opposes the price move, it triggers an exhaustion signal, indicating that price is moving too easily on too little volume (thin liquidity).


🎨 Visual Guide
• Volume Profile Elements
istantanea
  • Histogram Bars: Horizontal bars representing volume at price. Cyan indicates bullish volume; Red indicates bearish volume.
  • Unusual Volume Highlight: Bars with volume exceeding the average by a set factor (default 2x) are highlighted with brighter, distinct overlays to denote institutional interest.
  • POC Line: A solid Yellow line marking the price level with the highest volume.
  • VAH / VAL Lines: Dashed Blue lines marking the Value Area High and Value Area Low.
  • Background Box: A grey shaded area encapsulating the entire time and price range of the profile.


• Smart Gap Boxes
istantanea
  • Blue Box (Breakaway): Marks the start of a new structural move.
  • Orange Box (Runaway): Marks continuation gaps in the middle of a trend.
  • Red Box (Exhaustion): Marks potential trend termination points.
  • Dotted Lines: Extend from the center of gap boxes to serve as future support/resistance levels. These boxes are automatically deleted if price "fills" or violates the gap level.

  • Note: This tool incorporates core components from [Smart Gap Concepts], optimized for this specific strategy.


• Liquidity Signals
istantanea
  • Green Label (SE): "Seller Exhaustion" – Appears below bars in a downtrend when selling pressure is statistically overextended.
  • Red Label (BE): "Buyer Exhaustion" – Appears above bars in an uptrend when buying pressure is statistically overextended.
  • Note: This tool incorporates core components from [Liquidity Strain Detector], optimized for this specific strategy.


📖 How to Use
• Interactive Range Selection: This indicator features a flexible, interactive input system. Upon adding the script to your chart, execution is paused until the analysis range is defined. You will be prompted to click on the chart twice: first to establish the Start Date and second to establish the End Date. Once these anchor points are confirmed, the indicator will automatically load the data and generate the profile for the selected specific period.
istantanea

● Strategies for Optimal Anchoring

the optimal starting and ending points for high-probability setups:
  • Swing Highs and Lows (Trend Analysis):
    Anchor the Start Date at a major structural swing high or low and the End Date at the current price using the Extend to Present feature. This identifies the "Fair Value" for the entire price move .

  • Consolidation/Range Anchoring:
    Set the Start Date at the first bar of a sideways range and the End Date at the breakout candle. This reveals the high-node volume clusters that will act as future support or resistance.

  • Session-Based Anchoring (Intraday):
    Align the Start Date with the session open (e.g., London or New York open) to track institutional flow for that specific day .

  • Event-Driven Anchoring:
    Place the Start Date on a significant news event or a Breakaway Gap identified by the script's Gap Engine. This helps determine if the new volume supports the direction of the gap.

  • Correction Cycles:
    During a pullback, anchor the Start Date at the start of the correction to find the Value Area Low (VAL), which often serves as a tactical entry point for a trend continuation.

• Identifying Value:
Use the Value Area to gauge market consensus. Acceptance of price within the VA indicates balance. A breakout above VAH or below VAL suggests the market is searching for new value. The POC often acts as a magnet for price correction.

• Trading Breakouts:
Watch for Breakaway Gaps (Blue) that align with a move out of the Volume Profile's Value Area. This confluence increases the probability of a sustained trend.

• Spotting Reversals:
Combine Exhaustion Gaps (Red) with Liquidity Strain Signals (SE/BE). If price gaps up into a low-volume node on the profile and prints a "Buyer Exhaustion" signal, it suggests the move is unsupported by liquidity and liable to reverse.

• Support and Resistance:
The extended dotted lines from the Smart Gap boxes act as dynamic support/resistance. A retest of a "Runaway Gap" is often a viable entry point for trend continuation.

⚙️ Inputs and Settings

• Global Profile:
  • Start/End Date: Define the exact window for the volume profile calculation.
  • Extend to Present: If checked, the profile updates with live data beyond the end date.


• Profile Settings:
  • Number of Rows: Determines the vertical resolution (granularity) of the histogram.
  • Value Area %: Default is 70%, representing one standard deviation of volume distribution.
  • Placement: Position the profile on the Left or Right of the defined range.
    istantanea


• Liquidity & Gaps:
  • Unusual Threshold: Multiplier of average volume to highlight institutional bars (default 2.0x).
  • Structure Lookback: Adjusts the sensitivity of pivot detection for gap classification.
  • Stress Threshold (Sigma): The Z-Score limit for triggering Liquidity Strain signals (default 2.0).


🔍 Deconstruction of the Underlying Scientific and Academic Framework

• Auction Market Theory (AMT):
The script is grounded in AMT, which posits that the market's primary function is to facilitate trade. The Volume Profile visualizes this by displaying a bell curve of price distribution. The Value Area (typically 70%) corresponds to the First Standard Deviation in a normal Gaussian distribution, representing the area of "Fair Value" where buyers and sellers agree.

• Market Microstructure & Kyle’s Lambda:
The Liquidity Strain module draws conceptually from Kyle’s Lambda, a metric in market microstructure that measures market depth and price impact (Illiquidity). By calculating the ratio of price change (True Range) to Volume, the script approximates the "cost" of moving the market.

• Statistical Z-Score Normalization:
To make the liquidity data actionable, the script applies Z-Score normalization: Z = (X - μ) / σ. This converts raw illiquidity values into standard deviations from the mean. A Z-Score above +2.0 signifies a statistically significant anomaly—an outlier event where price moved excessively relative to the volume traded, often preceding a mean-reversion event.

⚠️ 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.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.