OPEN-SOURCE SCRIPT

Volume Waves (Buy / Sell / Delta) [footprint data]

1 412

⚠️ This indicator uses footprint data and requires TradingView Premium plan or higher. Without footprint support the waves will not appear.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Volume Waves (Buy / Sell / Δ) is a footprint-based volume visualization that renders buy volume, sell volume and delta directly on the price chart as adaptive filled waves - no separate pane, everything stays on the candles where it belongs.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
What you see
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Three layers are rendered directly on the chart:
  • Volume wave (gray) — total buying or selling activity scaled to recent history. Shows how significant the current bar's volume is compared to the lookback window.
  • Delta wave (semi-transparent lime / purple) — positive delta (buyers dominated) is lime, negative delta (sellers dominated) is purple. Rendered on top of the volume wave, always stays within its boundaries.
  • Extreme delta (fully opaque lime / purple) — same colors, full opacity. Appears only when both volume and imbalance cross their thresholds simultaneously. The brighter the spike stands out against the semi-transparent background — the more significant that bar was.

The waves are normalized relative to recent market activity and scaled dynamically using ATR, allowing the visualization to remain readable across different instruments and timeframes without constant manual adjustment.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Why footprint data matters
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Most "buy/sell volume" or "volume delta" indicators available on charts do not use actual trade classification. They approximate — typically by comparing the candle's close to its open and assuming the entire volume was either buying or selling, or by applying the same approximation from a lower timeframe (the accuracy does not improve from this — the method stays the same, only the scale changes).

Footprint data works differently. When supported by the broker and exchange feed, TradingView provides bid/ask-classified executed trades where each transaction is identified as aggressive buying or selling at the moment of execution. Not calculated from price behavior, not estimated from candle shape — recorded as a fact from the exchange order book.

This distinction becomes especially important around:
  • high-liquidity levels and absorption zones,
  • breakouts and exhaustion moves,
  • and news-driven volatility.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Display modes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Two sides — buy and sell waves expand in opposite directions from the baseline: buy volume upward, sell volume downward. Buyer and seller dominance is immediately visible.

One side — buy and sell volume are stacked upward together as total activity. Useful when focusing on participation intensity or volatility expansion. The delta wave remains visible and colored by sign — directional information is always present.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
How it is built
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  • Shared normalization. Buy and sell volume are both divided by the same highest total volume over the lookback window. This preserves the real proportion between them and ensures delta always reflects the correct sign and magnitude. Independently normalized sides would distort this relationship.
  • Adaptive ATR scaling. Wave height = normalized volume × ATR(200) × scale factor. This gives the indicator automatic adaptation across markets, stable visual proportions across timeframes, and consistent readability during volatility expansion. Quiet markets remain compact, volatile markets naturally expand. The scale factor setting provides additional manual control when needed.
  • Visible-area rendering. Waves are built only for bars currently visible on screen using chart.left_visible_bar_time and chart.right_visible_bar_time. The loop range accounts for the offset of the last bar from the right edge — correctly handling situations when recent bars are outside the viewport after scrolling left. When scrolling or zooming, the structure recalculates intentionally to preserve local proportionality.
  • Baseline positioning. The baseline can be placed manually via the position setting: top, bottom or middle of the visible range. In auto mode the indicator checks whether current price is in the upper or lower half of the visible range and positions the baseline on the opposite side — in most cases preventing overlap with candles without manual adjustment.
  • Extreme delta detection. A bar is marked as extreme only when two conditions are met simultaneously: total volume exceeds a configured percentile of recent history (Lookback Window
    - 500 bars by default), and absolute delta exceeds a configured percentage of total bar volume. This filtering removes low-volume noise, small meaningless imbalances, and high-volume but balanced bars. Only bars where both participation and asymmetry are genuinely exceptional are highlighted. Both thresholds are independently adjustable.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
How to read it
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  • Dominance. When buy waves consistently exceed sell waves — buyers are participating more aggressively. When sell waves dominate — sellers control the auction. The relationship becomes visible instantly without requiring footprint tables or numerical inspection.
  • Delta as confirmation. Price rising with positive delta means real buying pressure is behind the move. Price rising while delta weakens or turns negative suggests passive absorption may be occurring — the move may lack genuine initiative participation.
  • Extreme highlights. Fully opaque spikes mark bars where both participation and directional imbalance were exceptional. These bars are often structurally important and tend to stand out clearly even on dense charts — absorption, exhaustion, breakout moments.
  • Info label. On the last bar a small label shows buy volume, sell volume, delta value and delta as a percentage of total volume — quick numerical context without opening a separate footprint panel.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Settings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  • side — one side or two sides visualization
  • position — baseline placement: auto / top / bottom / middle
  • shift — offset between baseline and chart edge
  • scale factor — overall wave height multiplier
  • Lookback Window — normalization and percentile range
  • Delta % threshold — minimum imbalance percentage for extreme detection
  • Volume Percentile % — minimum participation percentile for extreme detection
  • show volume — toggle buy/sell volume waves
  • show delta — toggle delta overlay and extreme highlights
  • delta transparency — two inline values: opacity for regular delta and for extreme highlights separately
  • show label — toggle information label on last bar

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Notes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  • Footprint data required. The indicator uses request.footprint() available on TradingView Premium or higher. Availability also depends on broker and exchange feed support.
  • Updates on scroll. Waves recalculate every time the visible area changes — intentionally. You always see volume structure scaled to what is currently on screen.

If you find it useful — a boost or comment is appreciated. Feedback and suggestions are always welcome.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.