OPEN-SOURCE SCRIPT
Cập nhật

AG Pro Previous Day Sweep & Reclaim [AGPro Series]

1 097
AG Pro Previous Day Sweep & Reclaim [AGPro Series]

Overview / What it does

AG Pro Previous Day Sweep & Reclaim is an overlay built to map one very specific price behavior around the previous day’s range: a sweep of the Previous Day High (PDH) or Previous Day Low (PDL), followed by a reclaim back inside the level.

The script is designed for traders who want a structured way to observe failed expansion attempts around prior-day liquidity. Instead of treating every break of PDH or PDL as continuation, this tool focuses on the opposite question: when price briefly trades beyond a prior-day extreme and then reclaims that level, is the move showing signs of rejection strong enough to deserve attention?

The core idea is intentionally narrow. This is not a broad market-structure engine, not a support/resistance dashboard, and not a general breakout system. Its purpose is to isolate a specific sequence: sweep -> reclaim -> quality assessment. That single workflow helps keep the script readable and functionally distinct.

Signals can be confirmed on the same bar or on the next bar, depending on user preference. Once a reclaim is confirmed, the script assigns a quality score, draws a directional arrow, prints a reclaim label, and keeps the visual structure compact enough for practical chart work across intraday and higher timeframes.

Unique Edge

The distinguishing feature of this script is that it does not simply plot PDH and PDL, and it does not label every break as meaningful. It attempts to separate ordinary range interaction from failed liquidity grabs by requiring reclaim confirmation and then grading the event.

Its logic is centered on reversal-quality mapping rather than static level display. That means the script does more than show where the previous day’s extremes are located. It evaluates whether the move through those extremes was shallow or excessive, whether the reclaim was weak or decisive, whether wick behavior supports rejection, whether volume was comparatively active, and whether the event occurred inside the selected session context.

Another practical edge is the confirmation flexibility. Some traders prefer immediate reclaim behavior on the same bar. Others want one additional bar for confirmation. This script supports both approaches, plus an Either mode for broader detection.

The visual side is also deliberately managed. Reclaim labels, arrows, guide lines, sweep boxes, label spacing controls, visible label limits, and HTF label filtering are included so the output remains usable instead of turning into uncontrolled chart clutter.

Methodology

The script retrieves the previous day’s high and low and tracks live interaction with those two reference levels.

Bullish reclaim logic begins with a downside sweep:
- price trades below the Previous Day Low
- price then closes back above the Previous Day Low
- confirmation can occur on the same bar, on the next bar, or by either method depending on settings

Bearish reclaim logic mirrors that process:
- price trades above the Previous Day High
- price then closes back below the Previous Day High
- confirmation follows the selected reclaim mode

After confirmation, the script computes a quality score from multiple components. These components are intended to give structure to the event rather than to claim certainty about future direction.

The quality model includes:
- sweep depth relative to ATR
- reclaim strength within the bar range
- rejection wick fraction
- relative volume versus a moving average baseline
- bar range relative to ATR
- urgency factor for same-bar versus next-bar confirmation
- candle body bias
- session participation

The final score is normalized to a 0-100 scale and translated into a simple tier:
- A
- B
- C
- D

This score is not meant to be a prediction engine. It is a ranking tool that helps organize reclaim events by relative quality under the script’s own rules.

Session filtering is available because many traders only want to evaluate sweep-and-reclaim behavior during specific active windows. London, New York, custom sessions, or unrestricted monitoring can be selected.

For chart usability, the script also includes:
- previous day range fill
- optional reclaim guide lines
- optional sweep boxes
- reversal arrows
- reclaim labels
- summary panel
- visible label limits
- HTF smart label filtering
- minimum bar spacing between same-side labels

Signals & Alerts

The script produces two primary confirmed event types:

1. Bullish Previous Day Sweep & Reclaim
A downside sweep through PDL followed by a reclaim back above that level.

2. Bearish Previous Day Sweep & Reclaim
An upside sweep through PDH followed by a reclaim back below that level.

When enabled, the chart can display:
- directional reclaim arrows
- reclaim labels with score, tier, and confirmation mode
- sweep zone boxes
- short reclaim guide lines

Built-in alerts are included for:
- Bullish Previous Day Sweep & Reclaim
- Bearish Previous Day Sweep & Reclaim

