Picture of the author

TradingView-RU

06/23 12:00

Liquidity Heatmap MTF [JOAT]

LIQUIDITY HEATMAP MTF

A weighted multi-timeframe liquidity-zone heatmap that aggregates pivot-based resting liquidity from up to four higher timeframes (1H / 4H / 1D / 1W by default), decays old pivots over a configurable half-life, and projects the resulting hot bins as a right-side colour strip plus optional horizontal lines that extend back across the chart so the key levels are visible on price. Adds an estimated liquidation-level layer on top — the price ranges where leveraged positions get unwound — and warns when price approaches one.



Why MTF aggregation matters

Single-timeframe liquidity maps miss the structural reality that institutional flow operates on multiple horizons simultaneously. A daily pivot high carries more resting liquidity than a 1H pivot high, but both contribute. Liquidity Heatmap MTF lets you turn on / off each of four timeframes (1H, 4H, 1D, 1W) independently and assign each a weight so the contribution to the heatmap is proportional to your conviction about how much that timeframe matters.

Defaults:


1H weight 1.0×
4H weight 1.5×
1D weight 2.5×
1W weight 4.0× (off by default; enable for macro reads)


Pivots are detected in each HTF context using configurable left/right lookbacks. Each pivot contributes intensity proportional to the volume traded on its bar (with optional log compression for instruments that have rare extreme prints).

Decay — half-life modelled

A pivot from 200 bars ago should not contribute equally to today's heatmap. The script applies an exponential decay:

intensity = volume × exp(−ln(2) × age / halfLife)

The Decay Half-Life input (default 180 bars) sets how quickly old pivots fade. After one half-life, an old pivot contributes half as much; after two, a quarter; and so on. This is the principled way to weight history — it never drops contributions discontinuously and it never lets ancient liquidity poison the current read.

Heatmap grid + hot-zone classification

The price range over the visible lookback (configurable, default 500 bars + 2% padding) is divided into N bins (default 60, capped at 200 by Pine's max_boxes_count). Each pivot's decayed intensity is accumulated into the bin closest to its level. Bins are then normalised against the hottest bin and any bin above the Hot Zone Threshold (default 70% of max) is tagged HOT.

The heatmap is rendered as a vertical strip on the right of the chart (configurable width and gap from latest bar) with bins coloured along a deep-ocean blue gradient — cold bins are near-invisible (transparency floor), hot bins are vivid cyan.

Hot-zone projection across chart (JOAT enhancement)

This is the headline visual: the top hot bins are projected back across the chart as horizontal lines (configurable count, default 5) with price labels, extending back a configurable number of bars (default 120). So you do not just see the heatmap as a right-side strip — you see the key levels on the chart at the price levels they actually occupy. Toggleable.

Estimated liquidation levels (the second layer)

On top of the liquidity heatmap, an optional liquidation layer estimates where leveraged positions get stopped out. Each significant HTF pivot extreme gets a projected liquidation level at:

liq_level = pivot ± (ATR × liqPad)

Configurable liqPad (default 0.5 ATR). Configurable caps on liquidation lines above (default 4) and below (default 4) the current price. Lines extend right by a configurable bar count. When price comes within liqAtrMult × ATR of a liquidation line, the !LIQ alert fires and the line is rendered in the accent colour (the only off-family colour in the palette — bright orange).

The liquidation logic is intentionally conservative — pivots provide the structural anchor; the ATR pad is the only configurable variable; lines are capped to avoid clutter.



Dashboard

Monospaced table positionable to any of nine corners. Surfaces:


Active timeframes and their weights.
Total pivots tracked.
Hottest bin price and intensity %.
Hot-zone count.
Liquidation lines above / below current price counts.
Distance (in ATR units) to nearest liquidation line.
Last hot-zone activation with bar-age.


Visual system


Heat strip (toggleable width / gap / transparency).
HOT tags on hottest bins (toggleable).
Optional strip border.
Horizontal hot-zone lines extending back across the chart (toggleable, capped, configurable length).
Liquidation level lines above and below (toggleable, capped).
LIQ labels (toggleable).


A locked Deep Ocean palette (bathypelagic blue gradient on near-black, with the bright orange #FF6B00 reserved exclusively for liquidation warnings) gives the chart a distinct institutional liquidity-map identity.

Alerts

Three alert conditions, each independently controllable, each cooldown-gated:


Hot Zone Activated — fires when a new bin crosses the hot threshold.
Approaching Liq Level — fires when price comes within liqAtrMult × ATR of a liquidation line.
New HTF Pivot Added — fires when a new HTF pivot is detected and added to the cache.


A configurable cooldown (default 8 bars) prevents back-to-back alert spam.

How to read it

Three reads, in order of conviction:


Approaching Liq Level alert — the most actionable single signal. Price is within striking distance of estimated leveraged-position stop-out levels. Liquidations tend to be self-fulfilling on the way in (cascade through stops) and exhaustive at the extreme (no more sellers / buyers left after the cascade).
Multi-timeframe hot zone — when a hot bin is contributed to by more than one HTF, it is by definition more significant. The hot line projections show you which levels are MTF-confluent.
New HTF Pivot in 1D or 1W context — these are the slowest-moving structural events. A new daily or weekly pivot reshapes the heatmap meaningfully.


Suggested settings

Defaults (1H/4H/1D enabled, weights 1.0/1.5/2.5, decay half-life 180, hot threshold 70%) are tuned for intraday-to-swing trading on liquid futures, FX, and crypto. For pure scalping, disable 1D / 1W and raise 1H weight. For pure macro, enable 1W and raise its weight; reduce 1H to 0.5×. The liqPad default 0.5× ATR is conservative — raise to 1.0× for more cautious liquidation projections.

Originality

The implementation — the MTF pivot aggregation pipeline with per-TF weights, the exponential half-life decay model, the bin-grid heatmap with hot-zone threshold, the cross-chart hot-line projection layer, the ATR-based liquidation level estimator with above/below caps, the cooldown-gated multi-alert engine, and the deep-ocean palette with the orange liquidation accent — is JOAT-original. No third-party code reused. The "liquidity map" concept comes from professional desks; the implementation here is purpose-built for Pine v6 with bar data only.

Limitations

Estimated liquidation levels are an inference from pivots and ATR — Pine cannot read actual leverage data or aggregated futures funding/open-interest. The lines mark where stop clusters are statistically likely to sit, not where they actually do. Pine's max_boxes_count caps the grid at 200 bins; the script clamps to 200 max even though the input allows higher requests. MTF pivots use request.security in non-lookahead mode, so they are non-repainting once confirmed at their HTF.




-made with passion by jackofalltrades
#HTXCommunity4thAnniversary
BeğenPaylaş

Tüm Yorumlar0En yeniPopüler

avatar
En yeniPopüler