OPEN-SOURCE SCRIPT
Session Liquidity Sweep Map [PhenLabs]

📊 Session Liquidity Sweep Map [PhenLabs]
Version: PineScript™ v6
📌 Description
The Session Liquidity Sweep Map (SLSM) is a session-anchored liquidity engine that maps where resting orders accumulate around the Asia, London, and New York session extremes, then tracks the full life cycle of those pools from formation, to sweep, to structural confirmation. Rather than plotting static swing lines, SLSM treats each finalized session high and low as buy-side or sell-side liquidity and watches for the precise moment price raids that liquidity and rejects.
The indicator solves a core problem for intraday traders: distinguishing a genuine stop-run that leads to a reversal from a clean breakout that continues. By requiring a wick-rejection sweep to be followed by a market structure shift within a defined window, SLSM filters out unconfirmed pokes and only elevates sweeps that are validated by a CHoCH in the opposite direction.
Once a sweep is confirmed, SLSM projects the most logical opposing draw on liquidity and lays out structure-based R-multiple targets, giving you a complete read on where price came from and where it is likely being pulled next.
🚀 Points of Innovation
🔧 Core Components
🔥 Key Features
🎨 Visualization
📖 Usage Guidelines
Sessions
Sweep Detection
MSS / Structure
✅ Best Use Cases
⚠️ Limitations
💡 What Makes This Unique
🔬 How It Works
1. Pool Formation
2. Sweep & Structure Shift
3. Projection & Scoring
💡 Note: SLSM is a non-repainting decision-support tool, not a signal-only system. Wait for the “MSS ✓” confirmation before acting on a sweep, and use the projected draw plus R-targets for trade management rather than entry timing alone.
Version: PineScript™ v6
📌 Description
The Session Liquidity Sweep Map (SLSM) is a session-anchored liquidity engine that maps where resting orders accumulate around the Asia, London, and New York session extremes, then tracks the full life cycle of those pools from formation, to sweep, to structural confirmation. Rather than plotting static swing lines, SLSM treats each finalized session high and low as buy-side or sell-side liquidity and watches for the precise moment price raids that liquidity and rejects.
The indicator solves a core problem for intraday traders: distinguishing a genuine stop-run that leads to a reversal from a clean breakout that continues. By requiring a wick-rejection sweep to be followed by a market structure shift within a defined window, SLSM filters out unconfirmed pokes and only elevates sweeps that are validated by a CHoCH in the opposite direction.
Once a sweep is confirmed, SLSM projects the most logical opposing draw on liquidity and lays out structure-based R-multiple targets, giving you a complete read on where price came from and where it is likely being pulled next.
🚀 Points of Innovation
- Full pool life-cycle state machine: Building → Complete → Swept → Awaiting MSS → Confirmed / no-MSS
- Two-stage validation that pairs a wick-rejection sweep with a mandatory structure-shift confirmation
- Dual sweep triggers: classic close-back-inside rejection or an ATR-scaled displacement break
- Equal-high/low clustering that merges stacked liquidity into a single weighted pool
- Confidence score blending rejection-wick quality, MSS speed, and displacement magnitude
- Live dashboard surfacing the nearest untaken BSL above and SSL below current price
🔧 Core Components
- Session Tracker: Builds developing highs/lows per session in a user-selected timezone and finalizes them into resting pools at session close
- Pool Manager: Creates, clusters, caps, ages out, and visually fades liquidity pools to respect drawing-object limits
- Sweep Engine: Flags a pool as swept when a confirmed bar penetrates it by the tick tolerance and rejects, or breaks it with displacement
- MSS Validator: Watches the protected swing point and confirms the sweep on an opposite-direction close within the lookahead window
- Projection Module: Plots the opposing draw and R-multiple targets measured from the sweep extreme
🔥 Key Features
- Non-repainting logic: pools finalize at close, sweep/MSS evaluate only on confirmed bars, swings use right-anchored pivots
- Configurable kill-zone shading that tints the background while each session is active
- Equal-level clustering with an adjustable tick tolerance to keep the chart clean
- Per-side pool cap that automatically removes the oldest untaken pool when limits are reached
- Three discrete alerts: liquidity swept, sweep + MSS confirmed, and new opposing draw projected
🎨 Visualization
- Liquidity Lines: Solid session-colored levels for live pools that fade and dash once swept
- Sweep & MSS Labels: Directional sweep tags and a “MSS ✓” confirmation label with optional confidence score
- Draw & Targets: A dotted opposing-draw line plus dashed R-multiple target lines from the sweep extreme
- Dashboard: Per-session phase and high/low, with the nearest untaken BSL/SSL relative to price
📖 Usage Guidelines
Sessions
- Session Windows (Asia/London/NY) — Default: 2000-0000 / 0200-0500 / 0930-1100 — Description: Defines each kill-zone in the chosen timezone; adjust to your instrument’s active hours
- Kill-zone transparency — Default: 90 — Range: 50-99 — Description: Controls background tint intensity for active sessions
Sweep Detection
- Penetration tolerance (ticks) — Default: 2 — Description: Minimum overshoot beyond a pool required to register a sweep
- Require close back inside — Default: true — Description: Demands a wick-rejection close; the robust default
- Displacement body x ATR — Default: 1.0 — Range: 0.2+ — Description: Body size relative to ATR for the alternative displacement trigger
MSS / Structure
- Swing pivot length — Default: 5 — Range: 2+ — Description: Left/right strength for non-repainting swing detection
- MSS lookahead (bars) — Default: 20 — Range: 3+ — Description: Bars allowed after a sweep for the structure break to confirm
✅ Best Use Cases
- Intraday reversal trading off Asia/London/NY session stop-runs
- ICT and Smart Money workflows centered on liquidity raids and CHoCH confirmation
- Bias-building by reading the nearest untaken liquidity as the directional draw
- Scalping and futures/index/crypto sessions with defined kill-zone windows
⚠️ Limitations
- Performance depends on correct timezone and session-window configuration per instrument
- The MSS lookahead window can expire on slow markets, leaving valid sweeps marked no-MSS
- Designed for intraday timeframes; session anchoring is less meaningful on HTF charts
- Confirmation introduces a deliberate lag versus the raw sweep, by design
💡 What Makes This Unique
- Session-anchored pools rather than generic swing liquidity, tying liquidity to behavioral kill-zones
- Mandatory two-stage sweep + MSS confirmation that suppresses unvalidated breakouts
- An integrated draw-and-target projection that completes the from/to liquidity narrative
🔬 How It Works
1. Pool Formation
- Each session tracks a developing high and low while active, then finalizes both as resting liquidity at close
- Highs become buy-side liquidity (BSL) above; lows become sell-side liquidity (SSL) below
2. Sweep & Structure Shift
- A confirmed bar must trade beyond a pool by the tolerance and close back inside, flipping it to “awaiting MSS”
- An opposite-direction close through the protected swing within the lookahead confirms the sweep as tradable
3. Projection & Scoring
- On confirmation, the nearest opposing pool is projected as the draw and R-targets are measured from the sweep extreme
- A 0-100 confidence score weights rejection-wick quality, MSS speed, and displacement
💡 Note: SLSM is a non-repainting decision-support tool, not a signal-only system. Wait for the “MSS ✓” confirmation before acting on a sweep, and use the projected draw plus R-targets for trade management rather than entry timing alone.
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.
TradingView Charting w/ Crypto Systems: phenlabs.com
Join our growing community: discord.gg/phen
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
Join our growing community: discord.gg/phen
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
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.
TradingView Charting w/ Crypto Systems: phenlabs.com
Join our growing community: discord.gg/phen
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
Join our growing community: discord.gg/phen
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
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.