OPEN-SOURCE SCRIPT
Liquidity Sweep Follow-Through Guard

A wick through an obvious high or low is often called a liquidity sweep. The useful question is what price does after the level is reclaimed.
**Liquidity Sweep Follow-Through Guard** identifies a sweep of a prior lookback extreme, requires a close back inside that reference, and then evaluates the reversal through holding, extension and path efficiency. The swept level, extreme and ATR reference are frozen when the episode begins.
## Visual guide
- **S+** — a prior low was swept and reclaimed, opening a bullish observation.
- **S−** — a prior high was swept and reclaimed, opening a bearish observation.
- **Shaded zone** — the area between the reclaimed level and the sweep extreme.
- **Orange line** — the frozen reference that must remain reclaimed.
- **Blue line** — the minimum reversal extension.
- **F+ / F−** — efficient bullish or bearish follow-through was confirmed.
- **R** — a confirmed close lost the reclaimed reference.
- **X** — a confirmed close crossed the sweep extreme and fully failed the setup.
- **T** — the observation window expired without a terminal result.
The display is intentionally compact. It has no table and requires no companion indicator.
## Sweep detection
The reference is the highest high or lowest low of the previous 20 completed bars. The current candle must exceed that level by at least 0.10 previous-bar ATR, close back inside it, and devote at least 35% of its range to the rejection wick. References exclude the current bar and are never backdated.
If one exceptional candle sweeps both sides, the candle’s closing direction resolves which episode is tracked. Only one episode can be active at a time.
## Follow-through test
The default confirmation requires:
1. Two consecutive closes remain on the reclaimed side of the frozen reference.
2. Price travels at least 0.30 frozen ATR from the sweep candle close in the reversal direction.
3. Directional progress represents at least 45% of the cumulative close-to-close path after the sweep.
Path efficiency distinguishes direct follow-through from an equally large but noisy move. Repeated back-and-forth closes add traveled path without adding the same directional progress.
## Example
Suppose the lowest low of the prior 20 bars is 100 and frozen ATR is 4. Price trades down to 99.4, then closes at 101 with a qualifying lower wick. The orange reference remains 100 and the default extension target is 102.2. If two closes hold above 100, price reaches 102.2 and efficiency is at least 45%, **F+** is printed. A later close below 100 prints **R**. A close below 99.4 prints **X** and takes priority.
## Behavior and limitations
All state changes and markers occur on confirmed bars. The script uses no future bars, pivot backdating or lookahead requests. Wicks detect the initial sweep, while failure outcomes require confirmed closes.
A sweep is a price pattern, not proof of orders, stop placement or participant intent. Thresholds behave differently across symbols and timeframes. The indicator does not predict outcomes, place trades, size positions or model fees, slippage, liquidity and execution. Standard candles are recommended for interpreting its price-based rules.
BotTradeLab — Human judgment, AI-assisted analysis.
**Liquidity Sweep Follow-Through Guard** identifies a sweep of a prior lookback extreme, requires a close back inside that reference, and then evaluates the reversal through holding, extension and path efficiency. The swept level, extreme and ATR reference are frozen when the episode begins.
## Visual guide
- **S+** — a prior low was swept and reclaimed, opening a bullish observation.
- **S−** — a prior high was swept and reclaimed, opening a bearish observation.
- **Shaded zone** — the area between the reclaimed level and the sweep extreme.
- **Orange line** — the frozen reference that must remain reclaimed.
- **Blue line** — the minimum reversal extension.
- **F+ / F−** — efficient bullish or bearish follow-through was confirmed.
- **R** — a confirmed close lost the reclaimed reference.
- **X** — a confirmed close crossed the sweep extreme and fully failed the setup.
- **T** — the observation window expired without a terminal result.
The display is intentionally compact. It has no table and requires no companion indicator.
## Sweep detection
The reference is the highest high or lowest low of the previous 20 completed bars. The current candle must exceed that level by at least 0.10 previous-bar ATR, close back inside it, and devote at least 35% of its range to the rejection wick. References exclude the current bar and are never backdated.
If one exceptional candle sweeps both sides, the candle’s closing direction resolves which episode is tracked. Only one episode can be active at a time.
## Follow-through test
The default confirmation requires:
1. Two consecutive closes remain on the reclaimed side of the frozen reference.
2. Price travels at least 0.30 frozen ATR from the sweep candle close in the reversal direction.
3. Directional progress represents at least 45% of the cumulative close-to-close path after the sweep.
Path efficiency distinguishes direct follow-through from an equally large but noisy move. Repeated back-and-forth closes add traveled path without adding the same directional progress.
## Example
Suppose the lowest low of the prior 20 bars is 100 and frozen ATR is 4. Price trades down to 99.4, then closes at 101 with a qualifying lower wick. The orange reference remains 100 and the default extension target is 102.2. If two closes hold above 100, price reaches 102.2 and efficiency is at least 45%, **F+** is printed. A later close below 100 prints **R**. A close below 99.4 prints **X** and takes priority.
## Behavior and limitations
All state changes and markers occur on confirmed bars. The script uses no future bars, pivot backdating or lookahead requests. Wicks detect the initial sweep, while failure outcomes require confirmed closes.
A sweep is a price pattern, not proof of orders, stop placement or participant intent. Thresholds behave differently across symbols and timeframes. The indicator does not predict outcomes, place trades, size positions or model fees, slippage, liquidity and execution. Standard candles are recommended for interpreting its price-based rules.
BotTradeLab — Human judgment, AI-assisted analysis.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.