OPEN-SOURCE SCRIPT

Stratum Depth Profile [JOAT]

1 491
Stratum Depth Profile [JOAT]

Introduction

The Stratum Depth Profile is an open-source volume profile indicator built in Pine Script v6. It calculates and displays a real-time Volume Profile histogram directly on the price chart, identifying the Point of Control (POC), Value Area High (VAH), Value Area Low (VAL), and classifying price zones as High Volume Nodes (HVN) or Low Volume Nodes (LVN). The indicator separates buying and selling volume within each price level, calculates a context score based on where price sits relative to the profile, and detects institutional signals like POC reclaims, Value Area breakouts, absorption events, and delta imbalances.

Unlike simple volume bars beneath the chart, this indicator maps volume across price levels to show where the most trading activity occurred. The POC represents the price level with the highest traded volume — a natural magnet for price. The Value Area contains the configurable percentage (default 70%) of total volume, defining the range where most participants agreed on value. Price outside the Value Area is in a statistical extreme and tends to revert or accelerate.

snapshot

Why This Indicator Exists

Volume Profile is one of the most powerful tools in institutional trading, but most implementations on TradingView either require paid subscriptions, lack delta separation, or do not provide context scoring. This indicator addresses those gaps:

  • Full Volume Profile Calculation: Bins volume across configurable price levels over a lookback period, producing a true histogram of volume by price
  • Bull/Bear Delta Separation: Each price level's volume is split into buying volume (close > open candles) and selling volume (close < open candles), revealing who controls each level
  • POC / VAH / VAL Detection: Automatically identifies the Point of Control and expands outward to find the Value Area boundaries containing the specified percentage of total volume
  • Context Scoring: A 0-100 score based on price position relative to the profile (above VAH, at POC, below VAL, etc.) combined with SMA alignment, giving a quick read on the current market context
  • Institutional Signal Detection: POC Reclaim, POC Rejection, VA Breakout, Absorption, Delta Imbalance, and Zone Shift events with anti-overlap cooldowns
  • HVN/LVN Classification: Identifies which price levels have concentrated volume (support/resistance) versus thin volume (fast-move zones)


How Volume Profile Calculation Works

The indicator divides the price range of the lookback period into a configurable number of rows (default 24). For each bar within the lookback, it determines which price bin the bar's activity falls into and accumulates volume. The calculation separates bullish and bearish volume:

Pine Script®


The POC is the single price level where the most volume was traded — it acts as a magnet because it represents the price at which the most participants found value. The Value Area expands symmetrically from the POC, adding the next-highest adjacent bins until the specified percentage of total volume is captured.

Bull/Bear Delta at Each Level

What makes this profile unique is the delta separation within each price bin. Instead of just showing total volume, the histogram displays bullish volume (green/teal) and bearish volume (pink/red) side by side at each price level. This reveals:

  • A POC dominated by buying volume suggests buyers control the key level — bullish bias
  • A POC dominated by selling volume suggests distribution — bearish bias
  • VAH with heavy selling indicates resistance with institutional distribution
  • VAL with heavy buying indicates support with institutional accumulation
  • Levels where bull and bear volume are roughly equal indicate genuine two-way auction — balanced market


Context Scoring System

The context score (0-100) provides an at-a-glance assessment of the current market state relative to the volume profile:

  • Price Zone Component: Where price sits relative to POC, VAH, and VAL. Price above VAH or below VAL scores higher (trending/breakout conditions). Price near POC scores for mean-reversion potential.
  • SMA Alignment Component: Whether the 20, 50, and 200 SMAs are aligned in a trending configuration. Full bull alignment (20 > 50 > 200) or bear alignment adds to the score.
  • POC Proximity: How close price is to the POC level — useful for identifying mean-reversion opportunities or confirming that price is at a key decision point.
  • Delta Direction: Whether the current cumulative delta supports the price direction.


Institutional Signals

The indicator detects six types of institutional events, each with anti-overlap cooldowns to prevent label stacking:

  • POC Reclaim: Price crosses above the POC after being below it — indicates buyers are reclaiming the most-traded level, often a bullish continuation signal
  • POC Rejection: Price approaches the POC and reverses away — the POC is acting as resistance or support
  • VA Breakout: Price closes outside the Value Area — a statistical extreme that often leads to trend continuation or a sharp reversion
  • Absorption: High volume with small price range (Wyckoff Effort vs Result) — institutional orders are being filled without moving price, often preceding a directional move
  • Delta Imbalance: The buy/sell volume ratio at the current level is heavily skewed, indicating one-sided institutional flow
  • Zone Shift: The Value Area boundaries shift significantly between profile recalculations, indicating a change in the accepted value range


Visual Design

The indicator uses a "Midnight Neon" color theme with electric blues, hot pinks, neon violets, and lime accents on a dark background:

  • VP Histogram: Horizontal bars drawn as boxes, with bull volume in neon teal and bear volume in hot pink. A sin-based gradient provides smooth color transitions across the histogram.
  • POC Line: Bright electric blue line at the highest-volume price level, with a label showing the exact price
  • VAH/VAL Lines: Neon violet lines marking the Value Area boundaries
  • SMA Lines: 20/50/200 SMAs with neon glow effect for trend context
  • Signal Labels: Color-coded labels for each institutional signal type with cooldown-based anti-overlap
  • Context Score: Displayed in the HUD with color coding (green for high scores, amber for moderate, red for low)


snapshot

HUD Dashboard

