OPEN-SOURCE SCRIPT
Simulated Liquidation Heatmap [QuantAlgo]

🟢 Overview
This indicator visualizes where clusters of stop-loss orders and liquidation levels are likely located, displayed as a 'heatmap'. It's based on the concept of market structure liquidity: large groups of stop orders tend to gather around obvious technical levels (like swing highs and lows), and these pools of orders often attract price movement from institutional traders. The indicator uses a fractal-based algorithm to identify these high-probability liquidation zones and displays them as dynamic, color-coded boxes.
The key feature is the thermal color gradient, which indicates the freshness (age) and therefore the relative relevance of the liquidity zone. Hot colors (e.g., Red/Yellow) represent fresh clusters that have just formed, suggesting strong and immediate liquidity interest. Cold colors (e.g., Blue/Purple) represent aged or decaying clusters that are becoming less relevant over time. This visualization allows traders to anticipate potential liquidity sweeps (stop hunts) and understand areas of significant retail and institutional positioning.

🟢 Key Features
1. Liquidity Zone Heatmap
The core function is the identification of swing high and swing low price points using a user-defined Lookback period. These points are where retail traders are statistically most likely to place their stop-loss orders. The indicator simulates the clustering of these orders by drawing a zone (box) around the detected swing point, with the vertical size controlled by the Stop/Liquidation Zone Width (%) setting.
▶ Cluster Lookback: Defines the sensitivity of swing point detection. Lower values detect frequent, minor zones (scalping/intraday); higher values detect major, stronger swing points (swing trading).
▶ Zone Width (%): Sets the percentage range above and below the swing point where stops are simulated to cluster, accounting for slippage and typical stop placement spread.
▶ Liquidity Decay: Zones gradually fade in color intensity and are eventually removed after the user-defined Liquidity Decay Period (Bars), ensuring the heatmap only displays relevant, current liquidity areas.
▶ Round Number Filter: An optional filter that limits the display to liquidity zones occurring only at psychologically significant round numbers (e.g., $100, $1,500.00), which typically attract higher concentrations of orders.

2. Thermal Color Gradient
The heatmap's color is a direct function of the zone's age, providing a visual proxy for immediate relevance.
▶ Freshness: Newly created zones are displayed in the Hot Color (high relevance).
▶ Decay: As bars pass, the zone color transitions along the gradient toward the Cold Color and increased transparency (lower relevance), until it is removed entirely.

▶ Color Schemes: Multiple pre-configured and custom color schemes are available to optimize the visualization for different chart themes and color preferences.








3. Liquidity Heat Thermometer
An optional visual thermometer is displayed on the chart to provide an instant, overall assessment of the current liquidation heat level in the immediate vicinity of the price.
▶ Calculation: The thermometer calculates an aggregate heat score based on the age and proximity of all liquidity zones within a user-defined Zone Detection Range (%) of the current price.
▶ Visual Feedback: A marker (triangle) points to the corresponding level on the thermometer's color gradient (Hot to Cold). A high reading indicates price is close to fresh, dense stop clusters, suggesting high volatility or an imminent liquidity sweep is probable. A low reading indicates price is in a low-density or aged liquidity area.
▶ Customization: The thermometer's resolution, position, and text size are fully customizable for optimal chart placement and readability.

