OPEN-SOURCE SCRIPT
Session Sweep Detector | AlphaScript

🎯Session Sweep Detector
Tracks the High and Low of the Asia and London sessions and tells you exactly what happened to each level — using strict, transparent definitions.
🔍What it does
When a session closes, its High and Low become fixed liquidity levels.
This indicator draws each level from the exact candle that printed the extreme and watches it until the same session opens again the next day.
Each level resolves in exactly one of three ways:
⚡ SWEEP — price wicks through the level but the bar closes back on the original side. A liquidity raid: stops were taken, but the level held on a closing basis.
💥BREAK — a bar closes through the level. This is not a sweep, and the indicator never labels it as one. Breaks are displayed separately (and can be hidden) so the two events are never conflated.
🛡️Untouched — the level survives its full watch window without either event.
First qualifying event wins: one outcome per level, per session, per day. If a bar both pierces and closes through a level, it counts as a break — a close through the level can never be a sweep.
📖How to read the chart
-Solid colored lines are session levels. Each line starts at the candle that actually made the High or Low, so the line points at the liquidity itself.
-Live levels (still being watched) project ahead of price with a name and price label.
-After a sweep or break, the tag prints at the event bar and the line continues a configurable number of bars past the event before freezing — so you can see the reaction.
-Levels that were never touched freeze when their watch window ends.
⚙️Settings
-Toggle each level independently (Asia High/Low, London High/Low), with per-session colors and fully configurable session hours (times in New York time; defaults: Asia 18:00–04:00, London 03:00–12:00).
-Minimum wick penetration filter (in ticks) to ignore marginal pokes when qualifying sweeps. Does not apply to breaks.
-Control how many previous sessions' levels and tags remain on the chart, with optional transparency for past levels.
-Optional Opening Range Block overlay (off by default): draws the opening range of the New York, London, or Asia session with configurable duration, breakout arrows, mid line, and previous-range history. Note: ORB breakout detection and alerts only run while the ORB display is enabled.
🔔Alerts
Per-level sweep alerts (Asia High/Low, London High/Low), combined "Any Sweep" and "Any Break" alerts, and ORB breakout alerts. All alerts fire on the close of the event bar.
📌 Notes and limitations
-Designed for intraday timeframes (1 minute to 30 minutes). On higher timeframes, sessions span too few bars for meaningful detection.
-Session times are defined in New York time (America/New_York) and handle the midnight crossover correctly. If you use another session-levels indicator, match the session hours so both tools agree on where the levels are.
-Sweep-vs-break classification depends on your chart timeframe: a wick-through-and-reclaim on a 15m bar may resolve as a break on 1m if an intermediate bar closed beyond the level. Neither reading is wrong — they are answers to different questions — but be aware of it when comparing timeframes.
✅Why no repaint
-Events are evaluated on confirmed (closed) bars only. A sweep or break tag will never appear intrabar and then vanish.
-Levels are only armed after their session has fully completed. A session High that is still forming cannot be "swept" — price touching it would simply extend it — so no detection runs until the level is final.
-No request.security() calls are used anywhere. All session tracking is chart-timeframe state.
Tracks the High and Low of the Asia and London sessions and tells you exactly what happened to each level — using strict, transparent definitions.
🔍What it does
When a session closes, its High and Low become fixed liquidity levels.
This indicator draws each level from the exact candle that printed the extreme and watches it until the same session opens again the next day.
Each level resolves in exactly one of three ways:
⚡ SWEEP — price wicks through the level but the bar closes back on the original side. A liquidity raid: stops were taken, but the level held on a closing basis.
💥BREAK — a bar closes through the level. This is not a sweep, and the indicator never labels it as one. Breaks are displayed separately (and can be hidden) so the two events are never conflated.
🛡️Untouched — the level survives its full watch window without either event.
First qualifying event wins: one outcome per level, per session, per day. If a bar both pierces and closes through a level, it counts as a break — a close through the level can never be a sweep.
📖How to read the chart
-Solid colored lines are session levels. Each line starts at the candle that actually made the High or Low, so the line points at the liquidity itself.
-Live levels (still being watched) project ahead of price with a name and price label.
-After a sweep or break, the tag prints at the event bar and the line continues a configurable number of bars past the event before freezing — so you can see the reaction.
-Levels that were never touched freeze when their watch window ends.
⚙️Settings
-Toggle each level independently (Asia High/Low, London High/Low), with per-session colors and fully configurable session hours (times in New York time; defaults: Asia 18:00–04:00, London 03:00–12:00).
-Minimum wick penetration filter (in ticks) to ignore marginal pokes when qualifying sweeps. Does not apply to breaks.
-Control how many previous sessions' levels and tags remain on the chart, with optional transparency for past levels.
-Optional Opening Range Block overlay (off by default): draws the opening range of the New York, London, or Asia session with configurable duration, breakout arrows, mid line, and previous-range history. Note: ORB breakout detection and alerts only run while the ORB display is enabled.
🔔Alerts
Per-level sweep alerts (Asia High/Low, London High/Low), combined "Any Sweep" and "Any Break" alerts, and ORB breakout alerts. All alerts fire on the close of the event bar.
📌 Notes and limitations
-Designed for intraday timeframes (1 minute to 30 minutes). On higher timeframes, sessions span too few bars for meaningful detection.
-Session times are defined in New York time (America/New_York) and handle the midnight crossover correctly. If you use another session-levels indicator, match the session hours so both tools agree on where the levels are.
-Sweep-vs-break classification depends on your chart timeframe: a wick-through-and-reclaim on a 15m bar may resolve as a break on 1m if an intermediate bar closed beyond the level. Neither reading is wrong — they are answers to different questions — but be aware of it when comparing timeframes.
✅Why no repaint
-Events are evaluated on confirmed (closed) bars only. A sweep or break tag will never appear intrabar and then vanish.
-Levels are only armed after their session has fully completed. A session High that is still forming cannot be "swept" — price touching it would simply extend it — so no detection runs until the level is final.
-No request.security() calls are used anywhere. All session tracking is chart-timeframe state.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
Gabriel R. | AlphaScript
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
Gabriel R. | AlphaScript
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。