OPEN-SOURCE SCRIPT
EQH/EQL Liquidity Sweep | AlphaScript

⚖️ EQH/EQL Liquidity Sweep
Detects clusters of equal highs (EQH) and equal lows (EQL) the resting-liquidity pools that price hunts and tracks exactly what happens to each one: swept, broken, or still active. Then it measures the real sweep rate so you can see your actual edge.
🎯 Why equal highs and lows matter
When price makes a high, pulls back, then makes another high at the same level, stops pile up just beyond that level — breakout orders, protective stops, resting liquidity.
The more times price taps the same level, the more orders accumulate there. Those pools are what larger participants hunt. This tool maps them automatically and then tells you whether each pool got raided or genuinely failed.
🔍 How pools form
The indicator finds swing highs and lows, then groups any that sit within a configurable tolerance of each other into a single pool.
A pool needs at least a minimum number of touches (default 2) to display. The pool line is drawn at the extreme of the cluster — the highest of the equal highs, or lowest of the equal lows — because that is where the stops actually rest. A small × marks each individual swing that built the pool, and the line thickness and badge show the touch count.
Each pool resolves in one of these ways:
⚡ SWEPT — price wicks through the pool extreme but the bar closes back on the original side. Stops were taken, but the level held on a closing basis. A liquidity raid.
💥 BROKEN — a bar closes through the pool extreme. The level genuinely failed — continuation, not a raid. Breaks are shown separately and never labeled as sweeps.
🛡️ Active — the pool has neither been swept nor broken and is still in play. Pools that go too long without resolving expire and are removed.
First qualifying event wins: one outcome per pool. If a bar both wicks through and closes through, it counts as a break — a close through the level can never be a sweep.
📊 Sweep-rate table | know your real edge
This is what separates the tool from every other equal-highs indicator: instead of just drawing levels, it measures what actually happens to them. The table breaks down every resolved pool by touch count (2 / 3 / 4+) and shows the real sweep and break percentages for each group — computed live from your own instrument, timeframe, and history.
That means you can answer the question that matters before taking a trade: do the pools you're watching actually get swept, or do they break? If 3-touch pools on your instrument sweep far more often than they break, that's a measured edge you can trade around. If 2-touch pools are a coin flip, you know to demand more confluence. The numbers come from the chart, not from a claim on a marketing page.
Only fully resolved pools are counted, active pools are excluded, so the rates can never be inflated by in-progress levels. The denominator is honest: what you see is what actually happened.
⚙️ Settings
-Swing lookback, and equal tolerance in ATR multiples (instrument-independent) or fixed ticks.
-Minimum touches to form a pool, maximum pool age, and how many active pools to track per side.
-Optional minimum wick penetration (ATR-based) to filter marginal sweeps. Does not apply to breaks.
-Optional "Strict Virgin Liquidity" mode: discards a forming level if price closes decisively beyond it before a second touch, so only levels that were never truly broken can pair. Off by default.
-Full display control: pool zones, touch badges, × touch markers, colors, line styles and widths, and how many resolved pools remain on the chart.
-Sweep-rate table with position options.
🔔 Alerts
Per-side sweep alerts (EQH and EQL), separate break alerts, and a combined "Any Pool Swept" alert. All alerts fire on the close of the event bar.
📌 Notes and limitations
-Designed for intraday and swing timeframes. Very low timeframes produce many small pools; adjust tolerance and swing lookback to suit.
-Detection uses standard swing pivots. A peak whose neighboring bar wicks slightly higher may not register as a separate pivot, so not every visual high becomes a pool — tune the swing lookback and tolerance to match how you read structure.
-The equal tolerance is the single most important setting. Too tight and genuine equal levels are missed; too loose and unrelated highs merge. Start moderate and adjust to your instrument.
-The sweep-rate table describes the pools on your loaded chart history. It is a measurement of what happened, not a prediction of what the next pool will do.
✅ Why no repaint
-Pivots are confirmed only after the swing lookback completes, and all pool detection runs on closed bars only. A sweep or break tag will never appear intrabar and then vanish.
-A pool is only evaluated for sweep or break once it has fully formed. A level still building cannot be resolved.
-No request.security() calls are used anywhere. All detection is chart-timeframe state.
Detects clusters of equal highs (EQH) and equal lows (EQL) the resting-liquidity pools that price hunts and tracks exactly what happens to each one: swept, broken, or still active. Then it measures the real sweep rate so you can see your actual edge.
🎯 Why equal highs and lows matter
When price makes a high, pulls back, then makes another high at the same level, stops pile up just beyond that level — breakout orders, protective stops, resting liquidity.
The more times price taps the same level, the more orders accumulate there. Those pools are what larger participants hunt. This tool maps them automatically and then tells you whether each pool got raided or genuinely failed.
🔍 How pools form
The indicator finds swing highs and lows, then groups any that sit within a configurable tolerance of each other into a single pool.
A pool needs at least a minimum number of touches (default 2) to display. The pool line is drawn at the extreme of the cluster — the highest of the equal highs, or lowest of the equal lows — because that is where the stops actually rest. A small × marks each individual swing that built the pool, and the line thickness and badge show the touch count.
Each pool resolves in one of these ways:
⚡ SWEPT — price wicks through the pool extreme but the bar closes back on the original side. Stops were taken, but the level held on a closing basis. A liquidity raid.
💥 BROKEN — a bar closes through the pool extreme. The level genuinely failed — continuation, not a raid. Breaks are shown separately and never labeled as sweeps.
🛡️ Active — the pool has neither been swept nor broken and is still in play. Pools that go too long without resolving expire and are removed.
First qualifying event wins: one outcome per pool. If a bar both wicks through and closes through, it counts as a break — a close through the level can never be a sweep.
📊 Sweep-rate table | know your real edge
This is what separates the tool from every other equal-highs indicator: instead of just drawing levels, it measures what actually happens to them. The table breaks down every resolved pool by touch count (2 / 3 / 4+) and shows the real sweep and break percentages for each group — computed live from your own instrument, timeframe, and history.
That means you can answer the question that matters before taking a trade: do the pools you're watching actually get swept, or do they break? If 3-touch pools on your instrument sweep far more often than they break, that's a measured edge you can trade around. If 2-touch pools are a coin flip, you know to demand more confluence. The numbers come from the chart, not from a claim on a marketing page.
Only fully resolved pools are counted, active pools are excluded, so the rates can never be inflated by in-progress levels. The denominator is honest: what you see is what actually happened.
⚙️ Settings
-Swing lookback, and equal tolerance in ATR multiples (instrument-independent) or fixed ticks.
-Minimum touches to form a pool, maximum pool age, and how many active pools to track per side.
-Optional minimum wick penetration (ATR-based) to filter marginal sweeps. Does not apply to breaks.
-Optional "Strict Virgin Liquidity" mode: discards a forming level if price closes decisively beyond it before a second touch, so only levels that were never truly broken can pair. Off by default.
-Full display control: pool zones, touch badges, × touch markers, colors, line styles and widths, and how many resolved pools remain on the chart.
-Sweep-rate table with position options.
🔔 Alerts
Per-side sweep alerts (EQH and EQL), separate break alerts, and a combined "Any Pool Swept" alert. All alerts fire on the close of the event bar.
📌 Notes and limitations
-Designed for intraday and swing timeframes. Very low timeframes produce many small pools; adjust tolerance and swing lookback to suit.
-Detection uses standard swing pivots. A peak whose neighboring bar wicks slightly higher may not register as a separate pivot, so not every visual high becomes a pool — tune the swing lookback and tolerance to match how you read structure.
-The equal tolerance is the single most important setting. Too tight and genuine equal levels are missed; too loose and unrelated highs merge. Start moderate and adjust to your instrument.
-The sweep-rate table describes the pools on your loaded chart history. It is a measurement of what happened, not a prediction of what the next pool will do.
✅ Why no repaint
-Pivots are confirmed only after the swing lookback completes, and all pool detection runs on closed bars only. A sweep or break tag will never appear intrabar and then vanish.
-A pool is only evaluated for sweep or break once it has fully formed. A level still building cannot be resolved.
-No request.security() calls are used anywhere. All detection is chart-timeframe state.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Gabriel R. | AlphaScript
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Gabriel R. | AlphaScript
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.