Session Sweep Reversal Predictor - PhenLabs🚀 #67 Session Sweep Reversal Predictor - PhenLabs
📌 Overview
Session Sweep Reversal Predictor helps traders evaluate whether a confirmed session liquidity sweep is more likely to reverse or continue. It tracks Asian, London, and New York session ranges, detects qualified sweeps of prior session highs or lows, then uses a rolling Bayesian model to estimate reversal and continuation probability from previous sweep outcomes.
Instead of showing every wick through a level, SSRP filters for displacement using candle size versus ATR and body-to-range quality. The goal is to highlight cleaner sweep events where price actually shows intent after taking session liquidity.
📊 Core Idea
Markets often build liquidity around session highs and lows. When a later session sweeps a prior session range, the key question is not just “was liquidity taken?” but “did this sweep behave like prior sweeps that reversed, or like prior sweeps that continued?”
SSRP answers that question with a rolling event model. Each qualified sweep is classified by candle structure, displacement, and close location, then compared against historical outcomes inside the selected lookback window.
🚀 Key Features
✅ Tracks Asian, London, and New York session ranges
✅ Detects wick sweeps with rejection closes
✅ Optional failed-close sweep detection
✅ Session-aware sweep logic: London can sweep Asian, New York can sweep London or Asian
✅ Displacement filters using ATR expansion and body/range quality
✅ Rolling Naive Bayes probability model
✅ Reversal and continuation probability labels
✅ Session range boxes, session background tint, swept-level lines, and dashboard table
✅ Alerts for high reversal-probability and high continuation-probability sweeps
🔧 Settings
Session Timezone
Default: America/New_York
Options: America/New_York, Europe/London, Asia/Tokyo, UTC, exchange
Description: Timezone used for hour-based session classification.
Asian / London / New York Session
Default: Asian 18:00–03:00, London 03:00–07:59, New York 08:00–16:00
Description: Reference session windows for the model’s intended session structure. The script evaluates sessions by hour in the selected timezone.
Detect Wick Sweeps
Default: On
Description: Detects sweeps where price straddles a locked session level and closes back through it.
Detect Failed-Close Sweeps
Default: Off
Description: Detects sweeps where one bar closes beyond the level and the next bar reclaims it.
London may sweep Asian range
Default: On
Description: Allows London-session sweeps of the completed Asian range.
New York may sweep Asian range
Default: On
Description: Allows New York-session sweeps of the completed Asian range.
New York may sweep London range
Default: On
Description: Allows New York-session sweeps of the completed London range. New York gives London levels priority before falling back to Asian levels.
ATR Length
Default: 14
Description: ATR period used for displacement qualification and outcome measurement.
Min Candle Size × ATR
Default: 1.5
Description: Minimum candle range relative to ATR required for a sweep to qualify.
Min Body/Range Ratio
Default: 0.5
Description: Minimum body quality required to reduce weak wick-only signals.
Rolling Lookback
Default: 100 sweep events
Description: Number of prior sweep events retained in the probability model.
Laplace Smoothing α
Default: 4.3
Description: Smoothing factor used by the Bayesian model so early samples do not become overconfident.
Outcome Forward Bars
Default: 10
Description: Number of bars after a sweep used to classify whether the event reversed or continued.
Reversal Threshold %
Default: 60
Description: Probability level required to trigger high-reversal visual emphasis and alerts.
Continuation Threshold %
Default: 60
Description: Probability level required to trigger high-continuation visual emphasis and alerts.
🔥 How It Works
1. Build session ranges
• Asian, London, and New York highs/lows are tracked independently.
• When a session ends, its range is locked for later sweep detection.
• New Asian session starts reset prior London and New York levels for the new day.
2. Detect qualified sweeps
• London can sweep the completed Asian range.
• New York can sweep the completed London range first, then Asian range.
• A high sweep requires price to trade above the level and close back below it.
• A low sweep requires price to trade below the level and close back above it.
3. Filter for displacement
• Candle range must be large enough versus ATR.
• Candle body must represent enough of the full candle range.
• This helps reduce weak, noisy liquidity taps.
4. Score the sweep
• The model bins body quality, candle size, and close location.
• It estimates reversal versus continuation odds using a rolling Naive Bayes model.
• Laplace smoothing keeps the model from becoming too extreme on small samples.
5. Label the outcome
• After the selected forward-bar window, the script checks whether price moved at least one event ATR back through the swept level.
• If it did, the event is labeled as a reversal.
• If it did not, the event is labeled as continuation.
🎨 Visual Guide
• Blue box: Asian session range
• Orange box: London session range
• Background tint: active session
• Yellow dashed line: swept level
• Green label: reversal probability above threshold
• Red label: continuation probability above threshold
• Gray label: no high-confidence edge
• Dashboard: most recent sweep events, session, source range, direction, probabilities, and outcome status
📖 How to Interpret Signals
High Sweep
A prior session high was taken. A high reversal probability suggests the model favors downside reaction from the sweep. A high continuation probability suggests the model favors upside continuation after the liquidity take.
Low Sweep
A prior session low was taken. A high reversal probability suggests the model favors upside reaction from the sweep. A high continuation probability suggests the model favors downside continuation after the liquidity take.
REV %
Estimated probability that the sweep reverses by at least one event ATR within the forward-bar window.
CONT %
Estimated probability that the sweep does not meet the reversal condition within the forward-bar window.
✅ Best Used For
SSRP is designed for intraday traders who watch session liquidity, especially London and New York open behavior. It is most useful on liquid markets with clean session structure, such as major FX pairs, index futures, crypto majors, and high-volume equities.
⚠️ Important Notes
This is a statistical context tool, not a guaranteed prediction engine. The Bayesian probabilities are based only on the script’s rolling sample of prior qualified sweep events. Early chart history, low-liquidity symbols, unusual sessions, and small lookback samples can make the probabilities less stable.
Indicador Pine Script®






















