OI Liquidation Map [Golden_WolfAI]

1 086
Golden WolfAI — OI Liquidation Map

Golden WolfAI — OI Liquidation Map is an Open Interest–based market structure indicator designed to visualize potential leveraged-position buildup and estimate price areas where liquidation pressure may be concentrated.

The script combines changes in Open Interest, price direction, statistical normalization, estimated leverage levels, and a liquidation-density profile to create a structured view of leveraged market positioning directly on the chart.

Unlike indicators that simply plot raw Open Interest, this tool focuses on identifying unusually large OI expansions and converting those events into estimated liquidation levels for several leverage categories.

The result is a dynamic map of potential long and short liquidation areas, accompanied by a density profile and two information dashboards.

Core Concept

A rise in Open Interest means that additional derivative exposure is entering the market, but Open Interest alone does not identify whether the new positioning is predominantly long or short.

This indicator uses a simple directional heuristic:

Open Interest rising + price rising → Long buildup

Open Interest rising + price falling → Short buildup

Only positive OI expansions are used to create new liquidation zones.

The objective is not to reconstruct individual exchange positions. Instead, the script uses abnormal changes in aggregate Open Interest as a proxy for newly created leveraged exposure and projects theoretical liquidation prices from those events.

Open Interest Data

The indicator automatically constructs an Open Interest symbol for a Binance USDT perpetual contract based on the base currency of the current chart.

Example:

BTC chart → Binance BTCUSDT perpetual Open Interest

ETH chart → Binance ETHUSDT perpetual Open Interest

The Open Interest data is requested on the same timeframe as the active chart.

If a corresponding Binance USDT perpetual Open Interest symbol is unavailable, the indicator may not be able to generate OI-based information for that asset.

OI Impulse Detection

Raw changes in Open Interest can have very different significance depending on the asset, timeframe and current market environment.

For that reason, the indicator does not rely on a fixed numerical OI threshold.

Instead, it calculates:

ΔOI = Current Open Interest − Previous Open Interest

The absolute OI change is then compared with its recent statistical distribution.

The script calculates the mean and standard deviation of historical absolute OI changes and converts the current change into a z-score.

Importantly, the current OI impulse is excluded from its own statistical baseline. This prevents an unusually large current observation from immediately increasing the average and standard deviation used to evaluate itself.

The resulting OI z-score measures how unusual the current Open Interest movement is relative to recent behavior.

OI Impulse Strength

OI expansions are classified into three configurable categories:

SMALL

Default z-score threshold: 1.0

MEDIUM

Default z-score threshold: 2.0

LARGE

Default z-score threshold: 3.0

These thresholds can be modified in the indicator settings.

A higher classification represents a more statistically unusual Open Interest expansion relative to the selected normalization window.

By default, the normalization length is 60 bars.

Signal Confirmation

New liquidation clusters are generated only when:

Open Interest data is available;

ΔOI is positive;

the OI z-score reaches at least the Small Impulse threshold;

price direction identifies either a long or short buildup;

the chart bar is confirmed.

This means historical liquidation clusters are created from confirmed bars rather than from temporary intrabar price movements.

The price used as the estimated entry reference for a new positioning event is the bar's OHLC4 value.

Directional Positioning Heuristic

When a qualifying OI expansion occurs, the script determines its estimated direction using price movement.

Long buildup

If:

OI increases
and
Close > Previous Close

the expansion is classified as a potential long buildup.

The indicator then projects liquidation levels below the estimated entry price.

Short buildup

If:

OI increases
and
Close < Previous Close

the expansion is classified as a potential short buildup.

The indicator then projects liquidation levels above the estimated entry price.

This directional interpretation is intentionally a heuristic.

The script does not have access to individual trader entries, account positions, long/short ownership of each OI contract, wallet balances or exchange liquidation records.

Leverage-Based Liquidation Map

Each qualifying OI event can create multiple estimated liquidation levels.

The leverage spectrum depends on the strength of the OI impulse.

Small OI impulse

Creates estimated liquidation levels for:

25x
50x
100x

Medium OI impulse

Creates estimated liquidation levels for:

10x
25x
50x
100x

Large OI impulse

Creates the widest liquidation cluster:

5x
10x
25x
50x
100x

The idea is that stronger OI expansions contribute information across a wider hypothetical leverage spectrum.

Each leverage group has its own configurable color, making it possible to distinguish different leverage levels visually.

Liquidation Price Model

Liquidation prices are estimated using a simplified isolated-position model.

For an estimated long position:

Liquidation Price = Entry × (1 − 1 / Leverage) / (1 − MMR)

For an estimated short position:

Liquidation Price = Entry × (1 + 1 / Leverage) / (1 + MMR)

Where:

Entry = estimated entry price generated from the OI event

Leverage = 5x, 10x, 25x, 50x or 100x

