OPEN-SOURCE SCRIPT

Liquidity Sweep Hunter | AlphaScript

177
💧 Liquidity Sweep Hunter

Liquidity Sweep Hunter maps the resting liquidity at swing highs and lows — the stop orders sitting just beyond obvious pivots — and detects when price raids it. It marks each level as resting, swept, or reclaimed, so you can see both where liquidity is waiting and when it gets taken.

💡 The idea behind it
Stop orders cluster just beyond swing highs and swing lows. Above a swing high sit the stops of short sellers and the buy orders of breakout traders — buy-side liquidity (BSL). Below a swing low sit the opposite — sell-side liquidity (SSL). Larger participants are drawn to these pools because that resting liquidity is what fills their orders. When price spikes through a level, takes the stops, and rejects back, that is a liquidity sweep — often the origin of a reversal. This tool identifies those events systematically instead of by eye.

🔍 How detection works
Levels are anchored to confirmed swing pivots (default lookback 10 bars each side). A swing high becomes a buy-side liquidity level; a swing low becomes a sell-side liquidity level. Pivots are only registered after they are fully confirmed, so levels do not repaint. Each level is drawn as a line and tagged so its state is always clear:

⇠ Resting — an unswept level. The stops are still sitting there; price may return to raid it. Tagged BSL ⇠ (above swing highs) or SSL ⇠ (below swing lows). These are potential targets.

✗ Swept — price wicked through the level but the bar closed back on the original side. The stops were taken and price rejected. Tagged ✗ BSL swept or ✗ SSL swept.

⟲ Reclaimed — price closed through the level, then on a later bar closed back across it: a failed break that reclaimed the level. Tagged ⟲ BSL reclaimed or ⟲ SSL reclaimed.

You choose the detection mode: Wick (sweeps only), Reclaim (break-and-reclaim only), or Both.

🎯 Penetration filter
An optional ATR-based filter requires price to pierce the level by a minimum multiple of ATR before an event qualifies. Because it is measured in ATR rather than fixed ticks, it means the same thing across every instrument — no re-tuning when you switch markets. Set to zero to disable.

🟠 Broken levels
In Reclaim and Both modes, a level that price closes through is kept on the chart in a distinct color and tagged while it awaits a possible reclaim — so you can see levels that failed but might still be reclaimed. These can be toggled off for a cleaner chart.

📊 Dashboard
A compact panel shows the current symbol, the number of active buy-side and sell-side levels being tracked, and the active detection mode. Theme (dark/light), size, and position are all configurable.

🎨 Customization
Full control over the look: colors for bullish/bearish events, level lines, and broken levels; line style and width for both level lines and event lines; label text color (for readability on light or dark charts); how far pending level lines extend; and toggles for level lines, event labels, pending-level tags, and broken levels.

📈 How to use it
Watch the resting (⇠) levels as the liquidity price may be drawn toward. When a swing high is swept (✗ BSL) after an up-move, buy-side liquidity has been taken and a move down may follow; a swept swing low (✗ SSL) can signal the reverse.
Reclaim events flag failed breaks that often precede a move back in the reclaim direction. Use the tags as points of interest to combine with your own structure read, higher-timeframe bias, and risk management — the tool shows where liquidity rests and when it is taken; you decide what to do with it.

🔔 Alerts
Separate alerts for SSL sweep, BSL sweep, SSL reclaim, BSL reclaim, plus combined "Any Sweep" and "Any Reclaim" conditions.

⚙️ Settings
Swing lookback, detection mode, ATR penetration filter, maximum active levels, level age limit, visible-event cap, recent-bars window for signal shapes, plus the full display and customization controls above.

📌 Notes
This tool detects liquidity at swing pivots specifically — individual swing highs and lows. It is one lens on liquidity and pairs naturally with equal-high/low and session-level analysis for a fuller picture. Events are confirmed on closed bars and do not repaint intrabar. A liquidity sweep marks where stops were taken, not a guaranteed reversal — always combine with your own analysis and risk management.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.