OPEN-SOURCE SCRIPT
Diupdate

Prior Close Reclaim Planner [AGPro Series]

811
Prior Close Reclaim Planner [AGPro Series]

🧠 Core Idea

Is the prior close being reclaimed, rejected, or treated as a live magnet by the current market?


📌 Overview / What it does

Prior Close Reclaim Planner [AGPro Series] maps the completed prior close as a live support/resistance reference and evaluates how price reacts around that level.

The script displays a prior-close rail, an ATR-based reclaim pocket, reclaim labels, rejection labels, magnet-zone labels, right-side reference tags, and a compact AG Pro dashboard with a 0-100 reclaim score.

It does not predict where price will go next. It helps organize the reaction around the previous close: reclaim quality, rejection pressure, magnet risk, rail state, and action context.


🎯 Purpose & Design Philosophy

The previous close is one of the simplest reference levels on a chart, but it is often read too casually.

This script was built to turn that reference into a structured planning map. It helps traders see whether the prior close is acting as support, resistance, a magnet, or a failed reclaim zone.

The design supports a patient decision-support mindset: read the rail, evaluate the reaction, check the score, and place the output inside broader market context.


⚡ Why This Script Is Different

Most tools draw a prior close line and stop there.

This script does NOT treat the prior close as a passive horizontal level.

Instead, it builds an active reclaim planner with a pocket, reaction labels, magnet context, relative-volume support, volatility fit, a readiness score, and a clear action state.


⚙️ Methodology

1. Prior Close Detection

The script sources the completed prior close from the selected reference timeframe. Daily is the default setting for previous-session analysis.

2. Reclaim Pocket Mapping

An ATR-based pocket is created above and below the prior close. This pocket is used to avoid overreacting to tiny ticks around the rail.

3. Reaction Evaluation

The script evaluates close location, wick response, relative volume, distance from the rail, and volatility fit.

4. Visual Output

The chart receives the rail, pocket, labels, right-side tags, bar coloring if enabled, and a dashboard panel summarizing the current state.


🗺️ How to Read the Chart

The central rail shows the completed prior close.

The pocket around the rail shows where reclaim and rejection behavior is evaluated.

Labels highlight bullish reclaim, bearish reclaim, rail defense, rail rejection, magnet-zone entries, and failed reclaim behavior.

Colors represent context:

• Teal → bullish reclaim or defense

• Pink → bearish reclaim or rejection

• Gold → neutral or waiting context

• Indigo → magnet or monitoring context

The panel summarizes:

• Prior Close

• Reclaim Score

• Magnet Risk

• Rail State

• Action


🚦 Signals & States

• Bull Prior Close Reclaim → price closed above the reclaim pocket

• Bear Prior Close Reclaim → price closed below the reclaim pocket

• Rail Defense → price tested the pocket and closed back above it

• Rail Rejection → price tested the pocket and closed back below it

• Magnet Zone → price is close enough to the prior close to treat the rail as active

• Invalidated → a reclaim attempt failed back through the prior-close rail

• READY → reclaim/rejection quality is strong enough to monitor

• MONITOR → price is near the rail, but conditions are not fully ready

• WAIT → no strong prior-close reaction is active


🔔 Alerts Logic

Alerts can trigger when price reclaims the prior close pocket, rejects the pocket, enters the magnet zone, reaches READY conditions, or invalidates a reclaim attempt.

Alerts are attention markers only. They are not trade instructions.


🧩 Confluence Logic

The prior-close context becomes stronger when close location, wick response, relative volume, volatility fit, and distance from the rail align.

For example, a reclaim with strong close quality, acceptable volume, and controlled distance from the rail is more structured than a weak close far from the reference.


📊 When to Use

• Intraday trading around the previous session close

• Session reclaim or rejection analysis

• Support/resistance reaction planning

• Trending markets that retest the prior close

• Range conditions where the prior close acts as a magnet

• Liquid symbols with readable candles and stable spreads


⚠️ When NOT to Use

• Very low-liquidity markets

• Symbols with unreliable session structure

• Extremely noisy chop around the rail

• News candles with unstable spreads

• Markets where the selected reference timeframe is not meaningful


🎛️ Key Inputs

• Reference Timeframe → controls where the completed prior close comes from

• Reclaim Pocket ATR → controls the width of the reaction pocket around the rail

• Magnet Distance ATR → controls when price is treated as close enough to the rail

• Minimum Ready Score → controls the score required for READY state

• Relative Volume Length → controls participation comparison

