OPEN-SOURCE SCRIPT
Updated

Range Rejection Planner [AGPro Series]

873
Range Rejection Planner [AGPro Series]


🧠 Core Idea

Is price rejecting a range edge with enough quality to monitor back toward the midline?


📌 Overview / What it does

Range Rejection Planner is a chart-first range reaction decision engine built to evaluate whether price is rejecting the active range edge with enough structure to deserve attention.

The script maps one relevant range edge, a focused edge-reaction zone, wick rejection behavior, close-back-inside quality, midline room, invalidation shelf, failure risk, event labels, alerts, and a clean AGPro planning panel. These components are converted into a 0-100 Rejection Score and a clear next-action state.

It does not predict price movement, automate trades, draw a full support/resistance library, or guarantee that a range edge will hold. Its purpose is to organize the range-edge rejection review process with practical risk and midline context.


🎯 Purpose & Design Philosophy

This script was built for traders who want to evaluate range-edge reactions without turning the chart into a crowded level map.

Many range tools show boundaries, fills, or breakout markers, but they often stop before answering the practical planning question: did price actually reject the edge, is there room back to the midline, and where does the idea fail?

The design philosophy is simple: a range-edge rejection is only useful when the edge interaction, wick response, close-back-inside behavior, midline room, and failure shelf can be read together.


⚡ Why This Script Is Different

Most tools focus on drawing support/resistance zones, marking every range touch, or highlighting breakouts.

This script does NOT clone Support Resistance Reaction Map, does not build a multi-level S/R inventory, and does not act as a broad breakout or break-retest scanner.

Instead, it focuses on one active range and one active edge. The main output is not a buy/sell signal. It is a planning state that helps users decide whether the edge rejection deserves review, whether midline room exists, and whether failure risk is rising.


⚙️ Methodology

1. Context Detection
The script builds an active range from previous bars and identifies whether price is interacting with the upper or lower edge.

2. Reference Mapping
It maps the relevant edge zone, the range midline, and an invalidation shelf beyond the rejected edge.

3. Reaction Evaluation
The model scores edge proximity, wick rejection, close-back-inside quality, relative volume response, midline room, and active range quality.

4. Visual Output
The result appears as a centered range-edge zone, a midline review path, guide lines, compact state labels, alerts, and a premium AGPro panel.


🗺️ How to Read the Chart

Zones = the active range-edge zone shows the relevant upper or lower boundary being evaluated. The zone label is centered inside the shape.

Midline Path = the projected review area between the rejected edge and the range midline. It helps show whether there is enough room for interpretation.

Labels = compact markers show EDGE WATCH, REJECT READY, MIDLINE REVIEW, MIDLINE HIT, or FAILURE RISK context.

Colors = teal supports lower-edge rejection context, pink supports upper-edge rejection context, amber highlights review states, and indigo marks midline references.

Panel = the panel summarizes Range Edge, Rejection Score, Midline Room, Failure Risk, and Action.


🚦 Signals & States

• EDGE WATCH → price is probing a range edge and early rejection conditions are developing.

• REJECT READY → range-edge rejection quality reached the selected score threshold.

• MIDLINE REVIEW → an active rejection context is being monitored toward the range midline.

• MIDLINE HIT → price reached the active range midline after a rejection context.

• FAILURE RISK → price crossed the invalidation shelf beyond the rejected edge.

• RANGE WAIT → a range exists, but the edge interaction is not strong enough yet.


🔔 Alerts Logic

Alerts trigger when the planner enters EDGE WATCH, REJECT READY, MIDLINE REVIEW, MIDLINE HIT, or FAILURE RISK.

Each alert is an attention marker. Alerts are not trade instructions, entry commands, exit commands, or automated strategy rules.


🧩 Confluence Logic

The strongest context appears when several conditions align:

Range edge probe + strong rejection wick + close back inside the range + supportive relative volume + meaningful room back to the midline + a clear invalidation shelf.

When these components weaken, the planner can stay in EDGE WATCH, return to RANGE WAIT, or shift into FAILURE RISK.


📊 When to Use

• During range-bound markets where edge reactions matter

• When price probes the upper or lower boundary of a recent range

