Liquidity Sweep Reversal & Targets [PhenLabs]

11 304
📊 Liquidity Sweep Reversal & Targets [PhenLabs]

Version: PineScript™ v6

📌 Description
Every trader has watched price spike past an obvious swing high or low, trigger a breakout entry or stop-loss, and immediately snap back in the opposite direction. Most liquidity indicators simply draw dozens of lines and leave you to guess whether a wick is a genuine stop-hunt reversal or the start of a real breakout. Other tools print retroactive pivot arrows bars after the move has already left the station.

Liquidity Sweep Reversal & Targets [PhenLabs] turns swing liquidity into a complete, non-repainting decision and trade-management tool. It maps resting Buy-Side Liquidity (BSL) and Sell-Side Liquidity (SSL) defense zones in advance, displays the Buyer/Seller Defense % directly on each level, and waits for price to sweep a pool and close back inside. When a sweep occurs, the script measures true volume-weighted wick absorption and blocks trades into runaway momentum crashes before issuing a confirmed BUY or SELL callout on candle close.

Every confirmed TAKE signal automatically plots a clean, on-chart Entry, Stop Loss, and TP1 / TP2 / TP3 trade plan—complete with optional opposing-pool magnet snapping for TP3, an automatic Breakeven ratchet once TP1 is reached, and an honest closed-bar Win/Loss dashboard that tracks real-time execution from the signal candle close.

⚡ Quick Start: Reading the Chart in 10 Seconds
  • Resting BSL & SSL Defense Zones: Coral boxes above price mark Buy-Side Liquidity (BSL) resistance where stops rest above swing highs; teal boxes below price mark Sell-Side Liquidity (SSL) support where stops rest below swing lows. Each zone tag shows the exact level and the initial Buyer/Seller Defense %.
  • Confirmed BUY / SELL Callouts: A bold BUY · XX% or SELL · XX% badge prints on candle close only when price wicks through an active pool, closes back inside the level, and clears your Absorption Filter Mode threshold. Weak sweeps are suppressed (or shown as faint SKIP dots if enabled).
  • On-Chart Trade Plan (Entry / SL / TP1–TP3): Only the active setup is drawn by default so your chart stays clean. The coral zone marks your 1R risk to SL, the teal zone marks your reward ladder to TP1 (1.0R), TP2 (2.0R), and TP3 (3.0R or Opposing Pool Magnet), and live ✓ checkmarks appear as each target is hit.
  • Top-Right Summary Dashboard: Check Orderflow Delta, Last Sweep Signal, Active Trade Plan, and Win Rate (TP1+) at a glance. You can also move the table into TradingView’s dedicated bottom panel via the indicator’s More menu.


🚀 Key Innovations & Trader Benefits
  • Zero Right-Pivot Entry Lag: Because swing liquidity pools are registered in advance and rest in memory, the sweep and candle-close reclaim are detected on the exact bar they happen—never back-painted several bars later.
  • Live Chart Auto-Optimizer (Best Win Rate Mode): No manual parameter guessing when switching from Gold 5m to NQ 1m or Bitcoin 4h. In Auto-Optimize (Best Chart Win Rate) mode, the script runs a live 4-profile walk-forward tournament (45% Fast, 55% Balanced, 65% Strict, and 72% Ultra absorption + paired sweep depth and SL buffers) on your active symbol and timeframe, automatically locking onto the highest-winrate configuration and displaying the winning profile in the dashboard.
  • True Volume-Weighted Absorption (Volume Never Cancels Out): Unlike normalized price oscillators where volume divides out of the formula, our absorption score directly combines relative volume (RVOL), wick-rejection share, and candle-body reclaim. On volume-free feeds (such as spot Forex or indices), it automatically switches to a True-Range velocity proxy and labels the active mode in the dashboard.
  • Hybrid R-Ladder + Opposing Pool Magnet Targets: Choose between a pure 1.0R / 2.0R / 3.0R ladder or Hybrid Mode, which automatically snaps TP3 (tagged · MAG) to the nearest unbroken opposing liquidity pool when it lies between 2.2R and 4.5R.
  • Honest Closed-Bar Win/Loss Accounting: Every trade plan is entered at the confirmed signal bar’s close and evaluated with a conservative Stop-First rule on subsequent bars. If a single candle touches both SL and a TP, Stop Loss is assumed hit first—eliminating artificial backtest inflation.


🎯 Trading Playbook: When to Take vs. Skip a Sweep
  • High-Probability Reversal (TAKE): Price sweeps a resting SSL zone during an active session, prints a long lower rejection wick with elevated volume (Buyer Absorption ≥ 55%), and closes back above the swing low while an unbroken BSL magnet pool sits 2.5R–4.0R overhead. Enter on the signal close, keep SL at the plotted ATR-buffered wick extreme, and let the script ratchet SL to Breakeven once TP1 (1.0R) prints ✓.
  • Filtered Breakdown Trap (SKIP): Price slams into an SSL pool after a 4+ ATR five-bar waterfall crash or closes weak with low absorption (< 55%), or closes completely below the outer defense boundary. The state machine immediately retires broken pools or downgrades the sweep to SKIP, keeping you out of runaway trend continuations.


