Liquidity Sweep Profiler | Flux ChartsGENERAL OVERVIEW:
The Liquidity Sweep Profiler is a multi-source liquidity tracking and outcome statistics indicator. It automatically identifies key liquidity levels across three categories (intraday sessions, higher timeframe key levels, and chart structure), monitors each level for sweep events (wick pierces with rejection), and then tracks what happens after each sweep over a configurable watch window. Every resolved sweep is recorded in an internal history that powers a dashboard showing, by liquidity type, the average reversal magnitude, average breach magnitude, and an Edge ratio between the two. The dashboard highlights the liquidity type with the strongest historical edge on the current chart and instrument.
The indicator plots session high/low lines (Asia, London, NY AM, NY Lunch, NY PM), previous-period highs and lows (PDH/PDL, PWH/PWL, PMH/PML), and chart structure liquidity (Swing Highs/Lows, EQH/EQL clusters). When a level is swept, it draws a Sweep Zone box marking the rejection range and an x marker at the wick extreme. An Active Sweep Tracker label shows the live performance of the most recent unresolved sweep against its historical baseline. The indicator is multi-timeframe, session-based, statistical, and rules-based. Optional quality filters let the user restrict the statistics to sweeps that meet specific volume, wick, or delta thresholds.
Screenshot: a hero shot showing session, key level, and structure liquidity lines on one chart with several Sweep Zones marked, plus the dashboard visible in a corner.
WHAT IS THE THEORY BEHIND THE INDICATOR?
In intraday and swing trading, certain price levels function as "liquidity pools", areas where a critical mass of resting orders (stop losses, breakout buy/sell orders, and pending entries) tends to accumulate. The high of yesterday, the low of last week, the high of the London session, and a recent swing high are all examples of such levels. When price reaches these levels, the resting orders get triggered, which can produce one of two outcomes: a sustained breakout where the order flow continues past the level, or a sweep where price briefly pierces the level, triggers the orders, and then reverses back through it. The sweep outcome is what this indicator is designed to detect and study.
Different liquidity types behave differently. On some instruments, swept session highs and lows tend to reverse cleanly. On others, sweeps of weekly or monthly extremes are more reliable. On yet others, sweeps of equal highs and lows (clustered pivots) outperform sweeps of standalone swing points. The behavioral pattern can also vary by day of the week and by whether the sweep candle showed strong rejection characteristics (high relative volume, large rejection wick, strong intrabar volume imbalance toward the rejection direction). The Liquidity Sweep Profiler treats every sweep as a data point, records the recovery and breach magnitudes that followed it, and aggregates the data by liquidity type to surface which type has shown the strongest reversal tendency on the specific chart and instrument the trader is using.
This is a statistical profile, not a prediction. The dashboard reports what has happened historically on the current chart. The trader uses that profile to focus attention on the liquidity types with the strongest empirical edge, while remaining aware that future behavior can deviate from past behavior. Every sweep is treated as evidence to be aggregated, and the indicator surfaces the resulting profile for the trader to interpret.
FEATURES:
◇ Multi-source liquidity detection (sessions, higher timeframe key levels, structure)
◇ Sweep detection with configurable confirmation window
◇ Sweep Zone boxes and x markers
◇ Outcome tracking (recovery and breach magnitudes over a watch window)
◇ Statistics dashboard with per-type sweep counts, averages, and Edge ratios
◇ Best-Edge banner highlighting the top-performing liquidity type
◇ Active Sweep Tracker for live monitoring of the most recent sweep
◇ Quality filters (relative volume, wick %, intrabar delta %)
◇ Trading-day filter (per-weekday inclusion)
◇ Display unit selector (ATR, Price, Pips, Ticks)
◇ Configurable label, line, zone, and theme styling
◇ Built-in alerts for new sweeps and high-edge sweeps
Screenshot: a clean overview showing one example from each liquidity category (a session line, a PDH, EQL/EQL line) with their distinct color coding visible.
LIQUIDITY LEVEL DETECTION
🔹 What are liquidity levels?
A liquidity level is a price where resting orders tend to accumulate. The Liquidity Sweep Profiler tracks three categories:
◇ Session liquidity: the high and low formed during each defined intraday session (Asia, London, NY AM, NY Lunch, NY PM). Each session is a configurable time window.
◇ Key levels: the high and low of the previous completed day (PDH/PDL), week (PWH/PWL), and month (PMH/PML).
◇ Structure liquidity: pivot-based swing highs and lows detected on the current chart, plus EQH/EQL clusters where two or more recent pivots formed at approximately the same price.
🔹 Why do these levels matter?
Each category captures a different participant base. Session highs and lows matter to intraday traders working specific market hours. Daily, weekly, and monthly extremes matter to swing traders and institutional desks that operate on those reference points. Swing pivots and equal highs/lows matter to participants who place orders relative to recent chart structure. By tracking all three in one indicator, the trader can observe which category produces the most reliable sweep behavior on the specific instrument.
🔹 How are levels detected?
Session levels are tracked in real time during each session window. The session detector evaluates whether the current bar's New York time falls inside the session's start-end string. While the session is active, the indicator maintains a running high and low, updating both the level and the bar index of each extreme on every new high or low. When the session window closes (the next bar is outside the session), both the final high and the final low are stored as liquidity levels, with the bar index of the actual extreme preserved as the level's anchor bar.
Previous-period levels are fetched from the daily, weekly, and monthly timeframes. The indicator requests the prior period's high and low (offset by one period, so the value is stable and never references the still-developing current period). Each time the fetched value changes (which happens once per new day, week, or month), the new level is added to tracking.
Structure liquidity uses standard pivot detection with a configurable lookback length (default 5 bars on each side). When a new pivot high or pivot low forms, it is checked against the most recent prior pivots in the same direction: if it falls within an ATR-based threshold (default 0.1 x ATR) of one of the last three same-side pivots, it is classified as an EQH or EQL. Otherwise it is recorded as a standalone Swing High or Swing Low.
For each category, a Track Last input controls how many of the most recent levels of each type are kept on the chart simultaneously. When a new level of a given type is added, the oldest level of that same type is trimmed from the tracking array if the count exceeds the limit.
Screenshot: showing session-derived levels (dashed lines), HTF key levels (solid lines), and structure levels (dotted lines)
🔹 Settings
◇ Session enable toggles, names, time windows (in New York timezone), and per-session colors for all five sessions.
◇ Track Last (Sessions): how many days of session highs and lows to keep tracked. Default 1.
◇ Enable PDH/PDL, PWH/PWL, PMH/PML with individual color pickers.
◇ Track Last (Previous Periods): number of previous periods kept per type (days for PDH/PDL, weeks for PWH/PWL, months for PMH/PML). Default 1.
◇ Pivot Length: number of bars on each side used for pivot detection. Default 5.
◇ EQH/EQL Threshold (ATR): two pivots within this multiple of ATR distance count as equal. Default 0.1.
◇ Track Last (Structure): number of structure levels kept per type. Default 5.
🔹 Customization
◇ Per-category visibility toggles under Visual Overlays (Session Liq, PDH/PDL, PWH/PWL, PMH/PML, Swings, EQH/EQL).
◇ Day Suffix toggle: appends (Today), (Yest), or (-Nd) to session labels when tracking more than one day of session liquidity.
◇ Boxes toggle: optionally renders the live session range as a translucent box while the session is active.
SWEEP DETECTION
🔹 What is a sweep?
A sweep occurs when price reaches a tracked liquidity level, briefly trades beyond it with its wick, and then closes back through it within a defined confirmation window. The wick pierces the level (triggering the resting orders), but the candle body closes back on the original side, indicating that the move past the level was rejected. This is the canonical stop-run-and-reverse pattern.
🔹 Why does the confirmation window matter?
A pure same-bar sweep requires the same candle to both pierce the level with its wick and close back through it. This is the strictest definition and captures the cleanest rejections. Allowing one or more additional bars for the close to come back through captures sweeps that take a slightly longer time to resolve, at the cost of including weaker rejections. The trader picks the trade-off they prefer using the Sweep Confirmation Window input.
🔹 How are sweeps detected?
Each tracked level carries two state flags: pierced and taken. On every new bar, the indicator walks the list of untaken levels and evaluates two conditions per level:
◇ Wick-through: for a high-side level, the bar's high exceeds the level. For a low-side level, the bar's low falls below the level.
◇ Closed-back: for a high-side level, the bar's close is below the level. For a low-side level, the close is above it.
The flow is:
◇ If the level is not yet pierced and the wick-through condition is true on this bar, the level is marked pierced, the piercing bar index is stored, and the wick extreme is recorded. If the closed-back condition is also true on the same bar, the level is immediately marked taken (a same-bar sweep).
◇ If the level was already pierced on a previous bar, the indicator first updates the wick extreme if the current bar exceeded the previous extreme. It then checks how many bars have elapsed since the pierce. If the elapsed count exceeds the confirmation window, the level is marked taken with the broken flag set (clean breakout, no rejection). Otherwise, if closed-back is true on the current bar, the level is marked taken with broken cleared (confirmed sweep).
When a sweep confirms (taken, broken = false), the indicator captures a snapshot of the sweep candle's context:
◇ Relative volume: current bar's volume divided by the 20-bar simple moving average of volume.
◇ Wick percentage: the rejection wick's share of the candle's total range. For a high sweep, this is (high − max(open, close)) / (high − low) x 100. For a low sweep, (min(open, close) − low) / (high − low) x 100.
◇ Intrabar volume delta: the share of lower-timeframe volume on the rejecting side. The indicator requests lower-timeframe up-volume (close > open) and down-volume (close < open) for the bar, sums both, and computes the rejecting side's share. For a high sweep, that's down-volume / total. For a low sweep, up-volume / total.
These three values are stored on the sweep record and become the basis for the optional quality filters.
🔹 Bullish Example (low sweep)
A Swing Low at 1.0850 sits on the chart. Price drops to 1.0840 on a single candle (wick extreme), then closes at 1.0855, back above the original level. The level is marked as swept (low sweep), a green Sweep Zone box is drawn from the wick extreme up to the level, and an x marker is plotted at 1.0840.
🔹 Bearish Example (high sweep)
A PDH sits at 1.0950. Price rallies to 1.0965 on the wick, then closes at 1.0945, back below the original level. The level is marked as swept (high sweep), a red Sweep Zone box is drawn from the level up to the wick extreme, and an x marker is plotted at 1.0965.
Screenshot: bullish low sweep and one bearish high sweep visible on the same chart, both with their Sweep Zone boxes and x markers rendered.
🔹 Settings
◇ Sweep Confirmation Window: number of additional bars allowed after the wick pierce for the close to come back through. 0 = same-bar rejection only. 1 = same-bar or next bar. Default 0.
🔹 Customization
◇ Show Sweep Zones: toggle Sweep Zone box rendering.
◇ High Sweep Zone Color / Low Sweep Zone Color: customize the fill color for high-sweep and low-sweep zones.
◇ Show Sweep x Mark: toggle the x marker plotted at the wick extreme of each confirmed sweep.
OUTCOME TRACKING
🔹 What is outcome tracking?
Detecting that a sweep occurred is only half the picture. To know whether a particular liquidity type tends to produce reversals worth trading, the indicator also needs to measure what happened after the sweep. Outcome tracking does this by monitoring each confirmed sweep for a fixed number of bars and recording two values:
◇ Recovery: the maximum favorable excursion away from the swept level (in the rejecting direction). For a high sweep, this is how far price fell below the sweep candle's close. For a low sweep, how far the price rose above it.
◇ Breach: the maximum adverse excursion past the swept level (in the original sweep direction). For a high sweep, how far price went above the sweep candle's close. For a low sweep, how far the price went below it.
🔹 Why measure both?
Recovery alone could mislead. A liquidity type might produce large reversals on average but also large breaches when the sweep fails, which is information the trader needs. Tracking both Recovery and Breach, and then computing their ratio as an Edge value (Recovery / Breach), captures the full risk-reward profile of sweeps on that level type. An Edge above 1 indicates the type tends to deliver more reversal magnitude than breach magnitude on average.
🔹 How is outcome tracking calculated?
When a sweep confirms, the indicator stores the sweep candle's close price, the ATR value at that moment (using the configured ATR length, default 14), and the other metadata snapshot. From the next bar onward, for the configured Outcome Watch Window (default 20 bars), it computes two per-bar values:
◇ Recovery on the current bar = (sweep_close − low) / sweep_ATR for high sweeps, or (high − sweep_close) / sweep_ATR for low sweeps.
◇ Breach on the current bar = (high − sweep_close) / sweep_ATR for high sweeps, or (sweep_close − low) / sweep_ATR for low sweeps.
The running maximum of each is updated bar by bar. When the watch window expires (bars since sweep ≥ watch window), the sweep is marked completed and its final maxRecovery, maxBreach, and metadata snapshot are pushed into the indicator's history array along with the resolution day's weekday. This history is what powers the dashboard.
If the level was classified as broken instead of swept (the confirmation window expired without a close-back-through), the record is not added to the history, since the indicator only counts confirmed sweep outcomes.
Recovery and Breach are stored in the history as ATR multiples to keep them comparable across different volatility regimes. The dashboard's Display Unit input converts them to ATR multiples, Price, Pips, or Ticks for display at render time. Pip conversion uses mintick x 10 (or x 100 for JPY pairs), and Tick conversion uses raw mintick.
Screenshot: A swept level showing two arrows. One marks how far price moved back (Recovery). The other marks how far price moved past the level (Breach).
🔹 Settings
◇ Outcome Watch Window: number of bars to track each sweep for measuring Recovery and Breach. Default 20.
◇ ATR Length: ATR period used for the volatility snapshot at sweep time. Default 14.
STATISTICS DASHBOARD
🔹 What is the dashboard?
The dashboard is the analytic output of the indicator. It aggregates every completed sweep in the history array and displays per-type statistics in a table grouped by category. The columns are:
◇ Type: the liquidity type (Asia High, PDH, Swing Low, etc.).
◇ Total Sweeps: number of completed sweep records for that type that passed all active filters.
◇ Avg Recovery: average maximum favorable excursion, in the selected Display Unit.
◇ Avg Breach: average maximum adverse excursion, in the selected Display Unit.
◇ Edge: Avg Recovery / Avg Breach. A value above 1 means recovery has typically exceeded breach on that type.
The row with the highest Edge (subject to a minimum sample count of 5) is highlighted, and a Best Edge banner above the table calls out the winning type explicitly. Types with fewer than 5 samples can appear in the table but are excluded from the Best Edge competition.
🔹 Why aggregate by type?
The whole point of the indicator is to surface which liquidity types behave reliably on the current chart. A flat list of every sweep is not actionable. Grouping by type and computing aggregate statistics turns the raw sweep records into a usable trading profile.
🔹 How are statistics calculated?
For each liquidity type, the indicator walks the history array and filters by the active toggles (trading-day filter, relative volume filter, wick % filter, delta % filter). For records that pass all filters, it converts each stored ATR-multiple to the current Display Unit and sums the Recovery and Breach values. Avg Recovery and Avg Breach are computed by dividing the running sums by the filtered count. Edge is the ratio of the resulting averages.
To pick the Best Edge across all categories, the indicator runs the same aggregation for every active liquidity type (sessions, key levels, structure), filters out types with fewer than 5 samples, and selects the one with the highest Edge. The selection is independent of category, so a Swing High can win over an Asia Low if its Edge is higher and its sample count qualifies.
In the table itself, Avg Recovery is colored green when it exceeds Avg Breach for that row. Avg Breach is colored red when it exceeds Avg Recovery. The Edge cell is colored green at 1.5 or above, neutral between 1.0 and 1.5, and red below 1.0. The Best Edge row gets a green background and a star marker.
Screenshot: a close-up of the dashboard table showing all three category sections (Sessions, Key Levels, Structure) populated with realistic data, with the Best Edge banner visible and one row highlighted as the winner.
🔹 Settings
◇ Show Dashboard: master toggle.
◇ Theme: Dark Mode or Light Mode.
Screenshot: Showing Light Mode Theme
◇ Position: nine-position selector for table placement (Top Left, Top Center, Top Right, Middle Left, Middle Center, Middle Right, Bottom Left, Bottom Center, Bottom Right).
◇ Text Size: Tiny, Small, Normal, Large, Huge.
◇ Display Unit: ATR (volatility-normalized multiples), Price (raw price excursion), Pips (mintick x 10 for forex, x 100 for JPY pairs), Ticks (mintick units).
Screenshot: the dashboard configured to show only the liquidity types the user enabled. Sessions section shows only London High and London Low. Key Levels shows only PDH and PDL. Structure shows only EQH and EQL. Disabled types are filtered out of the table entirely.
QUALITY FILTERS
🔹 What are quality filters?
Quality filters restrict the sweeps that get counted in the dashboard statistics. Each one is independently togglable, and any combination can be active at once.
◇ Volume Spike Multiplier: the sweep candle's volume must be at least this multiple of its 20-bar volume average. Default 1.5x.
◇ Sweep Wick %: the rejection wick must be at least this percent of the candle's total range. Default 50%.
◇ Sweep Delta %: the rejecting side's intrabar volume share must be at least this percent of total intrabar volume. The lower timeframe used to compute delta is configurable (default 1 minute).
🔹 Why filter quality?
Not every sweep is equal. A sweep that occurs on heavy volume, with a long rejection wick, and with the rejecting side dominating intrabar volume is a fundamentally stronger rejection than one without those characteristics. By filtering the dashboard to only count high-quality sweeps, the trader can see whether quality-filtered sweeps produce a meaningfully different Edge than the unfiltered set. This is useful both for refining a setup definition and for evaluating which characteristics matter on the current instrument.
🔹 How do filters interact with the dashboard?
The total sweeps count shown in the dashboard title reflects the filtered count. The Best Edge banner and per-row statistics are also computed against the filtered set. Toggling any filter on or off triggers an immediate recomputation of the dashboard.
Screenshot: a before-and-after dashboard pair showing how the statistics change when quality filters are applied
🔹 Settings
◇ Volume Spike Multiplier: enable toggle and threshold (default 1.5x).
◇ Sweep Wick %: enable toggle and minimum percent (default 50).
◇ Sweep Delta %: enable toggle, minimum percent (default 60), and intrabar timeframe (default 1 minute).
TRADING DAY FILTER
🔹 What is the Trading Day Filter?
A row of seven weekday checkboxes that controls which days of the week are included in the dashboard statistics. Each sweep's resolution day is stored with the record. The filter excludes records whose weekday is unchecked.
🔹 Why filter by weekday?
Sweep behavior frequently varies by day of the week. Monday opens often produce different patterns than Wednesday midweek sessions or Friday closes. Letting the trader exclude specific weekdays makes it possible to test whether the Edge values on each liquidity type are weekday-dependent.
🔹 Settings
◇ Sun, Mon, Tue, Wed, Thu, Fri, Sat: each is an independent on/off toggle. Defaults: Mon through Fri on, Sat and Sun off.
ACTIVE SWEEP TRACKER
🔹 What is the Active Sweep Tracker?
A floating label rendered near the current bar that shows the live performance of the most recent unresolved sweep. It updates each bar while the watch window is still open. The label displays:
◇ The liquidity type that was swept.
◇ Bars elapsed since the sweep, against the watch window total.
◇ Current Recovery and Breach magnitudes (running max plus current-bar excursion).
◇ The historical average Recovery, Breach, and Edge for that type, if there are at least 5 samples for that type.
🔹 Why does it matter?
The dashboard shows aggregate historical statistics, but during a live setup the trader wants to know how the current move is tracking against the baseline. The Active Sweep Tracker makes this comparison explicit on the chart: at any moment, the trader can see whether the active sweep is matching, exceeding, or underperforming what that type has typically delivered.
🔹 How is the tracker calculated?
On the last bar of the chart, the indicator scans the levels array for any level that is taken, has broken = false, and is not yet completed. Among those, it picks the one with the highest takenBar (the most recent unresolved sweep). For that sweep, it computes the current-bar Recovery and Breach using the same formulas as outcome tracking, takes the maximum of the running max and the current-bar value (so the displayed value reflects either the historical peak or the live excursion, whichever is larger), and pulls the historical stats for that sweep type using the same filter pipeline as the dashboard.
The label's background color reflects which side is winning in real time. Bull color when the higher of the two excursions is on the Recovery side, bear color otherwise.
Screenshot: a chart with an active unresolved sweep, the Sweep Zone visible, and the Active Sweep Tracker label rendered near the current bar showing the live Bar x / Y count, current excursion values, and historical baseline comparison.
🔹 Settings
◇ Show Active Sweep Tracker: master toggle.
◇ Text Size: Tiny, Small, Normal, Large, Huge.
DISPLAY AND STYLING
🔹 Label and line styling
Liquidity levels render as horizontal lines extended to the right. Each category uses a distinct line style: solid for key levels, dashed for session levels, dotted for structure levels. Each type has its own color, customizable from the Sessions, Previous Periods, and Structure input groups. Labels render at the right edge with the type name and an optional day suffix for session levels when tracking more than one day.
🔹 Hide-on-Swept behavior
By default, swept levels remain drawn on the chart. With Hide on Swept enabled, swept levels are removed from the chart after a configurable grace period (Keep Swept Levels For). The grace period is measured in bars from when the level resolved (either taken or broken). This is useful for keeping the chart focused on the active liquidity once the historical sweep map becomes dense.
🔹 Settings
◇ Extend Right: number of bars to extend liquidity lines past the current bar. Default 3.
◇ Label Size: Tiny, Small, Normal, Large, Huge.
◇ Hide on Swept: toggle removal of swept levels.
◇ Keep Swept Levels For: grace period in bars before removal (applies when Hide on Swept is enabled). Default 5.
ALERTS
🔹 New Sweep
Fires when any tracked liquidity level is freshly swept on the current bar (taken status set this bar, broken = false). The alert message includes ticker and timeframe.
🔹 High-Edge Sweep
Fires when a new sweep occurs on a liquidity type whose historical Edge meets or exceeds the High-Edge Alert Threshold, provided that type has at least 5 historical samples. The Edge value is computed using the same filter pipeline as the dashboard, so any active quality filters and weekday filters are respected when evaluating whether the alert qualifies.
🔹 Settings
◇ High-Edge Alert Threshold: Edge value at or above which the High-Edge alert qualifies. Default 1.5.
IMPORTANT NOTES:
◇ The Sweep Delta % filter relies on lower-timeframe volume data, which may be unavailable for some instruments (forex pairs with no native volume, certain crypto exchanges, etc.). On those instruments, the delta filter can be left disabled.
◇ Statistics displayed in the dashboard reflect the sweeps visible in the historical data the chart has access to. Loading more historical bars (by scrolling left on lower timeframes or increasing the chart's bar limit) will increase the sample size and may shift the Edge rankings.
◇ The Best Edge banner requires a minimum of 5 sweeps per type to qualify. Types with fewer sweeps are shown in the dashboard but do not compete for the banner.
◇ Past sweep behavior on a given liquidity type does not guarantee future sweep behavior. The dashboard provides a statistical profile of historical sweeps; trade decisions remain the user's responsibility.
◇ Session times are interpreted in the America/New_York timezone regardless of the chart's session timezone. The default windows correspond to common Asia / London / NY conventions but can be edited freely.
UNIQUENESS:
The Liquidity Sweep Profiler is built around a feedback loop that most liquidity-tracking indicators do not provide. It detects liquidity levels, monitors them for sweeps, measures what happened after each sweep, and aggregates the results into a per-type statistical profile on the current chart. The trader sees not just where liquidity sits, but which categories of liquidity have actually produced clean reversals on the specific instrument and timeframe in question. Most competing tools stop at plotting the levels and flagging sweeps, leaving the trader to estimate behavior by eye. The Sweep Profiler turns this into structured data with sample counts, average magnitudes, and an Edge ratio that captures the recovery-to-breach trade-off.
The indicator also combines several feature categories that are usually distributed across multiple tools: intraday session tracking, higher timeframe key levels, chart-structure liquidity (swings and equal highs/lows), volume and delta quality filters, weekday filtering, and a live Active Sweep Tracker that compares the current unresolved sweep to its historical baseline in real time. All of this is unified into one dashboard with a Best Edge banner that surfaces the strongest-performing liquidity type at a glance. Display values can be expressed in ATR, raw price, pips, or ticks, so the same indicator reads naturally on indices, forex, futures, and crypto without manual conversion. Sweep detection itself is configurable from strict same-bar rejection to multi-bar close-back-through, letting the trader tune the detection logic to match the rejection style they actually trade.
Pine Script® indicator






