🟢 Practical Applications
▶ Anticipate Sweeps: Prioritize trading in the direction of Hot (fresh) liquidity zones. For example, a hot low-side zone suggests strong sell-side liquidity (stop-losses) is available for large buyers to sweep.
▶ Filter Noise: Use the Round Number Filter to focus only on the highest probability liquidation zones, which are often at clean, psychological price levels.
▶ Validate Entries: Combine the Heat Thermometer with price action analysis. A rising heat level indicates increasing proximity to a major stop cluster, signaling a potential turn or an aggressive market move to sweep those stops.
▶ Risk Management: Understand that price often acts dynamically around these zones. High heat levels imply high risk/reward setups; stops should be placed strategically beyond the defined Liquidation Zone Width.
▶ Multi-Timeframe Context: Higher timeframes (e.g., Daily, 4-Hour) often reveal more significant, major liquidity zones. Use this indicator on lower timeframes (e.g., 5-min, 15-min) for execution, but prioritize zones that align with higher-timeframe structures.
This indicator visualizes where clusters of stop-loss orders and liquidation levels are likely located, displayed as a 'heatmap'. It's based on the concept of market structure liquidity: large groups of stop orders tend to gather around obvious technical levels (like swing highs and lows), and these pools of orders often attract price movement from institutional traders. The indicator uses a fractal-based algorithm to identify these high-probability liquidation zones and displays them as dynamic, color-coded boxes.
The key feature is the thermal color gradient, which indicates the freshness (age) and therefore the relative relevance of the liquidity zone. Hot colors (e.g., Red/Yellow) represent fresh clusters that have just formed, suggesting strong and immediate liquidity interest. Cold colors (e.g., Blue/Purple) represent aged or decaying clusters that are becoming less relevant over time. This visualization allows traders to anticipate potential liquidity sweeps (stop hunts) and understand areas of significant retail and institutional positioning.
🟢 Key Features
1. Liquidity Zone Heatmap
The core function is the identification of swing high and swing low price points using a user-defined Lookback period. These points are where retail traders are statistically most likely to place their stop-loss orders. The indicator simulates the clustering of these orders by drawing a zone (box) around the detected swing point, with the vertical size controlled by the Stop/Liquidation Zone Width (%) setting.
▶ Cluster Lookback: Defines the sensitivity of swing point detection. Lower values detect frequent, minor zones (scalping/intraday); higher values detect major, stronger swing points (swing trading).
▶ Zone Width (%): Sets the percentage range above and below the swing point where stops are simulated to cluster, accounting for slippage and typical stop placement spread.
▶ Liquidity Decay: Zones gradually fade in color intensity and are eventually removed after the user-defined Liquidity Decay Period (Bars), ensuring the heatmap only displays relevant, current liquidity areas.
▶ Round Number Filter: An optional filter that limits the display to liquidity zones occurring only at psychologically significant round numbers (e.g., $100, $1,500.00), which typically attract higher concentrations of orders.
2. Thermal Color Gradient
The heatmap's color is a direct function of the zone's age, providing a visual proxy for immediate relevance.
▶ Freshness: Newly created zones are displayed in the Hot Color (high relevance).
▶ Decay: As bars pass, the zone color transitions along the gradient toward the Cold Color and increased transparency (lower relevance), until it is removed entirely.
▶ Color Schemes: Multiple pre-configured and custom color schemes are available to optimize the visualization for different chart themes and color preferences.
3. Liquidity Heat Thermometer
An optional visual thermometer is displayed on the chart to provide an instant, overall assessment of the current liquidation heat level in the immediate vicinity of the price.
▶ Calculation: The thermometer calculates an aggregate heat score based on the age and proximity of all liquidity zones within a user-defined Zone Detection Range (%) of the current price.
▶ Visual Feedback: A marker (triangle) points to the corresponding level on the thermometer's color gradient (Hot to Cold). A high reading indicates price is close to fresh, dense stop clusters, suggesting high volatility or an imminent liquidity sweep is probable. A low reading indicates price is in a low-density or aged liquidity area.
▶ Customization: The thermometer's resolution, position, and text size are fully customizable for optimal chart placement and readability.
🟢 Practical Applications
▶ Anticipate Sweeps: Prioritize trading in the direction of Hot (fresh) liquidity zones. For example, a hot low-side zone suggests strong sell-side liquidity (stop-losses) is available for large buyers to sweep.
▶ Filter Noise: Use the Round Number Filter to focus only on the highest probability liquidation zones, which are often at clean, psychological price levels.
▶ Validate Entries: Combine the Heat Thermometer with price action analysis. A rising heat level indicates increasing proximity to a major stop cluster, signaling a potential turn or an aggressive market move to sweep those stops.
▶ Risk Management: Understand that price often acts dynamically around these zones. High heat levels imply high risk/reward setups; stops should be placed strategically beyond the defined Liquidation Zone Width.
▶ Multi-Timeframe Context: Higher timeframes (e.g., Daily, 4-Hour) often reveal more significant, major liquidity zones. Use this indicator on lower timeframes (e.g., 5-min, 15-min) for execution, but prioritize zones that align with higher-timeframe structures.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
🎁🎄 Christmas SALE 50% Off with code XMAS50 (ends Dec 28) at whop.com/quantalgo/
📩 DM if you need any custom-built indicators or strategies.
📩 DM if you need any custom-built indicators or strategies.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
🎁🎄 Christmas SALE 50% Off with code XMAS50 (ends Dec 28) at whop.com/quantalgo/
📩 DM if you need any custom-built indicators or strategies.
📩 DM if you need any custom-built indicators or strategies.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.