Liquidation Volume Range Heatmap

The signals generated by this indicator (such as momentum arrows, sweeps, and reversals) are calculated purely for statistical and mathematical visualization. Under no circumstances do they constitute trading signals, financial advice, or recommendations of any kind to buy or sell any financial asset. Leveraged trading involves significant risk, and historical calculations do not guarantee future market behavior.
---
LIQUIDATION VOLUME RANGE HEATMAP (GRID ENGINE)
The Liquidation Volume Range Heatmap is a high-performance visual tool designed to estimate and map potential price regions where leveraged trading positions are likely to undergo liquidation. Rather than displaying raw trading volumes, this indicator calculates and projects cumulative liquidation density across a dynamic price grid, highlighting critical areas of latent liquidity.
A KEY DIFFERENTIATOR: HISTORICAL WINDOW ENGINE
By restricting computations to a user-configured window (default: 500 lookback bars), this indicator achieves a major performance advantage. It allows the script to dynamically simulate and render historical liquidation zones on past bars inside the 500-bar window, rather than only calculating values on the current live bar. This provides traders with historical visibility of past liquidation zones.
TECHNICAL OVERVIEW
1. Leverage Tier Simulation
The indicator projects potential liquidation levels by simulating market orders within a configurable leverage range. The user defines the extreme boundaries of the calculation, such as a Minimum Leverage of 10x and a Maximum Leverage of 25x. The engine then loops through every integer tier in between (calculating 10x, then 11x, 12x, and so on, up to 25x), computing the liquidation prices for both long and short positions at each individual level. This creates a detailed, layered heatmap of historical leverage clusters.
2. Original Liquidation Modeling
Rather than using a single, rigid exchange formula, the script utilizes a generic adaptation of the formulas that exchanges typically expose to calculate their liquidation levels. This is an original and proprietary adaptation.
3. Volume Allocation Modes
Traders can choose how volume is distributed across the simulated leverage tiers:
- Nominal Position Volume: Assigns the candle volume equally to all simulated leverage levels.
- Real Margin Volume (Weighted): Inversely scales the volume allocation based on the leverage multiplier (Volume * 100 / Leverage). This mathematically reflects that higher-leverage positions represent smaller initial margin allocations at risk.
4. Dynamic Heatmap Generation
- Dynamic Tick-Aligned Price Clustering: Groups active liquidation prices into discrete grid levels (bins).
- Stateless Auto-Clustering: Under the "Automatic" step mode, the price step size is calculated by dividing the maximum high-low price range of the lookback window by the configured grid division level. To ensure perfect cross-instance synchronization, this step size is rounded to the nearest standard financial increment (e.g., 0.01, 0.1, 1.0, 10.0, etc.) and aligned with the symbol's minimum tick size.
- Price Interaction (Hit Testing): If the price breaches a grid level, the simulated volume for the corresponding active long or short liquidations is instantly removed, simulating order triggering and execution.
WHY DO LIQUIDATION ZONES DISAPPEAR AND REAPPEAR?
Zones visible on the chart can disappear for two main reasons:
1. Time-Based Decay: Positions naturally expire or close over time.
2. TradingView Plot Limits: Due to TradingView's platform limits (maximum of 64 plots per script), this indicator is restricted to rendering the 15 closest estimated active zones below the price and the 15 closest estimated active zones above the price (30 zones in total per instance).
Because the indicator maintains a persistent memory of by far more than 15 per simulated leverage active liquidation levels in its internal arrays, zones that move out of this "top 15" range will disappear from the screen. However, if the price returns to that range and the zone has not been hit/liquidated or fully decayed, the indicator will draw it again because it is still retained in the indicator's memory.
THE ADVANCEMENT OF TIME-BASED DECAY
A major breakthrough in this indicator's logic is the inclusion of the Time-Based Decay feature. Traditional liquidation zone models mistakenly assume that liquidation regions remain active forever. In reality, positions are constantly being closed, adjusted, or hedged. Assuming zones stay active eternally leads to significant errors in simulation. Activating the time-decay configuration dynamically subtracts volume over time (scaled by the leverage multiplier), which could improve the accuracy of the simulated zones.
5. Mathematical Signals
- Momentum Arrows: Triggered when a significant portion of simulated liquidation volume is triggered (liquidated) relative to the candle's total volume.
- Reversal Signals: Prompted when price successfully sweeps a high-density estimated liquidation zones region and reverses within a specified bar validity window.
- Probability Arrows: Highlights imbalances in regional liquidation clusters, plotting directional arrows toward the side of the chart containing the higher concentration of near-term liquidation weight.
CONFIGURATION SETTINGS AND INPUTS
1. Leverage Range Settings
- Minimum Leverage (x): The lowest leverage level to calculate (default: 10x).
- Maximum Leverage (x): The highest leverage level to calculate (default: 25x). All integer leverage steps between these boundaries are simulated.
2. Grid & Clustering Settings
- Price Step Mode:
* "Automatic" (Recommended): Dynamically calculates step size based on current market volatility and rounds it to clean financial intervals.
* "Manual": Spans static grid lines using a user-defined step size.
- Price Clustering Step (Manual): The step size used when Price Step Mode is set to "Manual".
- Lookback Bars Count: Limits calculations to the last N bars (default: 500). By restricting this, the script is able to calculate and render historical liquidation zones dynamically within these 500 bars.
- Volume Sensitivity Scale: Calibrates how quickly colors reach maximum saturation.
3. Volume & Order Settings
- Volume Allocation Mode: Toggle between Nominal Position Volume and Real Margin Volume (Weighted).
- Reverse Orders (Liquidity Flip): Inverts buy/sell allocations for contrarian and liquidity analysis.
4. Decay Settings
- Enable Time-Based Decay/Expiration: Toggles the simulated expiration and subtraction of old liquidation volume over time.
5. Visual Settings
- Grid Plot Shape Style: Choose between Square and Cross shapes for the heatmap grids.
- Color Palette Theme: Multiple palettes available, including Viridis (Default), Cividis, Jet, Blackbody, Hot, Picnic, Gray to Red/Yellow, Green to White, and Monochrome.
- Reverse Color Scale: Inverts the color direction mapping.
- Calibrated Min/Max Volume (2nd Pass): Manual thresholds to override dynamic normalization.
- Show Calibration Dashboard Guide: Toggles the visibility of the real-time statistics panel in the top-right corner.
6. Multi-Instance Settings
- Grid Starting Level Index: Offset index for multi-indicator stacking. Because TradingView restricts each script to 64 plot outputs, you can stack multiple instances to bypass this limit (e.g., Instance 1 starting at index 1, Instance 2 starting at index 16 to render 30 complete levels).
7. Signals Configuration
- Show Momentum Arrows / Strong Momentum X / Reversal / Probability Arrows: Individual toggles to display or hide the corresponding mathematical signals on the chart.
- Reversal Max Validity (Bars): The maximum lifespan (in bars) allowed for a price reversal to occur.
8. Grid Division Settings
- Auto-Clustering Grid Levels Division: The divisor used to split the lookback range (default: 40).
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả chấp thuận mới có thể truy cập tập lệnh này. Bạn sẽ cần yêu cầu và được cấp quyền sử dụng. Thông thường quyền này được cấp sau khi thanh toán. Để biết thêm chi tiết, làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với egsand.
TradingView KHÔNG khuyến nghị bạn trả phí hoặc sử dụng một tập lệnh trừ khi bạn hoàn toàn tin tưởng vào tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm các lựa chọn miễn phí, mã nguồn mở trong các script cộng đồng của chúng tôi.
Hướng dẫn của tác giả
Thông báo miễn trừ trách nhiệm
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả chấp thuận mới có thể truy cập tập lệnh này. Bạn sẽ cần yêu cầu và được cấp quyền sử dụng. Thông thường quyền này được cấp sau khi thanh toán. Để biết thêm chi tiết, làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với egsand.
TradingView KHÔNG khuyến nghị bạn trả phí hoặc sử dụng một tập lệnh trừ khi bạn hoàn toàn tin tưởng vào tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm các lựa chọn miễn phí, mã nguồn mở trong các script cộng đồng của chúng tôi.