MMR = configurable Maintenance Margin Rate

The default Maintenance Margin setting is 0.40%.

Important Note About Liquidation Prices

The levels displayed by this indicator are estimated liquidation levels, not actual exchange liquidation prices.

Real liquidation prices depend on variables that are not available to the script, including:

exchange maintenance-margin tiers;

actual position size;

position notional;

account margin mode;

wallet balance;

additional collateral;

trading fees;

funding;

exchange-specific liquidation formulas;

account configuration.

For this reason, the plotted prices should be interpreted as a model of potential liquidation structure rather than an exact liquidation feed.

OI Impulse Weighting

Not every qualifying Open Interest expansion contributes equally to the liquidation-density profile.

The indicator compares the absolute OI change with its recent average absolute change.

Larger expansions receive a larger weight.

The weighting factor is constrained to prevent extreme observations from completely dominating the profile.

This allows statistically significant OI events to contribute more strongly to liquidation-density calculations while maintaining a usable visual scale.

Active Liquidation Levels

New liquidation levels remain active until price reaches them.

For an estimated long liquidation level:

the zone is consumed when the market trades down to or below the level.

For an estimated short liquidation level:

the zone is consumed when the market trades up to or above the level.

The script tracks this state internally for every stored liquidation zone.

Consumed Levels

The Keep consumed levels setting controls what happens after price reaches a projected liquidation level.

When enabled, the historical level remains on the chart, but its line stops at the bar where it was reached and its appearance becomes less prominent.

When disabled, the consumed line is removed.

This makes it possible to use the map either as:

a cleaner view of currently active liquidation structure; or

a historical visualization of where projected liquidation levels were previously reached.

Liquidation Density Profile

Individual liquidation lines provide detailed information, but markets can contain many overlapping levels.

The indicator therefore includes a liquidation-density profile.

The local price range is divided into configurable price bins.

Active liquidation zones falling inside this range are assigned to the corresponding bins and weighted according to the strength of the OI event that created them.

The profile aggregates:

estimated long liquidation density;

estimated short liquidation density;

total liquidation density.

The width of each profile row represents its density relative to the strongest row currently visible.

Density Direction

Each profile row also identifies which side contributes more strongly to the local liquidation density.

If long-liquidation density dominates, the row uses the long-side color.

If short-liquidation density dominates, the row uses the short-side color.

If both sides are balanced, the neutral profile color is used.

This provides more information than a simple total-density histogram because the user can see both the concentration and the estimated directional composition of the liquidation structure.

Density Peak

The indicator identifies the price bin containing the highest combined active liquidation density.

This level is displayed in the information dashboard as:

Density peak

It represents the center price of the strongest current liquidation-density bin inside the analyzed local range.

The Density Peak should not be interpreted as a guaranteed price target. It simply identifies the price area where the model currently finds the greatest concentration of weighted active liquidation levels.

Nearest Active Liquidations

The indicator continuously searches the stored active zones for:

Nearest Long Liquidation

The closest active estimated long liquidation below the current market price.

Nearest Short Liquidation

The closest active estimated short liquidation above the current market price.

These nearest levels are visually emphasized on the chart.

The information dashboard also displays their exact prices and percentage distance from the current market price.

Leverage Liquidation Table

A dedicated table in the upper-right corner provides a leverage-by-leverage view of the nearest active liquidation levels.

The table contains:

LEV | LONG LIQ | SHORT LIQ

for:

5x
10x
25x
50x
100x

For each leverage category, the script searches for:

the nearest active estimated long liquidation below current price;

the nearest active estimated short liquidation above current price.

Each value includes both the projected liquidation price and its percentage distance from the current market price.

This makes it possible to quickly compare how close different hypothetical leverage groups are to their nearest active liquidation areas.

The leverage labels use the same colors as their corresponding liquidation lines on the chart.

Main Information Dashboard

The upper-left dashboard provides a summary of the current indicator state.

OI Source

Displays the Open Interest symbol currently being requested.

Δ OI

Shows the percentage change in Open Interest from the previous bar.

OI z-score

Displays the normalized magnitude of the current OI change together with its impulse classification:

NORMAL / SMALL / MEDIUM / LARGE

Flow Heuristic

Shows the current interpretation of Open Interest and price behavior, such as:

Long build

Short build

OI contraction

OI expansion

or

OI unavailable

Active Zones

Displays the total number of active estimated long and short liquidation zones.

Nearest Long Liq

Displays the closest active estimated long liquidation below price together with its percentage distance.

Nearest Short Liq

Displays the closest active estimated short liquidation above price together with its percentage distance.

Density Peak

Displays the price associated with the strongest combined liquidation-density bin.

Liquidation Model

Displays the Maintenance Margin Rate currently used by the simplified liquidation model.

OI Impulse Markers

