INVITE-ONLY SCRIPT

Liquidity sweep zone [Liquidation heatmap]

47
Liquidity Sweep Zone [Liquidation Heatmap]: Capturing Liquidity Hotspots with Multi-OI Data and Volume


Overview:
The "Liquidity Sweep Zone [Liquidation Heatmap]" indicator comprehensively analyzes changes in Open Interest (OI) and volume data from major cryptocurrency exchanges to visualize potential liquidity sweep areas in real-time. This script identifies price levels where long or short positions are heavily liquidated or new liquidity enters the market, marking these as 'liquidity hotspots'. It assists traders in identifying these critical price levels to predict potential market reversals or trend accelerations. As its name suggests, it effectively illustrates market liquidity flows in a manner similar to a liquidation heatmap.


Features and Originality:

Multi-OI Data Source Integration and OI Delta Analysis:

Multi-Exchange Data: Utilizes integrated real-time Open Interest (OI) data from five major exchanges: Binance, Bybit, OKX, Bitget, and HTX. This approach reduces market bias that might arise from relying on single-exchange data, providing a more comprehensive understanding of overall market position changes.

Accurate Data Requests: Employs the request.security() function to fetch OI data for the current timeframe. Crucially, it uses lookahead=barmerge.lookahead_off and gaps=barmerge.gaps_on settings to entirely eliminate potential lookahead bias during data requests, ensuring the integrity and accuracy of historical data.

OI Delta Calculation: Accurately calculates the change in OI (delta) for each exchange and sums them to derive the total OI delta. This total OI delta represents the net change in market participants' positions, strongly indicating significant liquidity inflow or outflow at specific price levels, especially when coinciding with price movements.


Smart Volume-Based Liquidity Zone Identification:

Filtered Volume: Considers a trade as 'filtered significant trade' when the current bar's volume (volume) is higher than its 14-period Simple Moving Average volume (ta.sma(volume, 14)). This identifies significant large-scale trading activities that genuinely impact market movements, rather than just any volume spike.

Price-Specific Liquidity Marking: When such filtered volume spikes occur, potential buy or sell liquidity lines are drawn on the chart based on the bar's close and open prices. If the close is higher than the open, a line is drawn near the low, indicating long liquidation liquidity. If the close is lower than the open, a line is drawn near the high, indicating short liquidation liquidity.


Dynamic Visualization and Strength-Based Coloring/Thickness:

Gradient Coloring: Utilizes a custom color.from_gradient() method to apply a gradient effect to liquidity lines. This gradient visually represents the 'strength' (volume or OI delta value) of the liquidity zone, with stronger liquidity areas displayed in deeper colors, enabling intuitive perception of strength.


Strength-Based Line Thickness and Color:

Liquidity lines with maximum strength are displayed as the thickest and most prominent using highLevelColor (default yellow), emphasizing them as the most crucial liquidity areas.

Second maximum strength lines are also highlighted with additional thickness and secondHighLevelColor (default yellow).

Lines with above-average strength are shown with medium thickness and lowLevelColor or midLevelColor, while below-average lines are thinner, creating a visual hierarchy based on liquidity strength.

Line Persistence and Updates: Liquidity lines extend horizontally until the current bar closes via the updateVolumeLiquidityLine and updateOILiquidityLine methods, suggesting that these price levels remain valid liquidity areas for a certain period.


Customizable Multi-Timeframe Support:

Timeframe Filtering: Allows individual selection of whether to display liquidity lines on various timeframes, ranging from 1 minute to 2 hours. This enables users to focus liquidity information on their timeframes of interest.

Timeframe-Specific Line Thickness: The thickness of liquidity lines can be individually set for each timeframe. This allows for customization based on user preference, such as thinner lines for longer timeframes and thicker lines for shorter ones.


Liquidity Position Type Filtering:

The "Liquidity positions" option allows filtering to display liquidity for 'All' positions, 'Long' positions, or 'Short' positions only. This is useful when wanting to focus solely on liquidity hotspots for a specific direction.


Alert Functionality:

Provides a feature to alert users when new high-strength volume-based liquidity zones (isNewHighVolumeLongZone, isNewHighVolumeShortZone) and OI-based liquidity zones (isNewHighOILongZone, isNewHighOIShortZone) are formed. This enables traders to react instantly to significant market changes and seize opportunities.


How to Use:

Add Indicator: Add the "Liquidity Sweep Zone [Liquidation Heatmap]" indicator to your TradingView chart.

Select OI Data Sources: In the "OI Data Sources" group, select the exchanges whose Open Interest (OI) data you wish to include in the analysis.


Display and Visualization Settings:

In the "Display" group, you can customize the visual representation by adjusting the Liquidity multiplier, Liquidity positions type, and the colors for low, mid, and high-level liquidity lines (Low level, Mid level, High level, 2nd High level).

In the "Display Liquidity on Timeframes" group, select whether to display liquidity lines on the currently used timeframe.

In the "Line Thickness by Timeframe" group, set the thickness of liquidity lines for each timeframe to adjust visual density.

In the "OI Line Display" group, you can set the visibility of OI liquidity lines, colors for OI Long and Short positions, and the OI line width.

Alert Settings (Optional): In the "Alerts" group, enable the alert function and customize the alert messages for each type of liquidity.


Chart Analysis:

Pay close attention to the liquidity lines displayed on the chart. Especially, the thickest and brightest lines indicate major liquidity hotspots where large amounts of long or short positions are concentrated.

When the price approaches or reaches these liquidity zones, anticipate potential buy/sell pressure, stop-loss triggers, position liquidations, leading to price reversals or trend accelerations in that area. This indicator effectively serves as a heatmap visually representing potential liquidation levels in the market.

Analyze OI liquidity lines and volume liquidity lines together to understand the overall market liquidity flow and the strength of specific positions.


Conceptual Background:

This script is based on the market structure principle that "smart money" or "large traders" tend to drive prices towards areas where significant liquidity (liquidations and unfulfilled orders) is concentrated. These liquidity sweeps often serve as triggers for price reversals or accelerators for existing trends.

Volume Liquidity: Abnormally high volume at specific price levels indicates that many participants previously traded at those prices. This suggests that liquidity pools, which can act as critical support or resistance levels in the future, still exist.

Open Interest (OI) Liquidity: A sharp increase in OI signifies a large build-up of new positions, while a decrease indicates the liquidation of existing positions. Particularly, when OI delta changes significantly along with price movements, it strongly suggests a large influx or liquidation of long/short positions at specific price levels. This can trigger potential liquidation cascades and effectively acts as a 'liquidation heatmap'.

By integrating these liquidity metrics, this indicator helps traders visually identify the 'hidden' order flow and potential liquidation levels in the market. It empowers them to proactively understand critical price areas that could influence market direction. This is particularly useful for enhancing short-term trading and scalping strategies in futures and margin trading.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.