OPEN-SOURCE SCRIPT
Atualizado

Volume Footprint Levels

8 415
Volume Footprint Levels 🐾

What it is

A support/resistance plotter that uses TradingView's request.footprint() volume-at-price data to identify levels where aggressive volume actively defended or rejected price. Instead of drawing lines from raw highs/lows, it only marks zones where one side (buyers or sellers) absorbed the other and price was pushed away — the kind of levels that tend to matter on retest.

How defense is detected

For each bar, the script walks the footprint rows and looks for one-sided imbalance concentrated at the bar's wick zones:

  1. Buy defense (support) — heavy aggressive buying at the bottom X% of the bar's range, where buy volume exceeds sell volume by the imbalance ratio, and the close has moved a configurable distance away from the lows.
  2. Sell defense (resistance) — heavy aggressive selling at the top X% of the bar's range, where sell volume exceeds buy volume by the ratio, and the close has moved away from the highs.


Qualifying rows are aggregated into a volume-weighted average price for the level, and the level only fires if the total defending volume clears a minimum threshold. Individual rows must also clear a minimum delta to count, which filters out thin-tape noise.

Level lifecycle

Each detected level becomes a horizontal line projecting forward from the bar that created it:

  1. Merge / replace — a new level within mergePoints of an existing one is suppressed, unless the new one has higher defending volume, in which case it replaces the weaker one in place.
  2. Touch tracking — every bar whose wick reaches within touchTol of the level increments either the bullish (▲) or bearish (▼) touch counter depending on which side of the level the bar closed on. Counts render in the level's label.
  3. Break confirmation — a level is only removed once price closes beyond it (plus a buffer) for breakBars consecutive bars. If price moves back inside before the count completes, the break counter resets. This stops single-wick fakeouts from killing valid levels.
  4. Cap — total active levels are pruned oldest-first to stay under maxLevels.


Exports

The four nearest supports and four nearest resistances (sorted by proximity to close) are plotted to the price scale and data window as Sup 1–4 / Res 1–4. When Enable JSON Alerts is on, each confirmed bar emits a structured JSON alert containing timestamp, ticker, timeframe, close, all eight ranked levels, active level count, and any new support/resistance created on that bar — designed for ingestion by an external webhook pipeline.

What you see on the chart

Green lines for support, red for resistance, each tagged with a label showing defending volume and the running ▲/▼ touch counts. Hovering a label exposes a tooltip with the level type, exact price, volume, imbalance ratio at creation, and full touch breakdown. Line style, width, colors, and label size are all configurable.

Intended use

A footprint-driven structure tool — the levels flag prices where aggressive flow has already been absorbed once, making them candidates for retest entries, target zones, or invalidation references. Best on instruments where TradingView's footprint data is dense (liquid futures, major FX, large-cap equities); on thinner instruments or deep history the footprint resolution degrades, which is why maxLookback is capped.
Notas de Lançamento
New Feature to preserve the plots. The plots only go as far back as the volume data Tradingview provides. The plots help to identify previous levels once the levels have moved on.
Notas de Lançamento
Changed the volume label so it no longer stays frozen at the level's creation strength: each time price retests a level, we now add the footprint volume actually transacted at that price row into a new retestVols accumulator and display it as defenseVol (+retestVol), with the tooltip broken out into Defense / Retest Vol / Total Vol. We added an "Accumulate Touch Volume" toggle, a f_volAtPrice() helper to read the at-level volume, wired the new array through every lifecycle path (create, merge-replace, prune, break-removal), and un-gated the label-update loop so volume updates even when touch counts are hidden.

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.