OPEN-SOURCE SCRIPT
Liquidity Heatmap SwiftEdge

Description
Liquidity Heatmap with Buy/Sell Side (Blue/Red) is a technical analysis tool designed to help traders identify potential liquidity zones in the market by combining swing high/low detection with volume analysis, visualized as a heatmap overlay on the chart. This script highlights areas where significant buying or selling pressure may exist, often acting as support or resistance levels, and provides a clear visual representation of these zones using color-coded heatmap boxes and labeled bubbles.
What It Does
The script identifies key price levels (swing highs and lows) where liquidity is likely to be concentrated, such as stop-loss clusters or pending orders. These levels are then grouped into a heatmap, with blue zones representing potential buy-side liquidity (below the current price) and red zones indicating sell-side liquidity (above the current price). Each zone is marked with a bubble showing the estimated liquidity amount, derived from volume data, to help traders gauge the strength of the level.
How It Works
The script combines three main components to create a comprehensive liquidity visualization:
Swing Highs and Lows Detection:
The script uses the ta.pivothigh and ta.pivotlow functions to identify swing highs and lows over a user-defined lookback period (Swing Length). These levels often represent areas where price has reversed, indicating potential liquidity zones where stop-losses or pending orders may be placed.
Volume Analysis:
Volume data at each swing high/low is captured and averaged over a specified period (Volume Average Length). This volume is then scaled using a multiplier (Volume Multiplier for Liquidity) to estimate the liquidity amount at each level, displayed in thousands (e.g., "10K") on the chart via labeled bubbles.
Heatmap Visualization:
The identified levels are grouped into price bins to form a heatmap. The price range is divided into a user-defined number of bins (Number of Heatmap Bins), and each bin is drawn as a colored box (blue for buy-side, red for sell-side). The transparency of the heatmap boxes can be adjusted (Heatmap Transparency) to ensure they do not obscure the price action.
Why Combine These Components?
The combination of swing highs/lows, volume analysis, and a heatmap provides a powerful way to visualize liquidity in the market. Swing highs and lows are natural points where liquidity tends to accumulate, as they often coincide with areas where traders place stop-losses or pending orders. By incorporating volume data, the script quantifies the potential strength of these levels, giving traders insight into the magnitude of liquidity present. The heatmap visualization then aggregates these levels into a clear, color-coded overlay, making it easy to see where buy-side and sell-side liquidity is concentrated without cluttering the chart.
This mashup is particularly useful because it bridges price action (swing levels), market activity (volume), and visual clarity (heatmap), offering a holistic view of potential support and resistance zones that might influence price movements.
How to Use It
Add the Indicator to Your Chart:
Apply the script to your chart by adding it from the Pine Script library. It will overlay directly on your price chart.
Interpret the Heatmap:
Blue Zones (Buy-Side Liquidity): These appear below the current price and indicate levels where buying pressure or stop-losses from short positions may be located.
Red Zones (Sell-Side Liquidity): These appear above the current price and indicate levels where selling pressure or stop-losses from long positions may be located.
The intensity of the color is controlled by the Heatmap Transparency setting—lower values make the zones more opaque, while higher values make them more transparent.
Analyze the Bubbles:
Each liquidity zone is marked with a bubble showing the estimated liquidity amount in thousands (e.g., "10K"). The size of the bubble is scaled by the Bubble Size Multiplier, with larger bubbles indicating higher liquidity.
Adjust Settings for Your Needs:
Liquidity Settings:
Swing Length: Controls the lookback period for detecting swing highs and lows. A smaller value (e.g., 10) is better for shorter timeframes like 1-minute charts, while a larger value (e.g., 50) suits higher timeframes.
Liquidity Threshold: Defines how close two levels must be to be considered the same, preventing duplicate zones.
Volume Average Length: Sets the period for averaging volume data at swing points.
Volume Multiplier for Liquidity: Scales the volume to estimate liquidity amounts shown in the bubbles.
Lookback Period (Hours): Limits how far back the script looks for liquidity zones.
Use Price Window Filter: If enabled, only shows zones within a price range defined by Liquidity Window (Points per Side).
Heatmap Settings:
Number of Heatmap Bins: Determines how many price bins the heatmap is divided into. More bins create a finer resolution but may clutter the chart.
Heatmap Bin Height (Points): Sets the vertical height of each heatmap box in price points.
Heatmap Transparency: Adjusts the transparency of the heatmap boxes (0 = fully opaque, 100 = fully transparent).
Display Settings:
Bubble Size Multiplier: Scales the size of the bubbles showing liquidity amounts.
Trading Application:
Use the heatmap to identify potential support (blue zones) and resistance (red zones) levels where price may react.
Pay attention to zones with larger bubbles, as they indicate higher liquidity and may have a stronger impact on price.
Combine with other analysis tools (e.g., trendlines, indicators) to confirm trade setups.
What Makes It Original?
This script stands out by integrating swing high/low detection with volume-based liquidity estimation and a heatmap visualization in a single tool. Unlike traditional support/resistance indicators that only plot static lines, this script dynamically aggregates liquidity zones into a heatmap, making it easier to see clusters of potential buying or selling pressure. The addition of volume-derived liquidity amounts in labeled bubbles provides a unique quantitative measure of each zone's strength, helping traders prioritize key levels. The color-coded buy/sell distinction further enhances its utility by visually separating zones based on their likely market impact.
Example Use Case
On a 1-minute chart of EUR/USD, you might set Swing Length to 10 to capture short-term pivots, Lookback Period (Hours) to 4 to focus on recent data, and Liquidity Window to 200 points (20 pips) to show only nearby zones. The heatmap will then display blue zones below the current price where buy-side liquidity may act as support, and red zones above where sell-side liquidity may act as resistance. A bubble showing "50K" at a blue zone indicates significant buy-side liquidity, suggesting a potential bounce if the price approaches that level.
Liquidity Heatmap with Buy/Sell Side (Blue/Red) is a technical analysis tool designed to help traders identify potential liquidity zones in the market by combining swing high/low detection with volume analysis, visualized as a heatmap overlay on the chart. This script highlights areas where significant buying or selling pressure may exist, often acting as support or resistance levels, and provides a clear visual representation of these zones using color-coded heatmap boxes and labeled bubbles.
What It Does
The script identifies key price levels (swing highs and lows) where liquidity is likely to be concentrated, such as stop-loss clusters or pending orders. These levels are then grouped into a heatmap, with blue zones representing potential buy-side liquidity (below the current price) and red zones indicating sell-side liquidity (above the current price). Each zone is marked with a bubble showing the estimated liquidity amount, derived from volume data, to help traders gauge the strength of the level.
How It Works
The script combines three main components to create a comprehensive liquidity visualization:
Swing Highs and Lows Detection:
The script uses the ta.pivothigh and ta.pivotlow functions to identify swing highs and lows over a user-defined lookback period (Swing Length). These levels often represent areas where price has reversed, indicating potential liquidity zones where stop-losses or pending orders may be placed.
Volume Analysis:
Volume data at each swing high/low is captured and averaged over a specified period (Volume Average Length). This volume is then scaled using a multiplier (Volume Multiplier for Liquidity) to estimate the liquidity amount at each level, displayed in thousands (e.g., "10K") on the chart via labeled bubbles.
Heatmap Visualization:
The identified levels are grouped into price bins to form a heatmap. The price range is divided into a user-defined number of bins (Number of Heatmap Bins), and each bin is drawn as a colored box (blue for buy-side, red for sell-side). The transparency of the heatmap boxes can be adjusted (Heatmap Transparency) to ensure they do not obscure the price action.
Why Combine These Components?
The combination of swing highs/lows, volume analysis, and a heatmap provides a powerful way to visualize liquidity in the market. Swing highs and lows are natural points where liquidity tends to accumulate, as they often coincide with areas where traders place stop-losses or pending orders. By incorporating volume data, the script quantifies the potential strength of these levels, giving traders insight into the magnitude of liquidity present. The heatmap visualization then aggregates these levels into a clear, color-coded overlay, making it easy to see where buy-side and sell-side liquidity is concentrated without cluttering the chart.
This mashup is particularly useful because it bridges price action (swing levels), market activity (volume), and visual clarity (heatmap), offering a holistic view of potential support and resistance zones that might influence price movements.
How to Use It
Add the Indicator to Your Chart:
Apply the script to your chart by adding it from the Pine Script library. It will overlay directly on your price chart.
Interpret the Heatmap:
Blue Zones (Buy-Side Liquidity): These appear below the current price and indicate levels where buying pressure or stop-losses from short positions may be located.
Red Zones (Sell-Side Liquidity): These appear above the current price and indicate levels where selling pressure or stop-losses from long positions may be located.
The intensity of the color is controlled by the Heatmap Transparency setting—lower values make the zones more opaque, while higher values make them more transparent.
Analyze the Bubbles:
Each liquidity zone is marked with a bubble showing the estimated liquidity amount in thousands (e.g., "10K"). The size of the bubble is scaled by the Bubble Size Multiplier, with larger bubbles indicating higher liquidity.
Adjust Settings for Your Needs:
Liquidity Settings:
Swing Length: Controls the lookback period for detecting swing highs and lows. A smaller value (e.g., 10) is better for shorter timeframes like 1-minute charts, while a larger value (e.g., 50) suits higher timeframes.
Liquidity Threshold: Defines how close two levels must be to be considered the same, preventing duplicate zones.
Volume Average Length: Sets the period for averaging volume data at swing points.
Volume Multiplier for Liquidity: Scales the volume to estimate liquidity amounts shown in the bubbles.
Lookback Period (Hours): Limits how far back the script looks for liquidity zones.
Use Price Window Filter: If enabled, only shows zones within a price range defined by Liquidity Window (Points per Side).
Heatmap Settings:
Number of Heatmap Bins: Determines how many price bins the heatmap is divided into. More bins create a finer resolution but may clutter the chart.
Heatmap Bin Height (Points): Sets the vertical height of each heatmap box in price points.
Heatmap Transparency: Adjusts the transparency of the heatmap boxes (0 = fully opaque, 100 = fully transparent).
Display Settings:
Bubble Size Multiplier: Scales the size of the bubbles showing liquidity amounts.
Trading Application:
Use the heatmap to identify potential support (blue zones) and resistance (red zones) levels where price may react.
Pay attention to zones with larger bubbles, as they indicate higher liquidity and may have a stronger impact on price.
Combine with other analysis tools (e.g., trendlines, indicators) to confirm trade setups.
What Makes It Original?
This script stands out by integrating swing high/low detection with volume-based liquidity estimation and a heatmap visualization in a single tool. Unlike traditional support/resistance indicators that only plot static lines, this script dynamically aggregates liquidity zones into a heatmap, making it easier to see clusters of potential buying or selling pressure. The addition of volume-derived liquidity amounts in labeled bubbles provides a unique quantitative measure of each zone's strength, helping traders prioritize key levels. The color-coded buy/sell distinction further enhances its utility by visually separating zones based on their likely market impact.
Example Use Case
On a 1-minute chart of EUR/USD, you might set Swing Length to 10 to capture short-term pivots, Lookback Period (Hours) to 4 to focus on recent data, and Liquidity Window to 200 points (20 pips) to show only nearby zones. The heatmap will then display blue zones below the current price where buy-side liquidity may act as support, and red zones above where sell-side liquidity may act as resistance. A bubble showing "50K" at a blue zone indicates significant buy-side liquidity, suggesting a potential bounce if the price approaches that level.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.