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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.