🔧 Core Components & Visual Hierarchy
  • Liquidity Pool Lifecycle Engine: Tracks up to 8 confirmed swing pools per side in memory while rendering only the nearest Active Pools Shown Per Side (default 2 BSL, 2 SSL) so historical lines never clutter your chart.
  • Swept Pool Highlight Badge: When a valid TAKE reversal fires, a compact dashed box highlights the exact swept liquidity zone so you can visually verify the stop-run at a glance.
  • Automated Breakeven Ratchet: When Move Stop to Breakeven After TP1 is enabled, hitting TP1 on any confirmed bar automatically moves the active stop to your Entry price (BE ARMED) to protect the runner toward TP2 and TP3.
  • Theme-Adaptive Dashboard: Automatically adapts text and panel contrast to dark and light TradingView themes, with 4 Table Size options.


📖 Settings & Usage Guidelines
  • Swing Liquidity Lookback — Default: 10 — Range: 3 to 50 — Left/right confirmation bars used to establish resting BSL and SSL swing pools. Use 6–8 for fast scalping or 10–15 for major structural swings.
  • Active Pools Shown Per Side — Default: 2 — Range: 1 to 5 — Caps how many unmitigated BSL and SSL defense zones are drawn above and below current price.
  • Defense Zone Thickness (ATR) — Default: 0.35 — Range: 0.10 to 1.20 — Volatility-scaled height of each liquidity defense zone in ATR(14) units.
  • Absorption Filter Mode — Default: Auto-Optimize (Best Chart Win Rate) — Options: Auto-Optimize (Best Chart Win Rate), Balanced (55% Absorb), Conservative (65% Absorb), Aggressive (45% Absorb), Trend-Aligned (EMA 50 + 52% Absorb), Volume Climax (62% Absorb + 1.25x Vol), Wide-Stop Defense (60% Absorb + 1.6x SL), Custom Threshold — Runs all 6 built-in strategy profiles in parallel across the full chart history on your active symbol and timeframe, and in Auto-Optimize mode selects and renders the exact profile with the highest closed-bar TP1+ Win Rate.
  • Custom Min Absorption (%) — Default: 55.0 — Range: 25.0 to 90.0 — Active only when Absorption Filter Mode is set to Custom Threshold.
  • Target Projection Mode — Default: R Ladder + Opposing Pool Magnet — Options: R Ladder + Opposing Pool Magnet, Fixed R Ladder (1R / 2R / 3R) — Controls whether TP3 snaps to an unbroken opposing liquidity pool between 2.2R and 4.5R.
  • Stop Loss Buffer Beyond Wick (ATR) — Default: 0.20 — Range: 0.05 to 1.00 — ATR(14) buffer added beyond the sweep wick extreme when setting the initial Stop Loss.
  • Move Stop to Breakeven After TP1 — Default: true — Ratchets the active Stop Loss to the Entry price after TP1 is reached on a closed bar.
  • Keep Historical Trade Plans (Last 5) — Default: false — Keeps only the latest trade plan on price by default; enable to inspect the last 5 resolved setups on the chart.
  • Show Filtered (SKIP) Sweeps — Default: false — Displays small muted SKIP markers on sweeps that were rejected by the absorption or crash filter.
  • Show Summary Dashboard & Table Size — Default: true / Small — Toggles the summary table and scales its font size (Tiny, Small, Normal, Large).


🔍 Pine Screener & Alerts Setup
  • Screener Plot 1 — Sweep Reversal Signal: Filter for == 1 to scan your watchlist for fresh Bullish SSL Sweep Reversals, or == -1 for fresh Bearish BSL Sweep Reversals.
  • Screener Plot 2 — Sweep Absorption %: Filter for >= 65 to isolate high-conviction institutional absorption sweeps across hundreds of symbols.
  • Screener Plot 3 — Orderflow Pressure Delta %: Scans live net buyer vs. seller pressure (-100% to +100%).
  • Screener Plot 4 & 5 — Active Trade Plan & TP1+ Win Rate %: Filter for symbols currently in an open Long (1) or Short (-1) plan where historical chart TP1+ Win Rate exceeds 60%.
  • Built-In Alert Conditions: Includes 7 dedicated alerts for Bullish BUY, Bearish SELL, Any Confirmed Sweep Reversal, TP1 Hit, TP2 Hit, TP3 Hit, and Stop Loss Hit.