• Confirmation Mode → controls how strict reclaim/rejection evaluation should be

• Visual settings → control rails, pockets, labels, tags, bar colors, and dashboard behavior


🖥️ Interface & Visual Design

The interface is built for fast chart reading.

The prior close rail creates the main reference, the pocket defines the active reaction area, labels mark important events, and the panel compresses the state into a clean decision-support dashboard.

The goal is a premium, readable chart without turning the prior close into a cluttered signal board.


🧪 Practical Usage Workflow

1. Read the panel action state

2. Check whether price is above, below, or inside the prior-close pocket

3. Evaluate reclaim or rejection labels

4. Compare score quality with magnet risk

5. Confirm the context with broader structure, volume, and timeframe alignment


🔍 Interpretation Guidelines

A READY state means the prior-close reaction has enough structure to monitor.

Magnet risk means price is still close enough to the rail for the prior close to matter.

A reclaim label means the market crossed beyond the pocket, not that continuation is guaranteed.

A rejection or defense label means price reacted at the rail, but the broader trend and volatility context still matter.


🚫 What This Script Is NOT

This script is not a prediction engine.

It is not a guaranteed prior-close trading system.

It is not an automated trading tool.

It does not provide financial advice.

It does not guarantee continuation, reversal, profit, or a specific target.


⚠️ Limitations & Transparency

Prior-close behavior depends on market structure, volatility, liquidity, session design, and timeframe.

Different symbols may treat the previous close differently.

Very noisy markets can trigger frequent pocket interactions.

The score is a rule-based context score, not a certainty model.


🧠 Market Context Notes

The prior close often acts as a memory level.

When price reclaims it with participation, the rail may become a useful support/resistance reference.

When price repeatedly returns to it without follow-through, the rail may behave more like a magnet than a directional level.


🧾 Use Case Examples

When price opens below the prior close and later reclaims the pocket, the script marks the reclaim and scores the quality of the reaction.

When price tests the prior close from above and closes back above the pocket, the script can mark rail defense.

When price stays close to the rail without clean displacement, the panel can shift toward MONITOR instead of forcing a directional read.


🧱 System Philosophy

This script follows the AGPro Series approach: turn a familiar chart reference into a structured decision-support map.

The focus is not prediction. The focus is context, quality, invalidation awareness, and visual clarity.


🔐 Non-Promise Statement

No script can remove uncertainty from markets.

This tool does not promise accuracy, profitability, or future price movement.

Its purpose is to organize prior-close context so the user can interpret the chart more clearly.


📉 Risk Disclosure

Trading involves risk.

Market conditions can change quickly, and any analytical output can fail.

Users are responsible for their own decisions, risk management, and trade execution.

This script is for educational and analytical purposes only and does not provide financial advice.


📚 Educational Note

Use the prior close as a reference, not as an automatic decision.

The best reads usually come when the rail reaction aligns with structure, liquidity, volume, and the broader market environment.
Catatan Rilis
UPDATE NOTES - V1.1

This update focuses on premium chart readability, cleaner prior-close structure, and stronger publication-ready usability.

The core purpose of the script remains unchanged.
This release improves how the existing prior-close reclaim and rejection 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
------------------------

* Rebuilt the prior-close pocket with centered status text.
The active zone now shows the current reclaim, rejection, magnet, or monitor state directly inside the pocket.

* Added sparse magnet context labels by default.
This keeps the chart visually active near the prior close without turning every touch into a major signal.

* Refined right-side tag behavior.
The main prior-close tag is suppressed while centered pocket text is visible, which prevents duplicate text from overlapping the zone label.

* Kept pocket edge tags optional.
Upper and lower pocket edge tags remain available, but disabled by default to avoid stacked labels when the pocket is narrow.

* Rebuilt the AG Pro panel with full location, theme, and font controls.
The header remains a single merged blue row and follows the current AGPro Series standard.

* Added data-window transparency for reclaim score, distance from prior close, relative volume, reference age, and volatility ratio.
This improves analytical clarity without adding extra chart clutter.


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

* Improved chart readability by balancing the prior-close rail, reclaim pocket, event labels, and sparse context labels.

* Reduced visual clutter by preventing duplicate right-side tags from overlapping centered pocket text.

* Refined visual hierarchy so READY states, magnet context, and failed pocket behavior stand out more clearly.

* Adjusted default label spacing and retention to keep the chart premium without overcrowding candles.


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

* Optimized panel layout for clearer information flow.

* Improved label readability for better chart interaction.

* Adjusted default visual settings for a more balanced publication appearance.

