Liquidity Thermal Map [JOAT]Liquidity Thermal Map
Introduction
The Liquidity Thermal Map is an overlay indicator that identifies and visualizes liquidity pockets — price zones where trapped participants are likely clustered — and ranks their significance using a heat-mapped color scale driven by volume and price range data. Rather than treating all swing highs and lows equally, it weights each zone by the liquidity activity present at that pivot bar, then applies power-law contrast stretching so that the most significant zones immediately stand out from background noise.
The goal is not to predict where price will go. The goal is to surface which untested zones carry the most liquidity weight, so a trader can make their own informed decisions about potential targets or areas of interest.
---
Core Concepts
1. Pivot Detection
Zones are seeded at confirmed swing pivots using Pine Script's built-in pivot functions:
pivH = ta.pivothigh(high, leftPiv, rightPiv)
pivL = ta.pivotlow(low, leftPiv, rightPiv)
A pivot high marks a bar where bears may have been trapped above — price reached that level, reversed, and left unfilled orders behind. A pivot low marks the mirror situation for trapped bulls. The left bars and right bars inputs control how many confirming bars are required on each side, balancing sensitivity against noise.
2. Liquidity Metric and Heat Normalization
Each pivot is scored using one of three selectable metrics:
Vol x Range (default): volume * (high - low) * 100 — rewards bars with both high volume and wide price movement
Volume only: raw volume at the pivot bar
Range only: the high-low spread at the pivot bar
Raw scores are normalized across all active pockets using a rolling min-max calculation:
norm = (metric - min) / (max - min)
heat = math.pow(norm, heatContrast)
The power-law contrast stretch (controlled by the Heat Contrast input) compresses lower-significance pockets toward zero and expands higher-significance ones toward one. A contrast value below 1.0 spreads pockets more evenly; above 1.0, only the highest-scoring pockets register strong color.
3. Zone Construction
Each pocket is drawn as a box:
Short liquidity pocket (at a pivot HIGH, bears trapped above): top = pivotHigh + ATR * bandWidth, bottom = pivotHigh
Long liquidity pocket (at a pivot LOW, bulls trapped below): top = pivotLow, bottom = pivotLow - ATR * bandWidth
ATR scaling ensures band width adapts to current volatility rather than using a fixed pip or point value. Short pockets color from yellow (low heat) through deeper yellows. Long pockets color from a faded cyan through solid cyan-blue. Both gradients are computed with color.from_gradient(heat, 0, 1, faded_base, solid_base) , making the heat ranking immediately readable at a glance.
4. Three-State Lifecycle
Every pocket passes through a defined state machine:
Active: The zone is untested. The box extends rightward each bar by the Extend Bars amount, keeping it visible on the current chart.
Hit (Frozen): Triggered when price sweeps through the midpoint of the zone (high >= midpoint AND low <= midpoint on the same bar). The box stops extending, color fades, and the label is removed — signaling that the pocket has been swept and liquidity likely absorbed.
Expired: When a pocket's age exceeds the Lookback setting without being hit, it is removed entirely and all associated arrays are cleaned up.
This lifecycle gives real-time feedback: solid, bright zones are intact and untested; faded zones have been swept; only the most recent, significant pockets within your lookback window are visible.
5. Scale Legend
A 24-cell gradient table is drawn on-chart running from the short liquidity color to the long liquidity color, providing a continuous reference for the heat scale being applied to all visible pockets.
---
Features
Pivot-anchored liquidity zones for both long and short trapped-participant scenarios
Three selectable liquidity metrics: Vol x Range, Volume only, Range only
Power-law contrast stretching for visual prioritization of high-significance zones
ATR-scaled zone width that adapts to current market volatility
Three-state lifecycle (Active → Hit → Expired) per pocket with visual state changes
Dual-color gradient system — cyan-blue for long pockets, yellow for short pockets
On-chart 24-cell heat scale legend
Configurable max pocket count to manage chart performance
Visual toggles for boxes, labels, and the legend table
---
Input Parameters
Pivot Left Bars (default 10): Bars required to the left of a pivot for confirmation. Higher values = fewer, more significant pivots.
Pivot Right Bars (default 5): Bars required to the right of a pivot for confirmation. Increasing this delays detection but improves pivot quality.
Lookback / Max Age (default 200): Maximum bar age before a pocket expires and is removed.
Max Pockets (default 50): Upper limit on simultaneous active pockets. Reducing this improves performance on lower-end charts.
ATR Length (default 14): Period for the ATR calculation used in band width scaling.
ATR Band Width (default 0.5): Multiplier applied to ATR to set zone height. Higher values create wider zones.
Extend Bars (default 50): How many bars ahead each active pocket box extends on each update.
Heat Contrast (default 0.5): Power-law exponent for contrast stretching. Values below 1.0 spread pockets more evenly; above 1.0 increases contrast between high and low scoring zones.
Metric Mode: Selects the liquidity scoring metric — Vol x Range, Volume, or Range.
Show Boxes / Show Labels / Show Legend: Individual visibility toggles for each visual component.
---
How to Use
Identifying high-priority zones: Bright, fully saturated boxes represent the highest-scoring untested liquidity pockets within your lookback window. These are the zones where the most volume-weighted trapped participants may be present.
Tracking swept zones: When a box fades, the pocket has been hit — price moved through its midpoint. Faded zones can serve as reference for areas that have already seen liquidity absorption.
Adjusting sensitivity: Increasing the left/right pivot bars reduces the total number of pivots detected, focusing only on more structurally significant swing points. Decreasing them creates a denser map suitable for shorter timeframes.
Interpreting the legend: The 24-cell scale legend in the corner maps the full gradient range, from the lowest-heat short pocket color to the highest-heat long pocket color.
Timeframe considerations: On higher timeframes (4H, Daily), fewer pivots form and each carries more weight. On lower timeframes, tightening the ATR band width and increasing heat contrast helps reduce visual clutter.
---
Limitations
Pivot detection is inherently lagging — a pivot is only confirmed after the right-side bars have closed, meaning the zone is plotted some bars after the pivot actually formed.
The liquidity metric scores a pocket by activity at the pivot bar itself , not the full swing sequence leading to it. A pivot formed on a single high-volume bar will score higher than one formed over a gradual, multi-bar move.
Volume data quality varies by broker and data feed. On instruments with unreliable or synthetic volume (some forex pairs, CFDs), the Vol x Range metric may not reflect true market participation.
The indicator does not account for partial fills or iceberg orders. A zone being "hit" means price swept through the midpoint — it does not confirm full liquidity absorption.
No indicator, including this one, predicts future price movement. A high-heat untested zone is an area of potential interest, not a guaranteed reversal or reaction point.
Performance may degrade on very active charts with high Max Pocket settings. Reduce Max Pockets if chart rendering slows.
The heat scale is relative to the current set of visible pockets. Adding more historical data (longer lookback) changes the normalization range and will recolor all currently visible pockets.
---
Originality Statement
Most liquidity mapping tools mark swing highs and lows with equal visual weight — every pivot gets the same line, box, or label. This indicator departs from that approach in three ways:
First , each pocket is scored by the product of volume and price range at its pivot bar (or volume/range alone as alternatives), producing a liquidity significance score rather than a binary present/absent mark.
Second , power-law contrast stretching is applied to the normalized scores, which means the visual encoding (color saturation) is non-linear. Minor pockets compress toward the faded end of the gradient; truly significant pockets expand toward the saturated end. This is a deliberate perceptual design choice — not simply coloring zones by value, but stretching the gradient to maximize discriminability at the high end.
Third , the three-state lifecycle (Active → Hit → Expired) treats each pocket as a dynamic object that responds to price action in real time. The visual state change on hit provides immediate feedback without requiring the trader to manually track which levels have been tested. The combination of significance scoring, contrast-stretched heat mapping, and lifecycle state management in a single overlay tool is the core contribution of this indicator.
---
Disclaimer
This indicator is provided for informational and educational purposes only. It does not constitute financial advice, investment advice, or a recommendation to buy or sell any asset. Past behavior of price around liquidity zones does not guarantee future behavior. All trading involves risk. You are solely responsible for your own trading decisions.
-Made with passion by officialjackofalltrades
Indicador Pine Script®






















