OPEN-SOURCE SCRIPT
Atualizado

AG Pro Liquidity Sweep Quality [AGPro Series]

1 725
AG Pro Liquidity Sweep Quality [AGPro Series]

OVERVIEW / WHAT IT DOES

AG Pro Liquidity Sweep Quality is a pivot-based overlay designed to map bullish and bearish liquidity sweep events around confirmed swing highs and swing lows. Instead of only flagging whether price traded beyond a prior level, the script evaluates whether that move behaved like a meaningful rejection or a weak sweep. The result is a structured liquidity sweep indicator that focuses on sweep quality, not only sweep detection.

In practical terms, the script looks for price moving above a prior swing high or below a prior swing low and then closing back through that level on the same bar or, if enabled, on the next bar. This behavior is commonly associated with stop hunts, failed breakout attempts, failed breakdown attempts, and short-term rejection events around visible liquidity. The script then ranks the event using a multi-factor quality model so the chart does not treat every sweep as equally important.

This makes the tool relevant for traders studying liquidity sweep behavior, smart money concepts, ICT-style chart reading, rejection anatomy, wick-driven reversals, sweep confirmation, and swing-based context. It is not built to predict direction on its own. It is built to organize sweep events so users can distinguish weaker noise from stronger rejection structures.

UNIQUE EDGE

The main objective of this script is not to publish another generic liquidity grab marker. Its edge comes from the fact that it scores each confirmed sweep using a quality framework. That framework combines how deeply price traded through the level, how decisively it closed back beyond the level, the wick-to-body relationship of the sweep bar, relative volume behavior, swing freshness, nearby swing crowding, and optional higher-timeframe bias alignment.

This matters because many sweep-style tools stop at a binary answer:
sweep happened / sweep did not happen.

This script asks a more useful follow-up question:
how good was that sweep?

That distinction is important on real charts. Some liquidity sweeps show strong rejection, clean close-back behavior, fresh structure, and supportive context. Others are simply noisy level violations inside a crowded area. By assigning a quality score, the script is designed to help users compare sweep events with more nuance.

Another distinguishing feature is that the script separates watch conditions from qualified conditions. A level can first be challenged, then either reclaim cleanly or fail to reclaim. This helps reduce the tendency to treat every level breach as a reversal event.

METHODOLOGY

1) SWING DETECTION
The script uses confirmed pivot highs and confirmed pivot lows as its structural reference points. These pivots are not assumed in advance. They become available only after the user-defined Pivot Strength confirmation process is complete.

2) SWEEP TRIGGER
A bearish sweep scenario begins when price trades above a stored swing high.
A bullish sweep scenario begins when price trades below a stored swing low.

3) QUALIFICATION
A sweep is considered qualified when price closes back through the swept level. By default, the script can evaluate same-bar reclaim behavior and, optionally, next-bar reclaim behavior.

4) QUALITY MODEL
Each qualified sweep is scored using multiple factors, including:
- penetration relative to ATR
- rejection distance back through the level
- wick-to-body ratio
- relative volume versus a recent baseline
- freshness of the swing level
- nearby level crowding penalty
- optional higher-timeframe trend alignment bonus

The final output is normalized into a simple 1 to 10 quality score so chart reading remains fast and visually clean.

5) VISUAL MAPPING
Qualified sweeps can display:
- direction label
- quality score label
- sweep zone box
- dashed memory line at the swept level
- optional chart background tint
- compact minor markers for lower-priority qualified sweeps

This allows the chart to remain informative without forcing every event to carry the same visual weight.

SIGNALS & ALERTS

The script includes deterministic alert conditions for:
- Bull Sweep Trigger
- Bear Sweep Trigger
- Bull Sweep Qualified
- Bear Sweep Qualified
- High Quality Bull Sweep
- High Quality Bear Sweep

A trigger means price challenged the stored liquidity level.
A qualified sweep means price also reclaimed the level according to the script rules.
A high-quality sweep means the final score exceeded the selected threshold.

These states are intended to help users organize workflow and review price behavior. They are not instructions to buy or sell.

KEY INPUTS

Pivot Strength
Controls how swings are confirmed. Higher values generally reduce noise but also make structural detection slower and more selective.

Max Swing Age
Limits how long old swing levels remain eligible. This helps keep the liquidity map focused on fresher structure.

Allow Next-Bar Reclaim
Allows the script to qualify a sweep when the reclaim happens on the next bar instead of only the sweep bar itself.

ATR Length
Used in the quality engine to normalize sweep depth and rejection distance.

Relative Volume Length
Defines the baseline used for volume comparison.

Crowding Width (ATR)
Helps penalize sweeps occurring in dense structural clusters, where nearby levels can reduce interpretive clarity.

Higher Timeframe and HTF EMA Length
Used to build an optional bias filter so aligned sweeps can receive a context bonus.

Min Score For Full Labels
Lets users keep high-information labels on stronger sweeps while weaker qualified sweeps can remain as compact markers.

Same-Side Full Label Cooldown
Reduces repeated full labels in the same direction over a short span, improving chart readability.

LIMITATIONS & TRANSPARENCY

This script is a chart-organization tool, not a stand-alone decision engine.

Because the logic is pivot-based, swing levels are only confirmed after the chosen Pivot Strength delay. That means the structural reference points are confirmed swings, not instantly-known highs or lows.

