OPEN-SOURCE SCRIPT
Liquidity Sweeps EQH EQL TGFX

Liquidity Sweeps — EQH / EQL
OVERVIEW
Liquidity Sweeps — EQH / EQL is a price-action tool that highlights resting liquidity on the chart and shows when that liquidity is taken. It automatically detects clusters of equal swing highs (EQH) and equal swing lows (EQL), draws them as liquidity levels, and flags the moment price runs through a level and closes back on the other side — a liquidity sweep (also called a stop run or liquidity grab).
THE IDEA BEHIND IT
Stop orders tend to build up just beyond obvious swing highs and lows. When several swings form at roughly the same price, they create a visible pool of resting orders:
- Equal highs (EQH) sit above price and represent buy-side liquidity (buy stops / breakout buy orders).
- Equal lows (EQL) sit below price and represent sell-side liquidity (sell stops / breakout sell orders).
Price is often drawn toward these pools. A sweep occurs when price spikes through the level to trigger those orders and then closes back inside the range — frequently a sign that the move beyond the level lacked follow-through.
HOW IT WORKS
1. Swings are detected with confirmed Williams pivots (configurable left/right length).
2. When two consecutive pivot highs (or lows) form within an adaptive, ATR-based tolerance, they are treated as "equal" and a liquidity level is drawn at the extreme. The tolerance can also be set as a fixed tick distance.
3. Each level extends to the right until price reaches it.
4. A sweep is confirmed on bar close:
- Bearish sweep: a bar's high trades above an EQH but the bar closes back below it (buy-side liquidity taken).
- Bullish sweep: a bar's low trades below an EQL but the bar closes back above it (sell-side liquidity taken).
The swept level is then dimmed and stops extending, and a "SWEEP" label is placed.
HOW TO READ IT
- Red levels / "EQH" labels = buy-side liquidity resting above price.
- Green levels / "EQL" labels = sell-side liquidity resting below price.
- Solid line = level still intact (liquidity untouched).
- Dotted/dimmed line = level already swept.
- Red "SWEEP" above a candle = buy-side liquidity taken and rejected.
- Green "SWEEP" below a candle = sell-side liquidity taken and reclaimed.
- Multi-timeframe table: shows the most recent sweep direction on three higher timeframes (Bull / Bear / –) for higher-timeframe context at a glance. On each higher timeframe a sweep is measured as breaking the N-bar high/low and closing back inside.
SETTINGS
- Swing detection: pivot left/right bars control how large a swing must be before it counts. Lower = more, smaller swings (more sensitive); higher = fewer, more significant ones.
- Equal levels: tolerance mode (ATR or ticks), ATR length and multiplier, and a tick tolerance. A larger tolerance treats more pivots as "equal".
- Sweeps: show/hide sweep labels, and whether swept levels stay on the chart (dimmed) or are removed.
- Visual: colors for buy-side/sell-side, line width, label size, show/hide level labels.
- Multi-timeframe table: enable/disable, the three timeframes, the higher-timeframe sweep lookback, and the table position.
REPAINTING
Levels are built only from pivots that are already confirmed, so a level never appears and then disappears once drawn (by definition, a pivot is confirmed a number of bars after it forms, equal to the "right bars" setting). Sweeps are evaluated on bar close, so sweep labels and alerts do not change intrabar.
ALERTS
Two alerts are available: "Bullish liquidity sweep" and "Bearish liquidity sweep". Add them from the alert dialog and set them to trigger once per bar close.
NOTES
This script is an original implementation of standard, public price-action concepts (Williams pivots, equal highs/lows, liquidity sweeps). It is a visualization and context tool — it does not generate buy/sell signals and makes no claim about future performance. Sweeps are best combined with your own analysis (market structure, higher-timeframe context, risk management) rather than used in isolation.
OVERVIEW
Liquidity Sweeps — EQH / EQL is a price-action tool that highlights resting liquidity on the chart and shows when that liquidity is taken. It automatically detects clusters of equal swing highs (EQH) and equal swing lows (EQL), draws them as liquidity levels, and flags the moment price runs through a level and closes back on the other side — a liquidity sweep (also called a stop run or liquidity grab).
THE IDEA BEHIND IT
Stop orders tend to build up just beyond obvious swing highs and lows. When several swings form at roughly the same price, they create a visible pool of resting orders:
- Equal highs (EQH) sit above price and represent buy-side liquidity (buy stops / breakout buy orders).
- Equal lows (EQL) sit below price and represent sell-side liquidity (sell stops / breakout sell orders).
Price is often drawn toward these pools. A sweep occurs when price spikes through the level to trigger those orders and then closes back inside the range — frequently a sign that the move beyond the level lacked follow-through.
HOW IT WORKS
1. Swings are detected with confirmed Williams pivots (configurable left/right length).
2. When two consecutive pivot highs (or lows) form within an adaptive, ATR-based tolerance, they are treated as "equal" and a liquidity level is drawn at the extreme. The tolerance can also be set as a fixed tick distance.
3. Each level extends to the right until price reaches it.
4. A sweep is confirmed on bar close:
- Bearish sweep: a bar's high trades above an EQH but the bar closes back below it (buy-side liquidity taken).
- Bullish sweep: a bar's low trades below an EQL but the bar closes back above it (sell-side liquidity taken).
The swept level is then dimmed and stops extending, and a "SWEEP" label is placed.
HOW TO READ IT
- Red levels / "EQH" labels = buy-side liquidity resting above price.
- Green levels / "EQL" labels = sell-side liquidity resting below price.
- Solid line = level still intact (liquidity untouched).
- Dotted/dimmed line = level already swept.
- Red "SWEEP" above a candle = buy-side liquidity taken and rejected.
- Green "SWEEP" below a candle = sell-side liquidity taken and reclaimed.
- Multi-timeframe table: shows the most recent sweep direction on three higher timeframes (Bull / Bear / –) for higher-timeframe context at a glance. On each higher timeframe a sweep is measured as breaking the N-bar high/low and closing back inside.
SETTINGS
- Swing detection: pivot left/right bars control how large a swing must be before it counts. Lower = more, smaller swings (more sensitive); higher = fewer, more significant ones.
- Equal levels: tolerance mode (ATR or ticks), ATR length and multiplier, and a tick tolerance. A larger tolerance treats more pivots as "equal".
- Sweeps: show/hide sweep labels, and whether swept levels stay on the chart (dimmed) or are removed.
- Visual: colors for buy-side/sell-side, line width, label size, show/hide level labels.
- Multi-timeframe table: enable/disable, the three timeframes, the higher-timeframe sweep lookback, and the table position.
REPAINTING
Levels are built only from pivots that are already confirmed, so a level never appears and then disappears once drawn (by definition, a pivot is confirmed a number of bars after it forms, equal to the "right bars" setting). Sweeps are evaluated on bar close, so sweep labels and alerts do not change intrabar.
ALERTS
Two alerts are available: "Bullish liquidity sweep" and "Bearish liquidity sweep". Add them from the alert dialog and set them to trigger once per bar close.
NOTES
This script is an original implementation of standard, public price-action concepts (Williams pivots, equal highs/lows, liquidity sweeps). It is a visualization and context tool — it does not generate buy/sell signals and makes no claim about future performance. Sweeps are best combined with your own analysis (market structure, higher-timeframe context, risk management) rather than used in isolation.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。