OPEN-SOURCE SCRIPT
Обновлено

AG Pro Liquidity Sweep Quality [AGPro Series]

2 356
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.
Информация о релизе
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.
Информация о релизе
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.
Информация о релизе
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.
Информация о релизе
🔧 UPDATE NOTES - V1.6

This update focuses on panel readability, light/dark theme contrast, and overall visual clarity.

The core liquidity sweep detection logic remains unchanged.
This release improves how the existing sweep quality model is presented on different chart backgrounds, especially when using light chart themes.


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

• Reworked the panel theme system for better readability on both light and dark chart backgrounds.

• Added improved Auto theme behavior so the panel can adapt more cleanly to the current chart background.

• Updated panel value-cell contrast for key rows such as State, Last Score, Grade, Sweep Type, Pool Context, Active Pockets, and HTF Bias.

• Improved light-theme readability by using clearer text colors and safer background contrast.

• Improved dark-theme presentation by making value rows stronger and easier to read without changing the core panel structure.

• Preserved the AGPro blue merged panel title row while refining the body rows for better first-glance interpretation.


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

• Better contrast between panel labels and panel values.

• Improved readability on white and light chart backgrounds.

• Cleaner dark-theme panel appearance for users who prefer dark charts.

• More consistent visual hierarchy across State, Score, Grade, Context, and Bias rows.

• Slightly improved Sweep Pocket visibility for publication screenshots and real chart use.


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

• Panel Theme now supports a clearer light/dark workflow.

• Auto mode is designed to keep the panel readable across different chart backgrounds.

• The panel remains compact, but the most important rows are easier to scan.

• The visual update helps users interpret the last sweep state, score, context, active pockets, and HTF bias more quickly.


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

This update does not change the core liquidity sweep logic.

Sweep detection, sweep scoring, Sweep Pockets, labels, markers, memory lines, HTF bias logic, and alerts continue to work as before.

The purpose of this release is visual clarity, not new predictive behavior.


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

Liquidity sweep signals should always be interpreted within broader market context.

Market conditions such as volatility, liquidity, timeframe differences, and fast directional movement may affect how sweep events appear.

Panel states and sweep scores are analytical references, not guaranteed outcomes.


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

This script is for educational and analytical purposes only.

It does not provide financial advice, trade instructions, or guaranteed trading outcomes.

Users remain responsible for their own analysis, risk management, and trading decisions.
Информация о релизе
UPDATE NOTES - v1.7

This update focuses on color clarity and readability.

The core purpose of the script remains unchanged. This release improves how the
existing sweep detection and quality scoring are presented 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
------------------------

- Restored clear bullish and bearish color identity
Sweep labels, markers, and pockets now consistently use the bullish and
bearish theme colors so direction is readable at a single glance. Previously,
mid-range scores from both directions shared a similar neutral tone, which
flattened the chart into one color.

- Quality now reads from text and depth, not hue
The 0-10 quality score, the grade tag on each label (EL / HQ / Q), and the
panel Grade row carry the quality information, while color carries direction.
Stronger sweeps render more solid, developing sweeps slightly softer.

- Cleaner minor-sweep markers
The compact minor-sweep markers were simplified to clean directional triangles
without the extra inline tag, reducing small-text clutter across the chart.


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

- Improved chart readability by separating direction (color) from quality (text
and label depth).

- Reduced visual clutter from repeated marker text.

- Refined visual hierarchy so full quality-scored sweep labels and Sweep Pockets
stand out clearly.

- Preserved label offsets so sweep labels stay above or below candles.


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

- Optimized the default color scheme for clearer first-glance interpretation.

- Improved label and marker readability across both directions.

- Adjusted default visual settings for a more balanced, premium appearance.

- Enhanced overall user experience without changing core logic.


------------------------
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 new predictive
behavior. Swing detection, the sweep and reclaim logic, the quality score, the
grade thresholds, the Sweep Pockets, and the status panel all behave exactly as
before.

Users should interpret outputs the same way as before, but with improved color
structure.


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may
affect how sweeps, reclaims, and pockets 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.
Информация о релизе
🔧 UPDATE NOTES - v1.9

This update adds a next-action row and a reclaim-rate proof, and makes every Sweep Pocket
label readable on any chart background.

The core purpose of the script remains unchanged.
This release keeps the same swing liquidity mapping, sweep quality model and Sweep Pockets,
and improves how the planner communicates a decision.

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
------------------------

- Next-action row
The panel now states a clear next action for the latest sweep context, so the decision is
explicit rather than implied by the score alone.

- Reclaim Rate proof layer
The panel now reports how often a qualified sweep reclaim followed through in its own
direction before closing back through the swept level, shown with the sample count.

- Readable Sweep Pocket labels
Pocket text is now rendered as a centered badge with a solid background instead of plain
text, so it stays readable on both dark and light chart backgrounds.

- Consistent label sizing
All pocket badges and retest tags now follow the label font-size setting.

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

- Centered Sweep Pocket badges keep a solid background for clean contrast

- Pocket badges and retest tags respect the chosen label size

- Preserved the sweep labels, pocket colors and memory lines

- Left the clean publication layout intact

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

- Added an Action row so the panel guides a decision, not just a reading

- Added a Reclaim Rate row for an at-a-glance follow-through track record

- Improved on-chart readability across light and dark themes

- Enhanced overall user experience without changing the core scoring logic

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

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

The sweep detection, quality score, grades and Sweep Pockets are unchanged. The Action,
Reclaim Rate and label rendering are presentation and track-record layers only.

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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may affect how
sweeps, reclaims and the rate 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.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.