Optional markers are plotted directly on the chart when confirmed qualifying OI expansions occur.

An upward marker represents a detected long buildup.

A downward marker represents a detected short buildup.

Marker visibility changes according to impulse strength, allowing larger OI events to stand out more clearly.

These markers identify the bars where new modeled liquidation clusters originated.

They are not intended to represent standalone buy or sell signals.

Visual Encoding

The indicator uses several visual dimensions to make the map easier to interpret.

Leverage color

Each leverage category has its own configurable color:

5x

10x

25x

50x

100x

Line style

OI impulse strength affects the style of the liquidation line.

Larger impulses receive stronger visual emphasis.

Active vs consumed

Active liquidation levels are displayed more prominently.

Consumed levels are faded when historical levels are retained.

Nearest levels

The nearest active long and short liquidation levels receive additional visual emphasis.

Local Range Filtering

A large number of historical liquidation levels can make a chart difficult to read.

The Only show levels near local price range option can hide lines that are outside the currently calculated local range.

The underlying liquidation-zone data remains stored, while the visual presentation focuses on levels that are more relevant to the current price environment.

Density Profile Settings

The density visualization can be customized through several parameters.

Local Range Lookback

Defines how many bars are used to determine the recent high/low range.

Default: 240 bars

Profile Rows

Controls the number of price bins used by the density profile.

Default: 64 rows

More rows provide greater price resolution, while fewer rows produce broader density zones.

Range Padding

Adds additional space above and below the calculated local price range.

Default: 12%

Profile Offset

Controls how far to the right of the latest candle the density profile is drawn.

Maximum Profile Width

Controls the maximum horizontal width of the strongest density row.

Signal Engine Settings

OI Normalization Length

Historical period used to calculate the average and standard deviation of absolute OI changes.

Default: 60

Small OI Impulse

Minimum z-score required for a Small event.

Default: 1.0

Medium OI Impulse

Minimum z-score required for a Medium event.

Default: 2.0

Large OI Impulse

Minimum z-score required for a Large event.

Default: 3.0

These parameters allow the indicator to be adapted to different assets, timeframes and desired sensitivity levels.

Performance Settings

Maximum Stored Zones

Controls the maximum number of liquidation-zone objects retained by the indicator.

Older zones are removed when this limit is exceeded.

The default value is 360 zones.

This setting provides a balance between maintaining historical liquidation structure and controlling Pine Script resource usage.

Visual Settings

The following components can be enabled or disabled independently:

liquidation level lines;

local-range filtering;

historical consumed levels;

OI impulse markers;

information dashboard;

leverage liquidation table;

liquidation density profile.

Colors for long buildup, short buildup, neutral density and individual leverage categories can also be customized.

Suggested Interpretation

The indicator is designed to provide context about leveraged market structure rather than predict price direction by itself.

Potential applications include:

identifying where estimated leveraged positions may become vulnerable;

observing clusters of liquidation levels above and below current price;

comparing long-side and short-side liquidation density;

locating the nearest modeled liquidation areas;

monitoring unusually large expansions in Open Interest;

observing how liquidation structure develops after major positioning events;

comparing liquidation proximity across several leverage assumptions.

A dense group of levels represents an area where multiple model-generated liquidation estimates overlap or accumulate.

It does not mean that the market must trade to that area.

What the Indicator Does Not Show

This indicator does not claim to provide:

actual individual trader positions;

exact exchange liquidation orders;

actual entry prices of market participants;

exact leverage used by individual traders;

exchange account balances;

guaranteed support or resistance;

guaranteed liquidation events;

guaranteed future price targets.

The liquidation map is a statistical and model-based reconstruction derived from publicly available chart data and Open Interest behavior.

Practical Limitation of the Direction Model

An increase in price combined with an increase in Open Interest does not prove that all new positions are long.

Likewise, falling price with rising Open Interest does not prove that all new positions are short.

Every derivatives trade contains both sides of a transaction.

The directional logic used here should therefore be understood as an analytical heuristic for estimating dominant positioning behavior, not as direct order-level information from the exchange.

Data Availability

The script relies on Binance USDT perpetual Open Interest data.

If the corresponding Open Interest series does not exist for the current base asset, the indicator may show OI as unavailable and will not be able to create new OI-based liquidation clusters.

Historical results also depend on the amount of Open Interest history made available to Pine Script for the selected symbol and timeframe.

Open-Source Purpose

The script is published with visible source code so its calculations and assumptions can be inspected directly.

The key parts of the methodology — OI normalization, directional heuristic, liquidation formulas, leverage mapping, zone lifecycle and density calculation — are intentionally transparent so users can understand what the visualization represents and what its limitations are.

The indicator is intended as a market-analysis and educational tool for studying Open Interest behavior, leverage structure and estimated liquidation concentration.

Golden WolfAI — OI Liquidation Map

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.