* Enhanced overall user experience without changing the core analytical model.


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

This update does not change the core analytical idea 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 cleaner prior-close structure and better visual context.


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, timeframe differences, reference timeframe choice, and volume quality may affect how prior-close reclaim 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.
Catatan Rilis
UPDATE NOTES - V2.1

This update focuses on publication readiness, label clarity, and cleaner prior-close pocket presentation.

The core purpose of the script remains unchanged.
This release improves how prior-close reclaim, rejection, magnet, and invalidation context is 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
------------------------

* Updated the public package to V2.1.
The header, code file, update notes, tags, and QA file now use the refreshed version.

* Replaced multi-line chart labels with compact one-line labels.
Reclaim, defense, rejection, magnet, and failed-rail labels now use publication-friendly text such as RECLAIM | Q 72 and MAGNET | 0.42 ATR.

* Cleaned the prior-close pocket text.
The pocket now uses single-line text such as PRIOR CLOSE MONITOR or BULL RECLAIM | Q 75 to reduce cramped text on compressed screenshots.

* Preserved the decision-support model.
Prior close rail mapping, reclaim pocket logic, 0-100 scoring, magnet distance, READY / MONITOR / WAIT states, and alerts remain intact.

* Kept the visual system aligned with the AGPro Series standard.
Panel controls, label font-size controls, premium palette, and compact chart labels remain publication-ready.


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

* Improved chart readability by removing stacked label text.

* Reduced label height so event tags stay clearer around candle clusters.

* Refined visual hierarchy between the prior close rail, reclaim pocket, chart labels, and panel state.

* Preserved a balanced chart that does not look empty while avoiding excessive clutter.


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

* Preserved panel show/hide, panel location, panel theme, and panel font-size controls.

* Preserved label font-size control for event labels, pocket text, and right-side tags.

* Kept optional right-side pocket edge tags disabled by default to avoid stacked labels near narrow pockets.

* Kept invalidation labels disabled by default for a calmer publication view.


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

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

Prior close sourcing, pocket width, reclaim scoring, volume filtering, magnet detection, invalidation checks, panel state, and alerts remain conceptually unchanged.

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


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, timeframe differences, and reference timeframe selection may affect how reclaim and rejection 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.
Catatan Rilis
🔧 UPDATE NOTES - v2.2

This update focuses on readability and decision transparency.

The core purpose of the script remains unchanged.
This release hardens label contrast, separates clustered labels, and adds an
honest follow-through statistic so the strength of reclaims is easier to judge
at a glance.

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

• Stop-Aware Reclaim Follow-Through Rate
A new "Reclaim Rate" panel row reports how often a qualified reclaim went on to
travel one ATR in the reclaim direction before price closed back through the
opposite pocket edge. A win means the move extended first and a loss means the
pocket was lost first, which is the same invalidation the engine already tracks,
now measured across history. Reclaims that resolve neither way inside the window
are left uncounted, and the row shows the sample size and reads "Building" until
enough reclaims have completed. This adds context to the live reclaim score
without changing how the score is calculated.

• Hardened Label Contrast
Every reclaim, rejection, magnet, and invalidation label, plus the right-side
tags, now selects its text color from the brightness of its own background, so
bullish, bearish, neutral, accent, and danger elements stay legible. This
corrects light text that previously sat on light bearish and neutral fills.

• Overlap-Free Event Labels
Reclaim, rejection, magnet, and invalidation labels are now separated by a
vertical anti-collision pass, so clustered events no longer stack their labels
on top of one another.

• Solid Centered Pocket Badge
The centered pocket state now prints on a solid filled badge instead of bare
text, so it stays readable on any chart background with proper contrast.


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

• Improved chart readability by hardening label and tag text contrast

• Reduced visual clutter by separating clustered event labels

• Refined visual hierarchy so reclaim and rejection events stand out clearly

• Preserved the existing rail, pocket, centered pocket text, and tag layout


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

• Optimized panel layout with a new reclaim follow-through row

• Improved label readability for better chart interaction

• Adjusted default visual presentation for a more balanced appearance

• Enhanced overall user experience without changing core logic


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

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

The prior-close reference, pocket, scoring, reclaim, rejection, magnet, and
invalidation logic behave the same as before. The Reclaim Rate is an
observational statistic only.

Users should interpret outputs the same way as before, but with improved visual
structure and added follow-through context.


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may
affect how the prior-close rail, reclaims, and the reclaim rate appear.

The reclaim rate is a historical observation on the current chart and does not
predict future reclaims. 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.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.