These alerts are tied to confirmed reclaim conditions defined by the selected confirmation mode and minimum quality threshold.

Key Inputs

Reclaim Confirmation
Choose whether confirmation must occur on the Same Bar, Next Bar, or Either.

One Signal Per Side / Day
Limits repeated signals of the same side within a single day.

Use Session Filter
Restricts detection to the selected session environment when desired.

Minimum Quality Score
Filters out lower-ranked reclaim events.

ATR Length / Volume SMA Length
Inputs used by the quality model.

Ideal Sweep Depth (ATR) / Maximum Sweep Depth (ATR)
Define how the script evaluates sweep depth quality.

Label and Visual Controls
Manage font size, offset, sweep boxes, guide lines, visible label count, and general chart cleanliness.

HTF Smart Label Filter
Helps reduce label overload on daily, weekly, and monthly charts.

Minimum Bars Between Same-Side Labels
Introduces spacing between repeated bullish or bearish reclaim labels to prevent visual stacking.

Limitations & Transparency

This script is an analytical overlay. It is not a strategy, not an execution model, and not a guarantee of reversal.

A reclaim of PDH or PDL can still fail. Markets can continue trending after a sweep, especially during strong directional conditions, news-driven volatility, or low-liquidity distortions. For that reason, the quality score should be interpreted as an internal event-ranking framework, not as proof of future performance.

Session settings matter. Timeframe context matters. Confirmation mode matters. Label filters also affect what is visible on the chart, especially on higher timeframes. Users should understand that changing these inputs changes the strictness and presentation of the output.

This tool does not use order book data, broker-specific execution data, or hidden liquidity metrics. It works entirely from chart-based price and volume inputs available in Pine.

It is also important to note what this script does not attempt to do:
- it does not classify overall market regime
- it does not replace broader structure analysis
- it does not define entries, stops, or exits for the user
- it does not evaluate multi-level confluence outside its own reclaim framework

In short, it is a focused map for previous-day sweep and reclaim behavior, nothing more and nothing less.

Risk Disclosure

This script is for chart analysis and educational use only. It does not provide financial, investment, legal, or tax advice.

All trading decisions involve risk. Past price behavior around previous-day levels does not guarantee future results. Users should apply their own confirmation process, risk management rules, and market context analysis before acting on any chart signal.

Always test settings carefully and use the tool as one component inside a broader decision-making process, not as a standalone basis for trading.
Phát hành các Ghi chú
Update Notes - V1.3

This update focuses on chart clarity, visual spacing, and cleaner signal presentation while preserving the core previous-day sweep and reclaim concept. The goal of the revision was not to make the script louder, but to make the information easier to read, easier to follow, and more consistent across different chart conditions.

What was refined in this update:

- Reclaim labels were redesigned into a more compact format so the chart can stay cleaner during periods with repeated sweep activity.
- Label positioning was adjusted to place reclaim labels a bit farther from the candles, which improves breathing room and reduces the compressed look around active areas.
- Bearish reclaim labels were shifted slightly higher to improve separation from nearby price action and reduce crowding around local highs.
- Live PDH and PDL side tags were moved slightly farther to the right so they read more clearly and interfere less with nearby candles and reclaim structures.
- Default label sizing was standardized to a smaller visual footprint, which improves readability when multiple setups appear on the same section of the chart.
- The summary panel keeps the single merged blue header row and uses the smaller default text sizing for a cleaner, more disciplined presentation.
- Historical setup clutter was reduced by limiting how many older sweep visuals remain on the chart at the same time.
- Stronger reclaim setups can remain visually more prominent, while weaker or older structures no longer dominate the display.
- Reclaim guide and zone visibility were refined so the chart emphasizes recent and relevant areas more effectively.
- A reclaim buffer was introduced to help require a cleaner close back beyond PDH or PDL before a reclaim is confirmed.
- Previous-day structure visualization was improved with a more complete range presentation, including the optional prior-day midpoint.
- Label spacing controls and higher-timeframe smart label filtering continue to support a cleaner appearance on larger charts.

Practical result of the update:

This revision is primarily a presentation and signal-organization upgrade. Reclaim events remain based on the same previous-day sweep and reclaim framework, but the visual delivery is now more controlled. On daily charts especially, the chart should feel less congested, labels should read more cleanly, and the most relevant reclaim zones should stand out with better separation.

What did not change:

