OPEN-SOURCE SCRIPT
Liquidity Sweep Levels Pro

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.
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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.