• When evaluating whether an edge rejection has enough midline room

• When a trader wants risk and invalidation context around a range reaction

• On liquid symbols where wicks, volume, and range boundaries are readable


⚠️ When NOT to Use

• Extremely low-liquidity symbols with unreliable wicks or volume

• Very noisy micro-timeframes where range edges shift too often

• News-driven volatility spikes that distort normal range behavior

• Strong trend expansion where range rejection is no longer the main context

• Situations where the user expects automatic buy/sell signals


🎛️ Key Inputs

• Range Edge Mode → chooses Auto, Upper Edge Rejection, or Lower Edge Rejection.

• Active Range Lookback → controls the previous-bar range used for edge evaluation.

• Range Edge Zone ATR → controls the width of the focused edge-reaction zone.

• Close-Back-Inside ATR → defines how much price should close back inside after probing an edge.

• Invalidation Shelf ATR → controls the failure-risk reference beyond the rejected edge.

• REJECT READY Threshold → sets the minimum 0-100 score for the strongest rejection state.

• Label and Panel Font Size → controls visual readability.


🖥️ Interface & Visual Design

The interface is designed to stay chart-first.

The active edge zone gives the main visual reference. The midline path shows the review area. The invalidation shelf defines where the rejection context becomes weaker. The panel provides a compact decision summary without replacing the chart.

The AGPro panel follows the standard first row format: one merged blue title row containing only the script name.


🧪 Practical Usage Workflow

1. Read the panel state and Rejection Score.

2. Check which range edge is active.

3. Review the wick rejection and close-back-inside context.

4. Compare the midline room with the invalidation shelf.

5. Treat alerts as attention markers, then evaluate broader market context.


🔍 Interpretation Guidelines

Think in terms of rejection quality, not prediction.

A stronger score means multiple range-reaction conditions are aligned. A weaker score means the edge interaction may be early, noisy, too close to the midline, or vulnerable to failure.

Failure Risk does not forecast a breakout. It means the active rejection context has crossed its rule-based failure shelf and should be reviewed.


🚫 What This Script Is NOT

• Not a prediction engine

• Not financial advice

• Not an auto-trading system

• Not a guaranteed signal tool

• Not a generic support/resistance map

• Not a full range breakout scanner


⚠️ Limitations & Transparency

The script is rule-based and depends on recent price, range, wick, volatility, and volume behavior.

Timeframe changes can alter the active range, score, edge zone, midline room, and invalidation shelf. Volatility spikes can temporarily distort range boundaries. Symbols with unreliable volume may produce weaker participation readings.

Outputs should always be interpreted with broader market structure, liquidity conditions, and independent risk planning.


🧠 Market Context Notes

Range-edge rejection is most useful when the market is respecting a bounded structure and still has meaningful space toward the middle of the range.

If price starts expanding beyond the edge, this tool intentionally shifts attention from rejection quality toward failure risk instead of calling continuation or reversal with certainty.


🧾 Use Case Examples

When price probes above the active range high, prints a strong upper wick, closes back inside, and still has clear room toward the midline, the planner may classify the context as REJECT READY.

When price touches the lower edge but closes weakly, lacks wick response, or sits too close to the midline, the planner may remain in EDGE WATCH or RANGE WAIT.

When price crosses the invalidation shelf beyond the rejected edge, the planner marks FAILURE RISK for review.


🧱 System Philosophy

AGPro planning tools are designed to help traders make a decision, not simply see another signal.

This script follows that philosophy by turning range rejection into a practical decision question:

Is the edge interaction valid?
How strong is the rejection?
Where is the midline reference?
Where is the failure shelf?
What should I review now?


🔐 Non-Promise Statement

No script can remove uncertainty.

No state, score, label, zone, line, or alert guarantees a future market outcome.


📉 Risk Disclosure

Trading involves risk. Market conditions can change quickly, and no script can eliminate uncertainty.

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

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


📚 Educational Note

Use the planner to study how range edges behave across different markets and timeframes. The most useful reading comes from comparing the edge zone, wick response, midline room, failure shelf, panel state, and broader market context together.
Release Notes
UPDATE NOTES - V1.2

