Liquidity Contour Engine [JOAT]
Liquidity Contour Engine
Introduction
Liquidity Contour Engine is an overlay indicator that identifies two distinct institutional price phenomena: liquidity sweeps at swing highs and lows, and order blocks formed before impulsive structural moves. Liquidity sweep zones mark levels where price reached beyond a prior swing, triggering stop orders, then reversed — the classic footprint of a sweep-and-reversal sequence. Order block zones mark the last opposing candle before a significant directional impulse, representing the area where a large position was initiated.
The underlying premise is that institutions build and exit positions through order flow that leaves identifiable marks on the chart. A liquidity sweep is one such mark: price extending beyond a well-established swing level, clearing stops, then reversing. This behavior is not random — it reflects deliberate order accumulation at levels where retail stops cluster. Similarly, order blocks at the origin of impulsive moves may act as re-entry areas when price later returns to them.
Core Concepts
1. Confirmed Swing Pivot Detection
Swings are identified using ta.pivothigh and ta.pivotlow with a configurable lookback. All pivot detections are confirmed — offset by the lookback bars — meaning no repainting occurs. Only when sufficient bars have closed on both sides of a potential pivot is it registered.
2. Liquidity Sweep Detection
A bullish sweep is confirmed when: price wicks below the most recent swing low by at least a configurable ATR multiple, and the bar closes back above that swing low. This captures the wick-past-and-close-back pattern that characterizes institutional accumulation at liquidity levels. A bearish sweep is the mirror condition at swing highs.
Upon detection, a zone is created at the swept level, rendered as a dual-width line (thin solid + thick transparent shadow). Zones remain active until price sustains a close beyond the swept level by 0.5 ATR, at which point they convert to dotted lines (mitigated state).
3. Order Block Detection
An order block is identified as the prior N candle(s) before a structural impulse. A bullish impulse is defined as a bar that closes above the most recent swing high. The order block is the last candle body before that impulse, rendered as a filled box from body open to the wick high. Mitigation occurs when price closes beyond the 50% level of the order block body, fading the box to indicate the zone has been traded through.
4. Zone Lifecycle Management
The indicator uses arrays to track active zones and enforces a maximum count. When the maximum is exceeded, the oldest zone is removed from the chart. This prevents chart clutter while keeping the most recent and relevant zones visible.
Features
Liquidity Sweep Zones: Dual-width line rendering at swept swing levels, self-managing lifecycle
Order Block Boxes: Filled zones at order block origin, with mitigation fading
Swing Level Dotted Lines: Current swing high and low extensions as dotted reference lines
9-Row Dashboard: Sweep state, active zone counts, order block counts, last swing levels
Configurable ATR Threshold: Adjusts how far price must reach beyond a swing to qualify as a sweep
Max Zone Limit: Prevents chart clutter with configurable maximum active zone count
Input Parameters
Swing Lookback: Bars required each side for pivot confirmation (default: 8)
Sweep ATR Threshold: Minimum sweep distance in ATR units (default: 0.3)
Max Active Zones: Maximum concurrently displayed liquidity zones (default: 8)
ATR Period: Period for ATR calculation (default: 14)
Show Order Blocks: Toggle order block rendering
OB Lookback: How many bars back to identify the order block candle (default: 3)
How to Use This Indicator
Sweep-and-Reverse Setups
When a bullish sweep fires (price wicked below a swing low and closed back above), the zone represents the level where stops were taken. If price subsequently builds structure above that zone and delta pressure is positive, the setup is a potential long entry with the swept level as reference for the stop.
Order Block Re-Tests
When price returns to a bullish order block zone (shown in teal), it is revisiting the area where an institutional position was likely initiated. If the zone has not been mitigated (box remains filled), a reaction from that zone is plausible. A mitigated order block (faded) is a less reliable reference.
Zone Confluence
When a liquidity sweep zone and an order block coincide at the same price level, the confluence represents a stronger structural reference than either zone alone.
Limitations
Swing pivot confirmation introduces a bar lag equal to the lookback period. Sweeps and order blocks are identified after the fact, not in the moment they form
Not every liquidity sweep produces a reversal. Price can continue through a swept level without reversing
Order block identification is mechanical and cannot account for all institutional order placement strategies
On higher timeframes, zones cover wider price ranges and may require adjustment of the ATR threshold
Originality Statement
The unified framework for tracking liquidity sweeps and order blocks within a single indicator with a shared zone lifecycle management system is the original design contribution. Zone mitigation logic that converts active zones to passive reference lines (rather than deleting them) preserves structural context while visually indicating that a zone's primary relevance has passed. The dual-width shadow line rendering for sweep zones provides depth that distinguishes them clearly from standard horizontal lines.
Disclaimer
This indicator is for educational and informational purposes only. Liquidity sweep detection describes a pattern in historical price data. Past occurrences of this pattern do not guarantee future reactions. Order blocks are hypothetical areas of interest, not confirmed institutional levels. Always use proper risk management.
-Made with passion by officialjackofalltrades
Indicador Pine Script®






