A liquidity sweep on one market, timeframe, or volatility regime may not behave the same way on another. The scoring framework is designed to rank events relative to the script's own rules, not to certify that a sweep will lead to reversal or continuation.

Higher relative volume may improve context, but volume confirmation does not guarantee outcome quality.

The higher-timeframe alignment feature is a contextual filter. It should not be interpreted as a macro trend forecast.

Like any visual overlay, this tool can produce signals in choppy or highly reactive conditions that later prove less useful than they first appeared. Parameter selection matters.

WHAT THIS SCRIPT IS NOT

This script is not a promise of reversal.
It is not a complete smart money framework.
It is not a substitute for execution planning, risk management, or broader market context.
It does not claim to detect institutional intent.
It does not classify every level break as tradable.

Instead, it focuses on one specific chart behavior:
sweep-and-reclaim quality around confirmed swing liquidity.

RISK DISCLOSURE

This indicator is for analytical and educational use only. It does not provide financial advice, investment advice, or guaranteed trade outcomes. Markets can remain irrational, trend aggressively, or ignore local sweep signals for extended periods. Users should validate any chart workflow with their own process, risk controls, and market understanding before acting on any signal or alert.

If you use this tool, it is generally best treated as a structural filter inside a broader workflow rather than as a stand-alone trigger.

AGPro Series note:
This publication is designed to emphasize structured chart reading, deterministic event definitions, and transparent methodology over promotional claims or outcome promises.
Notas de Lançamento
Update Notes - V1.3

This update is focused on visual control and panel readability.

• Added new Sweep Display Mode options under Visual Settings:
- Full
- Boxes Only
- Yellow Boxes Only

• Added a cleaner chart mode for users who prefer to hide the blue helper markers and the directional bull/bear sweep labels.

• Added a Yellow Boxes Only view so the chart can be simplified while keeping only the yellow sweep boxes visible.

• Improved panel readability in Premium and Dark themes.

• Increased contrast across panel value rows to make State, Score, Grade, Sweep Type, and HTF Bias easier to read.

• Refined the visual presentation to support cleaner chart layouts without changing the core purpose of the script.

• This update is primarily a display and readability refinement. It is intended to improve usability and visual clarity.
Notas de Lançamento
Update Notes v1.4

- Refined the public release branding. The published indicator title now removes the leading AG Pro prefix while the panel keeps the AG Pro identity.
- Added Sweep Pocket projections. Every qualified reclaim can now project a pocket from the reclaimed liquidity level to the sweep extreme, giving the chart a cleaner post-sweep workflow instead of a one-bar signal only.
- Added Pocket Held detection and alerts. When price revisits a projected pocket and closes back in favor of the reclaim, the script can tag that hold and trigger a dedicated alert.
- Upgraded the quality model with stronger reclaim-efficiency and overshoot handling, so clean sweeps stand out more clearly from noisy level violations.
- Added Pool Context to the panel. The last event now reports whether the sweep came from an isolated, layered, or crowded liquidity area and whether that pool was fresh, mature, or late.
- Improved chart presentation with better label offsets, controlled full-label density, capped memory lines, and a panel font default of Normal.
- Expanded panel theming with Auto mode while preserving the AGPro merged blue header row standard.
- Reworked inputs with professional English tooltips for a cleaner Public Free release package.
Notas de Lançamento
UPDATE NOTES - V1.5

This update focuses on publication-ready visual clarity, centered Sweep Pocket communication, title standard alignment, and lighter chart-object usage.

The core purpose of the script remains unchanged.
This release improves how the existing liquidity sweep quality logic is presented, organized, and interpreted on the chart.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

* Updated the public script title standard.
The indicator title now starts with "Liquidity Sweep Quality" while the AG Pro branding remains inside the panel and shorttitle context.

* Added centered Sweep Pocket text.
Projected sweep pockets now carry centered pocket text that shows direction, quality score, grade, and pool context directly inside the zone.

* Connected the visual story more clearly.
The event label, Sweep Pocket, and AG Pro panel now communicate the same sweep-quality decision context instead of feeling like separate chart elements.

* Reduced chart-object limits to a more efficient publication profile.
The script keeps enough visible labels, pockets, and memory lines for a premium screenshot while avoiding unnecessarily heavy object budgets.

* Preserved the existing rules-based quality model.
The sweep score still evaluates penetration, reclaim strength, wick behavior, relative volume, freshness, crowding, range expansion, and HTF alignment.


------------------------
Visual Improvements
------------------------

* Improved chart readability by placing the main pocket message inside the projected sweep zone.

* Reduced visual ambiguity between full sweep labels, compact markers, and projected pockets.

* Refined visual hierarchy so Elite, High Quality, Qualified, and Developing sweep states are easier to interpret.

* Adjusted object budgets while keeping enough visible chart activity for an Editors Picks-oriented presentation.


------------------------
Interface & Usability
------------------------

* Added a dedicated Show Centered Pocket Text input.

* Kept the AG Pro panel visible by default with location, theme, and font-size controls.

* Preserved adjustable chart label sizing and panel font sizing.

* Kept Sweep Pocket projection controls flexible for different symbols and timeframes.


------------------------
Behavior Notes
------------------------

This update does not change the core analytical logic of the script.

The goal is to improve clarity and usability, not to introduce predictive behavior.

Users should interpret outputs the same way as before, but with a clearer pocket-based visual structure.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, timeframe differences, swing structure quality, and volume reliability may affect how sweep states appear.

Outputs should always be interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.