✅ Best Use Cases & Markets
  • Designed for intraday scalpers (1m, 5m, 15m), day traders (30m, 1h), and swing traders (4h, 1D) who trade stop runs, liquidity sweeps, and support/resistance reversals.
  • Works out of the box on Futures and Indices (NQ1!, ES1!, MNQ1!), Gold and Commodities (XAUUSD, XAGUSD), Crypto (BTCUSDT, SOLUSDT), Equities, and Forex.


⚙️ Under the Hood (Originality & Pine v6 Architecture)
  • Two-Stage Sweep & Absorption State Machine: Rather than triggering on raw wick touches or delayed post-sweep pivots, the script separates pool registration from sweep evaluation. Confirmed pivots populate typed LiqPool registries only if no candle closed beyond the outer defense boundary during the confirmation window. On subsequent bars, a sweep candidate requires an intrabar pierce beyond pool.level paired with a close back inside the level and an excursion smaller than maxSweepAtr. Any candle closing beyond outerBound immediately consumes and deletes the pool as a structural breakout.
  • True Volume-Weighted Absorption Formulation: For each bar, relative activity is computed as relActivity = volume / ta.sma(volume, 20) when real or tick volume is available, and falls back to (high - low) / ta.atr(14) on volume-free feeds. Directional wick rejection share ((close - low) / (high - low) for bullish sweeps, (high - close) / (high - low) for bearish sweeps), normalized activity (f_clamp(relActivity / 2.0, 0, 1)), and close-body reclaim are weighted (50% / 35% / 15%) into a bounded 0–100% absorption score. Because volume enters through relActivity without being divided by itself, volume spikes directly amplify the absorption score.
  • 6-Profile Full-History Parallel Auto-Optimizer: Instead of switching parameters mid-chart and creating a mixed win-rate ledger, the script runs 6 complete, self-contained ProfileEngine instances in parallel from bar 0 to the latest bar (Balanced 55%, Conservative 65%, Aggressive 45%, Trend-Aligned EMA 50, Volume Climax 1.25x RVOL, and Wide-Stop Defense 1.6x SL). Every engine tracks its own full-history SavedPlan ledger and closed-bar win/loss record. When Auto-Optimize (Best Chart Win Rate) is selected, the script selects the exact engine with the highest closed-bar TP1+ Win Rate on the current symbol and timeframe and renders that engine’s signals, trade plans, and statistics—guaranteeing the Auto-Optimize win rate is always equal to the top-performing profile on your chart.
  • Pine v6 Capabilities Used: Built natively in Pine Script™ v6 using type LiqPool, type TradePlan, and type SimProfile User-Defined Types (UDTs), UDT cleanup and rendering method functions, strongly typed enum + input.enum() selectors with active= progressive input disclosure, chart.fg_color / chart.bg_color theme-adaptive styling, and 5 display.pine_screener outputs declared at the top of the plot stack.
  • 100% All-Plan Compatibility: Uses zero request.footprint() or paid-plan-only calls. Free, Essential, Plus, Premium, and Ultimate users receive full functionality on every symbol and timeframe, with automatic LIVE VOL vs. PRICE-PROXY detection shown in the header.


🔬 Step-by-Step How It Works
  • Confirmed swing highs and lows create volatility-buffered BSL and SSL defense zones (verified unbroken during their confirmation bars) and store the formation candle’s Buyer/Seller Defense %.
  • On each closed bar, active pools are checked first: a full close beyond a pool’s outer boundary retires the pool as broken, while a wick beyond the swing level that closes back inside arms a Sweep Candidate.
  • The Sweep Candidate is tested against your Absorption Filter Mode threshold and a 5-bar ATR momentum-crash guard; qualifying setups fire BUY or SELL (TAKE) on candle close.
  • A new TradePlan locks Entry at the signal close, sets Stop Loss beyond the sweep wick plus your ATR buffer (clamped to 0.35–3.0 ATR), and projects TP1 (1.0R), TP2 (2.0R), and TP3 (3.0R or opposing pool magnet).
  • On every subsequent closed bar, the active plan is evaluated stop-first, ratchets SL to Breakeven after TP1 if enabled, marks hit targets with ✓, and updates the closed-bar Win/Loss and Net R ledger.


⚠️ Limitations & Risk Note
  • High-impact macroeconomic news releases can drive multi-ATR one-way expansion through resting liquidity pools; the 5-bar crash guard and outer-boundary breakdown check filter many of these moves, but traders should still avoid stepping in front of unscheduled news shocks.
  • Historical Win Rate and Net R statistics reflect closed-bar performance over the loaded chart history (using conservative stop-first accounting from the signal bar close) and vary by symbol, timeframe, and filter preset.
  • This indicator is an analytical decision-support tool and does not constitute financial or investment advice. Past performance does not guarantee future results; always use disciplined position sizing and risk management.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.