- The script still tracks previous-day high and previous-day low sweep behavior.
- Same-bar, next-bar, and either confirmation logic remain available.
- Session filtering, quality scoring, tiering, and alert conditions remain part of the workflow.
- The script is still intended as an analysis and alerting tool, not as a standalone trade decision engine.

This update is centered on readability, structure, and cleaner chart behavior so the indicator can communicate its logic with less visual friction.
Phát hành các Ghi chú
🔧 UPDATE NOTES - V1.4

This update focuses on readability, structure, clarity, visual balance, and panel consistency.

The core purpose of the script remains unchanged.
This release improves how previous-day high and low sweep/reclaim 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 title format
The script title now follows the current AGPro Series naming rule by removing the leading AG Pro from the TradingView indicator title while keeping AG Pro in the panel title.

• Rebuilt the panel header implementation
The panel now uses the required safe header pattern: two header cells are created immediately after table creation, merged with `table.merge_cells(panel, 0, 0, 1, 0)`, and row 0 is not cleared during normal updates.

• Improved reclaim visual structure
Confirmed PDH/PDL reclaim zones and guide lines are kept compact, projected with controlled length, and limited by object retention settings.

• Refined signal label density
Confirmed reclaim labels now use better spacing, cooldown, and retention controls to reduce clutter while keeping meaningful setups visible.

• Improved quality score presentation
The panel now separates state, last signal, quality, confirmation mode, session status, daily count, and action context for faster interpretation.


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

• Improved chart readability by keeping PDH/PDL references, reclaim boxes, and guide lines visually lighter.

• Reduced visual clutter by limiting retained historical labels, boxes, and guide lines.

• Refined visual hierarchy so confirmed reclaim events stand out more clearly.

• Adjusted label positioning to keep labels away from candles.

• Preserved previous-day range context without overwhelming price action.


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

• Optimized panel layout for clearer information flow.

• Added configurable panel position, panel theme, and panel font size controls.

• Added configurable label density and label font size controls.

• Adjusted default settings for a more balanced public screenshot.

• Enhanced overall user experience without changing the core sweep/reclaim concept.


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

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

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

Users should interpret outputs the same way as before, but with improved visual structure and cleaner signal context.


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

The script remains a rule-based analytical tool.

Session filters, timeframe selection, liquidity conditions, and daily reference behavior may affect how sweep and reclaim setups 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.
Phát hành các Ghi chú
🔧 UPDATE NOTES - v1.6

This update adds a reclaim follow-through proof, contrast-safe badges with no in-zone box text,
and a label de-overlap pass for clean dense screenshots.

The core purpose of the script remains unchanged.
It continues to map prior-day high and low liquidity interactions, wick sweeps, reclaim closes
and setup quality into a clean chart-first workflow.

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

- Reclaim Follow Rate proof layer
The panel now reports how often a confirmed reclaim historically followed through in the reclaim
direction rather than failing back across the reclaimed level, shown with the sample count.

- Reclaim proof window input
A new setting controls the window used to measure post-reclaim follow-through.

- Removed in-zone box text
The reclaim zone boxes no longer carry embedded text; the full reclaim readout stays on the event
label, which keeps zones clean and readable on light chart backgrounds.

- Label de-overlap (fan-out)
Reclaim labels that land close together now fan out vertically away from the candles, with a new
gap setting, so dense reclaim sequences stay readable.

- Honest, conservative counting
Each confirmed reclaim is counted once, and a failed reclaim or a window expiry without
follow-through is treated as not-followed, so the rate stays realistic.

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

- Contrast-safe text on the reclaim event labels and the PDH/PDL tags, so readouts stay readable
on amber, pink, orange and teal backgrounds

- Cleaner reclaim zone boxes without embedded text overlapping translucent fills

- Clustered reclaim labels now fan out vertically away from the candles, so dense reclaim
sequences stay readable instead of overlapping

- Kept the PDH/PDL levels, midline, range fill, guides and arrows unchanged

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

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

- Added a proof window setting and a label de-overlap gap setting

- Improved badge legibility across all tiers and both panel themes

- Enhanced overall user experience without changing the core reclaim logic

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

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

The sweep detection, reclaim confirmation, quality score, states and session filter are unchanged.
The Reclaim Rate is a separate historical track-record layer and does not alter detection.

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

The script remains a rule-based analytical tool that is designed for intraday timeframes.

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

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.