The real-time HUD displays key metrics:

  • POC price level and proximity state (At POC, Near POC, Away)
  • VAH and VAL price levels with current zone (Above VA, In VA, Below VA)
  • Context Score (0-100) with color coding
  • POC Delta direction (Buyers/Sellers/Balanced)
  • Current Delta value and direction
  • Effort/Result ratio (Wyckoff absorption detection)
  • SMA Alignment state (Bull Aligned, Bear Aligned, Mixed)
  • Volume Ratio (current vs 20-bar average)
  • Imbalance classification


Input Parameters

Volume Profile:
  • Lookback (bars): Number of bars to calculate the profile over (default: 100)
  • Price Levels: Number of horizontal bins to divide the price range into (default: 24)
  • Value Area %: Percentage of total volume to include in the Value Area (default: 70%)


Display:
  • Display Mode: Full (histogram + lines), Minimal (lines only), or Off
  • Histogram Width: How many bars wide the histogram extends (default: 12)
  • Show SMA Lines: Toggle 20/50/200 SMA overlay
  • Show Signals: Toggle institutional signal labels
  • Signal Cooldown: Minimum bars between signals (default: 5)
  • Show HUD Panel: Toggle the information dashboard


How to Use This Indicator

Step 1: Identify the Value Area
The area between VAH and VAL represents where 70% of volume was traded. Price inside this range is in "fair value." Price outside is in a statistical extreme.

Step 2: Watch the POC
The POC is the strongest magnet on the chart. If price is away from the POC, expect a pull back toward it unless strong momentum keeps price moving. If price is at the POC, watch for a directional break.

Step 3: Read the Delta
Check whether the POC is buyer-dominated or seller-dominated. A buyer-dominated POC in a bullish SMA alignment is a strong confluence for longs. A seller-dominated POC with bearish alignment favors shorts.

Step 4: Use Signals for Timing
POC Reclaim and VA Breakout signals provide timing for entries. Absorption signals warn that a move is being loaded. Delta Imbalance confirms directional conviction.

Step 5: Context Score for Quick Assessment
A context score above 70 suggests strong directional conditions. Below 30 suggests choppy or mean-reverting conditions. Use this to decide whether to trade aggressively or wait.

Best Practices

  • Volume Profile is most meaningful on instruments with reliable volume data — major forex pairs, large-cap equities, crypto majors
  • The lookback period should match your trading timeframe. Day traders might use 50-100 bars on a 5-minute chart. Swing traders might use 100-200 bars on a 1-hour chart.
  • More price levels (rows) give finer resolution but can make the histogram harder to read. 20-30 rows is a good balance.
  • The POC is not a guaranteed support/resistance level — it is a probability zone. Use it with other confluence factors.
  • VA Breakouts can be false. Confirm with volume and momentum before trading a breakout above VAH or below VAL.
  • The delta separation is estimated from candle direction (close vs open), which is an approximation. True tick-level delta requires exchange data not available in Pine Script.
  • During low-volume periods, the profile may be less representative of true institutional positioning.


Limitations

  • Volume Profile calculation is computationally intensive. Very large lookback periods (500+ bars) with many price levels may slow chart loading.
  • The profile is recalculated on each bar, so the POC and VA boundaries can shift as new volume data arrives. This is by design — the profile reflects the most current volume distribution.
  • Buy/sell volume separation uses candle direction as a proxy, not actual order flow data. This is the standard approximation available in Pine Script.
  • The indicator draws boxes for the histogram, which counts against TradingView's drawing object limits. The max_boxes_count is set to 500.
  • On instruments with inconsistent volume reporting (some forex brokers, illiquid stocks), the profile may not accurately represent true volume distribution.
  • The context score is a heuristic, not a statistical model. It provides a useful summary but should not be the sole basis for trading decisions.


Technical Implementation

Built with Pine Script v6 using:
  • Custom volume profile calculation with configurable resolution and lookback
  • Bull/bear volume separation at each price bin
  • Value Area expansion algorithm (symmetric outward from POC)
  • Pre-allocated drawing objects updated via set() methods for performance
  • Sin-based gradient coloring for smooth histogram visual transitions
  • barstate.isconfirmed gating on all signal generation
  • Anti-overlap cooldown system for institutional signals
  • SMA alignment scoring integrated with profile-based context
  • Alert conditions for POC Reclaim, VA Breakout, Absorption, Delta Imbalance, and Zone Shift


Originality Statement

This indicator is original in its integration of volume profile analysis with institutional signal detection and context scoring. While volume profile calculation is a known concept, this indicator is justified because:

  • It combines VP histogram visualization with real-time bull/bear delta separation at each price level, revealing who controls each zone
  • The context scoring system synthesizes price position, SMA alignment, POC proximity, and delta direction into a single actionable metric
  • Institutional signal detection (POC Reclaim, Absorption, Delta Imbalance) is derived directly from the volume profile data rather than being a separate overlay
  • The sin-based gradient coloring and Midnight Neon theme provide clear visual hierarchy without the visual noise common in VP indicators
  • Pre-allocated drawing objects with set() updates provide significantly better performance than creating/deleting objects each bar
  • The HVN/LVN classification helps traders quickly identify where price will find support/resistance versus where it will move quickly


Disclaimer

This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Volume Profile analysis shows where volume was traded historically — it does not predict where price will go. The POC, VAH, and VAL are probability zones, not certainties. Past volume distributions do not guarantee future price behavior. Always use proper risk management and never risk more than you can afford to lose. The author is not responsible for any losses incurred from using this indicator.

-Made by officialjackofalltrades

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.