This update focuses on light-chart readability, compact labels, and publication-ready range-zone presentation.

The core purpose of the script remains unchanged.
This release improves how range-edge rejection context, midline review path, event labels, and panel states 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
------------------------

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

* Moved range-zone text out of transparent box text.
Range edge and midline path text now render inside solid colored badges instead of transparent zones.

* Replaced multi-line event labels with compact one-line labels.
REJECT READY, EDGE WATCH, MIDLINE HIT, FAILURE RISK, MIDLINE REVIEW, and context labels now use single-line text.

* Preserved the decision-support model.
Range construction, edge-zone testing, wick rejection scoring, close-back-inside logic, midline room, invalidation shelf, 0-100 score, panel state, and alerts remain intact.

* Kept sparse context labels enabled by default.
The chart remains active enough for public screenshots while cooldown and max-label controls limit clutter.


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

* Improved white-chart compatibility by avoiding naked white text over transparent zones.

* Improved contrast by placing range-edge and midline text inside solid AGPro-colored badges.

* Reduced label height by removing stacked label text.

* Preserved transparent range zones for context while keeping text readable.


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

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

* Preserved label font-size, cooldown, context spacing, max visible labels, and optional score display controls.

* Preserved optional review labels for users who want more active midline tracking.

* Kept the panel as the primary decision-state summary.


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

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

Range lookback, edge zones, rejection score, midline room, invalidation shelf, failure risk, panel states, and alerts remain conceptually unchanged.

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


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, range quality, and timeframe differences may affect how 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.
Release Notes
🔧 UPDATE NOTES - 1.3

This update adds a reversion-rate proof layer and contrast-safe label text to the
Range Rejection Planner. The core range-rejection engine, scoring and guides
remain unchanged. This script continues to function as an analytical visualization
tool. It does not predict price direction or provide guaranteed outcomes.

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

- Reversion-Rate Proof Layer
The panel now tracks how often a REJECT READY plan reverted toward the range
midline before crossing the invalidation shelf, with sample size shown.

- Thesis-Aligned, Range-Scaled Target
The proof measures a balanced reversion from the rejected edge toward the midline -
scaled to the range - so the rate reflects realistic post-rejection behavior across
markets.

- Honest, Non-Repaint Statistics
Each plan is counted once. Samples are confirmed-bar gated, resolve as a non-win on
invalidation or timeout, resolve same-bar ambiguity conservatively, and use a fixed
window to avoid inflation.

- Contrast-Safe Label Text
A luminance helper now sets badge, event-label and context-label text color
automatically, so amber, pink and indigo elements stay clearly readable.

- New Proof Inputs
A dedicated proof group adds Proof Window Bars and Proof Reversion To Mid % so the
reversion test can be tuned per market and timeframe.

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

- Improved badge and label readability through automatic text contrast
- Kept the premium edge zone, midline path, centered badges and guides intact
- Preserved moderate, non-overlapping label density
- No added chart clutter from the proof layer

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

- Added a Reversion Rate proof row to the planner panel
- Improved first-glance trust with a visible track-record context
- Kept all existing settings and defaults backward compatible
- Enhanced overall experience without changing the core engine

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

This update does not change how the range, edge rejection, midline room, failure
risk or the score are computed. The goal is added proof context and cleaner text
contrast. Outputs should be interpreted the same way as before.

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

The script remains a rule-based analytical tool. Volatility, liquidity and
timeframe differences can affect how rejections and statistics appear. Always
interpret outputs 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.
Release Notes
Version 1.5 – Collision-Safe Event Lanes

This update removes the remaining historical-label superpositions across intraday and higher-timeframe charts while preserving the range engine, rejection scoring, proof model, active zones, and confirmed alerts.

• Separated historical labels into independent upper and lower visual lanes based on rejection direction.

• Enforced the configured label cooldown as minimum same-lane visual spacing.

• Made terminal MIDLINE HIT and FAILURE RISK labels replace a nearby same-lane precursor instead of stacking over EDGE WATCH or REJECT READY.

• Prevented sparse context labels from entering an occupied event-label lane.

• Preserved the five-label default, centered active-zone badges, merged panel header, and core analytical behavior.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.