OPEN-SOURCE SCRIPT
Alpha Forge Liquidity Matrix v2.2

# Liquidity Matrix
Liquidity Matrix is a native TradingView overlay designed to map probable liquidity zones, identify sweep traps, and help traders understand where price may be hunting stops.
Instead of focusing only on traditional trend signals, this tool looks at market structure through the lens of liquidity.
Where are traders likely trapped?
Where are stops likely clustered?
Where did price sweep liquidity and reject?
Did the reclaim actually confirm, or did it fail?
Liquidity Matrix was built to answer those questions directly on the chart.
---
## What It Does
Liquidity Matrix tracks recent swing highs and swing lows, then clusters nearby levels into projected liquidity zones.
These zones represent areas where stop orders may be concentrated:
* Swing highs can create buy-side liquidity above price
* Swing lows can create sell-side liquidity below price
* Repeated reactions near the same area increase the weight of that zone
* Stronger zones are shown as heavier projected boxes
The result is a visual map of where liquidity may be sitting before price reaches it.
---
## Liquidity Zones
The indicator draws forward-projected heat boxes directly on the chart.
Upper zones represent probable buy-side liquidity.
Lower zones represent probable sell-side liquidity.
Zone strength is classified as:
* Minor
* Active
* Major
The stronger the zone, the more important that area may become when price approaches it.
These zones are not standard support and resistance lines. They are designed to highlight areas where traders may be trapped, where stops may be clustered, and where fake breakouts or sweep moves may occur.
---
## Sweep and Reclaim Logic
A key feature of Liquidity Matrix is its ability to identify liquidity sweeps.
A sweep occurs when price pushes beyond a liquidity zone, grabs that liquidity, and then rejects or reclaims.
The script separates these events into clearer signal types:
### Buy Signal
A buy signal can occur when sell-side liquidity is swept and price confirms a bullish reclaim.
This suggests price pushed below a lower liquidity zone, triggered stops, and then recovered back above the level.
### Sell Signal
A sell signal can occur when buy-side liquidity is swept and price confirms a bearish rejection.
This suggests price pushed above an upper liquidity zone, triggered stops, and then failed to hold the breakout.
### Exit Long
An exit long signal appears when price sweeps upper liquidity and rejects strongly enough to trigger a structural warning.
This is designed as a circuit-breaker style warning for long positions.
### Exit Short
An exit short signal appears when price sweeps lower liquidity and reclaims strongly enough to trigger a structural warning for short positions.
---
## Signal Strictness
Liquidity Matrix includes three signal strictness modes:
### Early
Signals can trigger faster using wick-based reclaim or rejection logic.
This mode is more responsive, but may produce more early signals in choppy markets.
### Balanced
Signals require a cleaner close-based reclaim or rejection.
This is the default mode and is designed to balance responsiveness with confirmation.
### Confirmed
Signals require follow-through confirmation after the sweep.
This mode is stricter and may reduce false signals, but signals can appear later.
---
## Trade Direction Control
The indicator includes trade direction settings so users can match the tool to their trading style.
Options include:
* Longs & Shorts
* Longs Only
* Shorts Only
In Longs Only mode, buy signals remain active while short-style sell signals are treated as warnings instead of short entries.
In Shorts Only mode, sell signals remain active while long-style buy signals are treated as warnings instead of long entries.
This makes the tool easier to use for stock traders, crypto traders, futures traders, and users who only trade one side of the market.
---
## Signal Label Styles
Liquidity Matrix includes flexible label wording.
Users can choose between:
* Liquidity Terms
* Plain Buy/Sell
* Both
Liquidity Terms display labels such as SSL Reclaim and BSL Reject.
Plain Buy/Sell mode displays simple BUY, SELL, EXIT LONG, and EXIT SHORT labels.
Both mode displays the trade meaning and the liquidity event together.
This allows advanced traders to keep the market-structure terminology, while newer users can choose simpler chart labels.
---
## Dashboard
The dashboard provides a quick read of the current liquidity environment.
It can show:
* Current analysis timeframe
* Nearest upper liquidity zone
* Nearest lower liquidity zone
* Circuit breaker state
* Latest event
* Current bias
* ATR sweep power
* Confirmation status
The bias reading helps identify whether the chart is currently leaning toward sweep risk above, sweep risk below, post-sweep bullish behavior, post-sweep bearish behavior, or a circuit-breaker state.
---
## Confirmation Filters
Liquidity Matrix includes several optional filters to improve signal quality.
### Volume Confirmation
Requires relative volume to meet a minimum threshold before sweep signals are confirmed.
### Trend Filter
Allows signals to be filtered by trend conditions.
Modes include:
* Off
* Signal Quality
* Strict Signals
### Session Killzones
Allows users to define preferred trading windows.
Signals can be filtered to specific sessions, and optional session shading can be displayed on the chart.
### ATR Sweep Strength
The dashboard can show how powerful a sweep is relative to ATR.
This helps separate small liquidity taps from stronger displacement-style sweeps.
---
## Alerts
The indicator includes simplified alert names for easier setup.
Available alert types include:
* Buy Signal
* Sell Signal
* Exit Long
* Exit Short
* Any Buy/Sell Signal
* Any Exit Signal
* Long Warning
* Short Warning
This makes it much easier to create TradingView alerts without needing to understand every internal liquidity term.
Webhook-ready JSON alert calls are also available for users who want structured alert messages for automation, bots, dashboards, or external systems.
---
## How to Use It
Liquidity Matrix is best used as a structure and risk tool, not as a blind signal generator.
Common use cases include:
* Avoiding breakout traps near major liquidity zones
* Spotting failed sweeps before price reverses
* Confirming potential entries after sell-side or buy-side liquidity is swept
* Exiting long positions after upper liquidity rejection
* Exiting short positions after lower liquidity reclaim
* Identifying areas where price may be drawn toward liquidity
* Filtering trade ideas with volume, trend, session, and ATR confirmation
A strong use case is combining Liquidity Matrix with a separate trend or momentum tool.
For example:
A buy signal after sell-side liquidity is swept may carry more weight when trend, volume, and momentum are also aligned.
A sell signal after buy-side liquidity is swept may be more meaningful when price rejects a major upper zone with strong ATR expansion.
---
## Important Notes
Liquidity Matrix does not know where actual stop orders are placed.
It estimates probable liquidity areas using swing structure, repeated reactions, clustering, volatility, and rejection behavior.
The indicator does not guarantee future price movement.
It is designed to help traders better understand where liquidity may be building, when price may be sweeping that liquidity, and when a move may be a trap instead of a true breakout.
As always, this tool should be used with proper risk management and as part of a complete trading plan.
---
## Summary
Liquidity Matrix is a visual liquidity-mapping system built for traders who want to look beyond basic support, resistance, and lagging indicators.
It identifies probable stop clusters, projects liquidity zones forward, detects sweeps and reclaims, provides buy/sell/exit signals, and gives traders a clearer view of when price may be hunting liquidity.
The goal is simple:
See the trap before reacting to it.
Liquidity Matrix is a native TradingView overlay designed to map probable liquidity zones, identify sweep traps, and help traders understand where price may be hunting stops.
Instead of focusing only on traditional trend signals, this tool looks at market structure through the lens of liquidity.
Where are traders likely trapped?
Where are stops likely clustered?
Where did price sweep liquidity and reject?
Did the reclaim actually confirm, or did it fail?
Liquidity Matrix was built to answer those questions directly on the chart.
---
## What It Does
Liquidity Matrix tracks recent swing highs and swing lows, then clusters nearby levels into projected liquidity zones.
These zones represent areas where stop orders may be concentrated:
* Swing highs can create buy-side liquidity above price
* Swing lows can create sell-side liquidity below price
* Repeated reactions near the same area increase the weight of that zone
* Stronger zones are shown as heavier projected boxes
The result is a visual map of where liquidity may be sitting before price reaches it.
---
## Liquidity Zones
The indicator draws forward-projected heat boxes directly on the chart.
Upper zones represent probable buy-side liquidity.
Lower zones represent probable sell-side liquidity.
Zone strength is classified as:
* Minor
* Active
* Major
The stronger the zone, the more important that area may become when price approaches it.
These zones are not standard support and resistance lines. They are designed to highlight areas where traders may be trapped, where stops may be clustered, and where fake breakouts or sweep moves may occur.
---
## Sweep and Reclaim Logic
A key feature of Liquidity Matrix is its ability to identify liquidity sweeps.
A sweep occurs when price pushes beyond a liquidity zone, grabs that liquidity, and then rejects or reclaims.
The script separates these events into clearer signal types:
### Buy Signal
A buy signal can occur when sell-side liquidity is swept and price confirms a bullish reclaim.
This suggests price pushed below a lower liquidity zone, triggered stops, and then recovered back above the level.
### Sell Signal
A sell signal can occur when buy-side liquidity is swept and price confirms a bearish rejection.
This suggests price pushed above an upper liquidity zone, triggered stops, and then failed to hold the breakout.
### Exit Long
An exit long signal appears when price sweeps upper liquidity and rejects strongly enough to trigger a structural warning.
This is designed as a circuit-breaker style warning for long positions.
### Exit Short
An exit short signal appears when price sweeps lower liquidity and reclaims strongly enough to trigger a structural warning for short positions.
---
## Signal Strictness
Liquidity Matrix includes three signal strictness modes:
### Early
Signals can trigger faster using wick-based reclaim or rejection logic.
This mode is more responsive, but may produce more early signals in choppy markets.
### Balanced
Signals require a cleaner close-based reclaim or rejection.
This is the default mode and is designed to balance responsiveness with confirmation.
### Confirmed
Signals require follow-through confirmation after the sweep.
This mode is stricter and may reduce false signals, but signals can appear later.
---
## Trade Direction Control
The indicator includes trade direction settings so users can match the tool to their trading style.
Options include:
* Longs & Shorts
* Longs Only
* Shorts Only
In Longs Only mode, buy signals remain active while short-style sell signals are treated as warnings instead of short entries.
In Shorts Only mode, sell signals remain active while long-style buy signals are treated as warnings instead of long entries.
This makes the tool easier to use for stock traders, crypto traders, futures traders, and users who only trade one side of the market.
---
## Signal Label Styles
Liquidity Matrix includes flexible label wording.
Users can choose between:
* Liquidity Terms
* Plain Buy/Sell
* Both
Liquidity Terms display labels such as SSL Reclaim and BSL Reject.
Plain Buy/Sell mode displays simple BUY, SELL, EXIT LONG, and EXIT SHORT labels.
Both mode displays the trade meaning and the liquidity event together.
This allows advanced traders to keep the market-structure terminology, while newer users can choose simpler chart labels.
---
## Dashboard
The dashboard provides a quick read of the current liquidity environment.
It can show:
* Current analysis timeframe
* Nearest upper liquidity zone
* Nearest lower liquidity zone
* Circuit breaker state
* Latest event
* Current bias
* ATR sweep power
* Confirmation status
The bias reading helps identify whether the chart is currently leaning toward sweep risk above, sweep risk below, post-sweep bullish behavior, post-sweep bearish behavior, or a circuit-breaker state.
---
## Confirmation Filters
Liquidity Matrix includes several optional filters to improve signal quality.
### Volume Confirmation
Requires relative volume to meet a minimum threshold before sweep signals are confirmed.
### Trend Filter
Allows signals to be filtered by trend conditions.
Modes include:
* Off
* Signal Quality
* Strict Signals
### Session Killzones
Allows users to define preferred trading windows.
Signals can be filtered to specific sessions, and optional session shading can be displayed on the chart.
### ATR Sweep Strength
The dashboard can show how powerful a sweep is relative to ATR.
This helps separate small liquidity taps from stronger displacement-style sweeps.
---
## Alerts
The indicator includes simplified alert names for easier setup.
Available alert types include:
* Buy Signal
* Sell Signal
* Exit Long
* Exit Short
* Any Buy/Sell Signal
* Any Exit Signal
* Long Warning
* Short Warning
This makes it much easier to create TradingView alerts without needing to understand every internal liquidity term.
Webhook-ready JSON alert calls are also available for users who want structured alert messages for automation, bots, dashboards, or external systems.
---
## How to Use It
Liquidity Matrix is best used as a structure and risk tool, not as a blind signal generator.
Common use cases include:
* Avoiding breakout traps near major liquidity zones
* Spotting failed sweeps before price reverses
* Confirming potential entries after sell-side or buy-side liquidity is swept
* Exiting long positions after upper liquidity rejection
* Exiting short positions after lower liquidity reclaim
* Identifying areas where price may be drawn toward liquidity
* Filtering trade ideas with volume, trend, session, and ATR confirmation
A strong use case is combining Liquidity Matrix with a separate trend or momentum tool.
For example:
A buy signal after sell-side liquidity is swept may carry more weight when trend, volume, and momentum are also aligned.
A sell signal after buy-side liquidity is swept may be more meaningful when price rejects a major upper zone with strong ATR expansion.
---
## Important Notes
Liquidity Matrix does not know where actual stop orders are placed.
It estimates probable liquidity areas using swing structure, repeated reactions, clustering, volatility, and rejection behavior.
The indicator does not guarantee future price movement.
It is designed to help traders better understand where liquidity may be building, when price may be sweeping that liquidity, and when a move may be a trap instead of a true breakout.
As always, this tool should be used with proper risk management and as part of a complete trading plan.
---
## Summary
Liquidity Matrix is a visual liquidity-mapping system built for traders who want to look beyond basic support, resistance, and lagging indicators.
It identifies probable stop clusters, projects liquidity zones forward, detects sweeps and reclaims, provides buy/sell/exit signals, and gives traders a clearer view of when price may be hunting liquidity.
The goal is simple:
See the trap before reacting to it.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Discord: discord.gg/gnjf87QGmv
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Discord: discord.gg/gnjf87QGmv
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.