OPEN-SOURCE SCRIPT
Cập nhật

Liquidity Sweep Levels Pro

1 240
LIQUIDITY SWEEP LEVELS PRO

WHAT IT DOES
Liquidity Sweep Levels Pro automatically detects buyside liquidity (BSL) and sellside liquidity (SSL) levels from confirmed swing pivots, draws them as horizontal lines that extend in real time, and identifies liquidity sweep events - moments where price wicks through a level to run resting stop orders and then closes back inside. It then applies a displacement-based confirmation model with confluence grading (A+/B/C) so you can distinguish genuine sweep reversals from continuation breaks.
The concept: swing highs accumulate buy stops and breakout orders above them (buyside liquidity); swing lows accumulate sell stops below them (sellside liquidity). When price pierces a level but fails to close beyond it, that liquidity has been consumed - a condition that frequently precedes a reversal toward the opposite pool. When price closes cleanly through a level instead, that is a break, and the indicator treats it as continuation rather than reversal.

HOW IT WORKS

Level detection: Swing highs and lows are identified using confirmed pivots (pivot length adapts to your chart timeframe in Auto mode, or can be set via Scalping / Intraday / Swing / Position / Manual modes). A pivot only becomes a level once fully confirmed - levels never appear retroactively.
Equal high/low clustering: New pivots forming within an ATR-based tolerance of an existing active level merge into it instead of stacking duplicate lines. Merged and retested levels grow thicker (up to 4x width), visually flagging multi-touch liquidity pools where the largest stop clusters accumulate.
Sweep vs break classification (mutually exclusive by construction):


SWEEP: wick pierces the level by at least the minimum pierce distance (ATR-based, configurable) but the bar closes back inside. Line turns dashed, sweep label prints.
BREAK: bar closes through the level. Continuation event, separate alert.


Displacement confirmation: A sweep alone does not confirm a reversal. After an SSL sweep, a later bar must close above the sweep bar's high within the confirmation window (default 5 bars) to print CONF LONG. Mirror logic for BSL sweeps and CONF SHORT. A close back through the sweep wick invalidates the setup; expiry cancels it silently.
Confluence grading: Each confirmed signal is graded using two optional filters measured on the sweep bar - EMA stack alignment (9/21/55) and relative volume (RVOL) - producing A+ (all confluences), B (partial), or C (none). A minimum-confluence gate can hard-filter signals if desired.

HOW TO USE IT

SSL SWEEP followed by CONF LONG: long setup. Stop below the sweep wick; first target is the nearest active BSL line above.
BSL SWEEP followed by CONF SHORT: short setup. Stop above the sweep wick; first target is the nearest active SSL line below.
Thicker lines mark multi-touch pools - sweeps of these levels are typically the higher-probability reversals.
The status table shows active level counts, nearest BSL/SSL prices, pending setup state with grade, and the last signal.
Six alerts are available: BSL/SSL Sweep, BSL/SSL Break, Confirmed Long, Confirmed Short.
Pine Screener support: persistent latched columns (sweep state, confirmed state, pending direction, confluence score, nearest levels, ATR distances) let you scan an entire watchlist for fresh sweep and confirmation events.

Suggested timeframes: 15m as the primary intraday chart; 5m for scalping in Scalping mode; 1H-Daily for swing context. On lower timeframes, raising Min Sweep Pierce (ATR) to 0.10-0.25 filters shallow wick grazes.

NON-REPAINTING DESIGN

All levels are created only from fully confirmed pivots, and all signals - sweeps, breaks, and confirmations - are evaluated strictly on confirmed bars. No signal, label, or line state changes retroactively. The inherent tradeoff of pivot-based detection is that a level appears only after its pivot confirms (pivot length bars after the actual swing); this is disclosed by design rather than hidden with lookahead.

SETTINGS OVERVIEW

Trading Mode: Auto (timeframe-adaptive) or fixed profiles / manual pivot length
Max Levels Per Side, ATR merge tolerance, retest tolerance
Min Sweep Pierce (ATR), swept/broken line handling
Confirmation Window, Min Confluence gate
EMA lengths, RVOL length and threshold, optional EMA plots
Full visual customization: labels, tags, colors, table position

LIMITATIONS AND NOTES

Levels require pivot confirmation, so the first bars of a session rely on levels carried from prior price action - prior-session highs and lows are typically the highest-quality pools.
Confirmation adds deliberate latency: the entry reference is the confirmation close, not the sweep close. This trades a later entry for a much lower false-positive rate.
This indicator identifies liquidity structure and event conditions. It is an analysis tool, not a trading system, and does not guarantee outcomes. Always apply your own risk management.
Phát hành các Ghi chú
v1.1 — Release Notes

Accuracy and presentation update: confirmed-event reporting corrected, level pool protected from starvation, and the status table rebuilt as a neutral structure panel.

FIXED — Confirmation grade reporting

When a pending setup confirmed on the same bar that a new sweep occurred, the screener output and the "Last Signal" row could report the grade of the new pending setup instead of the setup that had just confirmed — so the chart label and the table could disagree about the same event. The confirmed setup's score and grade are now captured at the moment of resolution, before any same-bar sweep can overwrite them. Chart labels, screener values, and the table now always agree.

FIXED — Level pool starvation

With "Keep Swept Levels" or "Keep Dotted" enabled, swept and broken levels remained in memory and counted against "Max Levels Per Side" — and eviction always removed the oldest entry, which could be an active level while dead relics survived. On sweep-heavy sessions the live watch-list was slowly strangled by cosmetic leftovers. Eviction now removes dead (swept/broken) levels first, oldest first; an active level is only evicted when no dead levels remain.

FIXED — Merge touch timing

When a new pivot merged into an existing level, the touch was stamped at the pivot's confirmation bar rather than the pivot bar itself, slightly delaying retest-width eligibility. Touches are now stamped at the actual pivot bar.

FIXED — Stacked sweep labels

Multiple levels swept by a single bar previously drew identical labels on top of each other. One sweep label per side per bar.

IMPROVED — Status table rebuilt as a structure panel

The table no longer issues long/short trade-call language. It now reports market structure only: liquidity inventory per side (active count, nearest level, and its ATR distance on one row), a live confluence readout (EMA stack state and current RVOL multiple), a neutral Watch row stating the price condition that would confirm the sweep structure ("Reclaim > price" / "Breakdown < price") with its grade, the current sweep state, and the last structural event. On-chart confirmation labels renamed to match: "SSL RECLAIM" and "BSL REJECT". The indicator describes what the market must do — the decision remains yours.

IMPROVED — Cleaner status line

All input values and plot values are removed from the status line.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.