Liquidity Sweep Probability [JOAT]Liquidity Sweep Probability is an open-source Pine Script v6 overlay that maps equal highs and equal lows, tracks sweeps through those levels, detects reclaim behavior, and records simple continuation samples after reclaim events. It is designed for traders who want a clean way to observe where price has built nearby liquidity and how price behaves after that liquidity is tested.
The script does not claim that a sweep must reverse price. Instead, it separates equal-level creation, sweep, reclaim, break, and continuation outcomes. The dashboard shows the most recent event, the side involved, sample counts, and an adaptive probability-style reading derived from the script's own observed samples.
Core Concepts
1. Equal High and Equal Low Detection
Confirmed pivots are compared against the previous pivot on the same side. If two pivot highs or lows are within an ATR-based tolerance, a liquidity zone is created.
pivotHigh = ta.pivothigh(high, pivotLength, pivotLength)
if not na(lastHighPivot) and math.abs(pivotHigh - lastHighPivot) <= equalTolerance
zoneTop = math.max(pivotHigh, lastHighPivot) + zonePadding
zoneBottom = math.min(pivotHigh, lastHighPivot) - zonePadding
2. Sweep State
A high-side sweep occurs when price trades beyond the equal high zone but closes back below the zone top. A low-side sweep occurs when price trades below the equal low zone but closes back above the zone bottom.
3. Reclaim State
After a sweep, the script watches a configurable reclaim window. A high-side reclaim requires price to close back below the lower boundary of the swept high zone. A low-side reclaim requires price to close back above the upper boundary of the swept low zone.
4. Continuation Sampling
After reclaim, the script stores a target distance based on ATR and tracks whether price reaches it within the outcome window. These counts are displayed as samples. They are descriptive statistics from the chart, not a prediction.
5. Probability Panel
The probability-style score blends observed sample rate, sweep distance, zone age, and reclaim status. It gives a compact read of the current event context.
sampleRate = total > 0 ? (wins * 100.0) / total : 50.0
score = clamp(sampleRate * 0.62 + 19.0 + distanceBoost + ageBoost + reclaimBoost, 5.0, 95.0)
Features
Equal high and equal low zones: ATR tolerance avoids exact-price-only matching
Sweep detection: Tracks confirmed high-side and low-side liquidity sweeps
Reclaim detection: Separates immediate breaks from reclaim behavior
Continuation samples: Counts historical reclaim outcomes within the active chart sample
Dashed midlines: Each zone includes a center reference line
Stateful labels: Zones update from Equal High/Low to Sweep, Reclaimed, or Broken
Probability panel: Shows side, status, chance value, samples, and age
Alerts: Sweep, reclaim, and zone break conditions
Input Parameters
Swings:
Swing Pivot Length: Pivot sensitivity for equal-level detection
Equal-Level Tolerance: ATR fraction used to compare pivots
Zone Padding: ATR fraction added around the equal level
ATR Length: Volatility length for tolerance and padding
Behavior:
Reclaim Window: Bars allowed for reclaim after sweep
Continuation Window: Bars allowed for measuring post-reclaim continuation
Continuation Distance: ATR target used for sample tracking
Maximum Zones Per Side: Object cap for high and low zones
Visual:
Palette: Selects bull and bear colors
Zone Extension Bars: Forward extension for boxes and midlines
Probability Panel: Shows or hides the dashboard
How to Use This Indicator
Step 1: Identify Equal-Level Zones
Equal highs can act as high-side liquidity references. Equal lows can act as low-side liquidity references.
Step 2: Watch for Sweep and Reclaim
A sweep alone is not enough. Reclaim behavior shows that price tested outside the zone and then closed back through the zone boundary.
Step 3: Read the Sample Count
The sample row shows how many observed reclaim events reached their ATR target on the current chart sample. A small sample should be treated carefully.
Step 4: Use Zones as Context
Use the zones to frame liquidity behavior, then combine the context with your own entry trigger and risk plan.
Indicator Limitations
Equal-level zones are based on confirmed pivots, so they appear after the pivot confirmation window
The probability value is descriptive and chart-dependent
A small number of samples should not be treated as statistically strong
Fast markets may sweep, reclaim, and break multiple zones quickly
Object limits require the script to delete older zones when caps are reached
Originality Statement
Liquidity Sweep Probability is original in its state machine for equal-level zones, sweep/reclaim/break classification, and live sample tracking. It uses public Pine v6 mechanics to build a self-contained liquidity map without copying another indicator's source.
Disclaimer
This script is provided for educational and informational use only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Liquidity sweeps can continue, reverse, or fail without warning. Always use independent analysis and proper risk management.
-Made with passion by jackofalltrades
Pine Script® indicator






















