OPEN-SOURCE SCRIPT
מעודכן

Range Expansion Risk Planner [AGPro Series]

679
Range Expansion Risk Planner [AGPro Series]

🧠 Core Idea

Does a range expansion offer clean room, or is price moving into immediate failure risk?


📌 Overview / What it does

Range Expansion Risk Planner [AGPro Series] is a chart-first breakout quality and risk-planning tool built for one specific moment: price has left a defined range, and the trader needs to understand whether the expansion has enough structure to deserve attention.

Instead of printing generic breakout signals, the script maps the source range, freezes the broken edge, builds an expansion runway, tracks a failure rail, estimates target room, evaluates retest behavior, and converts those conditions into a 0-100 planner score.

The script produces a source range box, expansion runway, failed-expansion review band, risk/target rails, full-state labels, deterministic alerts, and a clean AGPro panel. It does not predict future price movement, automate execution, or guarantee that a breakout will continue.


🎯 Purpose & Design Philosophy

This script was built for traders who want to evaluate range expansion quality after price leaves a structure, not simply react to the first candle outside the range.

Many tools mark breakouts, draw range boxes, or highlight volatility expansion. The gap is the planning layer after the break: Is the source range mature? Was the expansion candle strong enough? Did price close clearly beyond the edge? Is the retest accepted or weak? Is there enough room before the next target-side reference?

The design supports a decision-first workflow. It helps users separate a clean range expansion from a weak release, blocked room, failed expansion, or early unconfirmed movement.


⚡ Why This Script Is Different

Most tools focus on breakout arrows, range highs/lows, volatility spikes, or support/resistance zones.

This script does NOT become a generic range breakout signal, a generic S/R zone map, a squeeze indicator, or a target predictor.

Instead, it evaluates the quality of the expansion plan after the range edge is broken. The main output is not a trade command. It is a planning state that helps the user decide whether the current expansion is CLEAN, on REVIEW, waiting for retest, blocked by room risk, or failing back into the source range.


⚙️ Methodology

1. Context Detection
The script maps the active source range using a user-defined lookback and detects whether price has closed beyond the upper or lower edge with enough ATR-normalized distance.

2. Reference Mapping
When a qualified expansion appears, the script freezes the source range, the broken edge, the failure rail, and the target-room marker so the plan can be reviewed consistently.

3. Reaction Evaluation
The model scores range maturity, expansion candle quality, close beyond edge, retest quality, target-room distance, and failure-rail distance.

4. Visual Output
The result is displayed through a source range box, expansion runway, failed-expansion band, risk/target rails, full-state event labels, alerts, and a premium AGPro panel.


🗺️ How to Read the Chart

Zones = the source range shows where the expansion came from. The expansion runway shows the path between the broken edge and the target-room marker. The failed-expansion band shows the area where the release may be losing structure.

Labels = full-state markers show Range Expansion, Clean Expansion, Expansion Review, Retest Accepted, Failed Expansion, Target Room Reached, Failure Risk, or Range Watch context.

Colors = teal highlights cleaner bullish expansion, pink highlights bearish or failed contexts, amber highlights review/risk states, and indigo highlights watch or target-edge states.

Panel = the panel summarizes Range Maturity, Expansion Risk, Room Risk, Confirmation, and Action.


🚦 Signals & States

• CLEAN EXPANSION → range expansion quality is strong enough to deserve active review.

• REVIEW → expansion context is developing, but confirmation or target room is incomplete.

• WAIT RETEST → price has expanded, but the broken edge has not yet been accepted clearly.

• ROOM BLOCKED → target-side room is limited relative to the current risk structure.

• FAILURE RISK → price is back inside the range or close to the failed-expansion area.

• FAILED → price crossed the failure rail and the prior expansion plan should be reviewed.

• TARGET EDGE → price reached the active target-room marker.

• RANGE WATCH → the range is mature enough to monitor, but no qualified expansion is active yet.


🔔 Alerts Logic

Alerts trigger when the planner enters clean expansion, review state, retest accepted state, failed-expansion warning, or target-room reached state.

These alerts are attention markers only. They are not trade instructions, entry signals, automated strategy commands, or guaranteed outcomes.


🧩 Confluence Logic

The strongest context appears when a mature source range releases with a strong expansion candle, price closes clearly beyond the edge, target-side room remains open, the failure rail is not too far away, and the broken edge receives constructive retest behavior.

When those components align, the planner score improves and the action state becomes cleaner.


📊 When to Use

• After price leaves a clear range

• During breakout-review workflows

• When comparing whether a release has enough room to justify attention

• When price retests the broken range edge

• On liquid symbols where ATR, range, and volume behavior are readable

• Especially on 4H swing charts, where range release, retest behavior, failure risk, and target-room context remain visually readable


⚠️ When NOT to Use

• Extremely low-liquidity symbols

• Very noisy micro-timeframes

• News-driven candles that distort the range edge

• Markets with frequent gaps or unreliable volume

• Situations where the user expects a simple buy/sell signal


🎛️ Key Inputs

• Expansion Side → controls Auto, Long Expansion, or Short Expansion planning.

• Sensitivity → changes how selective the range maturity and edge-close requirements are.

• Source Range Lookback → defines the range used before expansion.

• ATR Length → normalizes failure rail, label spacing, expansion distance, and room risk.

• Retest Review Bars → controls how long an edge retest can improve confirmation quality.

• Target-Side Obstacle Lookback → searches for older target-side references before using the measured target.

• CLEAN / REVIEW Scores → adjust how strict the state model is.

• Visual settings → control boxes, runway, rails, labels, panel location, theme, and font sizes.


🖥️ Interface & Visual Design

The interface is built around one primary decision path: source range → expansion runway → failure rail → target room.

The panel uses the AGPro public-release standard with one merged blue header row containing only the script name. It keeps the decision fields readable without turning the chart into a crowded dashboard.

Labels keep full professional state names, are offset away from candles, and are limited by cooldown and max-visible controls.


🧪 Practical Usage Workflow

1. Read the panel action state.

2. Check whether the source range was mature enough before expansion.

3. Review the expansion runway and target-room marker.

4. Check whether price accepted the broken edge or moved back into failure risk.

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


🔍 Interpretation Guidelines

A higher score means the model sees better alignment between source range quality, expansion candle quality, edge close, retest behavior, and target room.

CLEAN EXPANSION does not mean a trade must be taken. It means the expansion structure is clean enough to deserve active review.

REVIEW means the release may be developing, but the user should check confirmation and room quality before treating it as clean.

FAILED and FAILURE RISK are caution states. They help identify when an expansion is losing structure after leaving the range.


🚫 What This Script Is NOT

This script is not a prediction engine.

It is not financial advice.

It is not an auto-trading system.

It does not provide guaranteed signals.

It does not replace user judgment, risk management, or broader market analysis.


⚠️ Limitations & Transparency

Timeframe differences can change how range maturity, retests, and target-room references appear.

Volatility changes can widen failure rails or reduce clean target room.

Fast market conditions can move from CLEAN to FAILED quickly if price returns into the source range.

The script is rule-based and should be interpreted as an analytical planning layer, not as certainty.


🧠 Market Context Notes

Range expansion quality is not only about breaking the edge. A cleaner expansion usually needs a readable source range, a decisive close beyond the edge, enough room before obstruction, and a failure reference that is not too wide.

The planner is most useful when it prevents users from treating every breakout as equal.


🧾 Use Case Examples

When price closes beyond a mature range and the target-room marker remains far enough away, the planner may move into REVIEW or CLEAN EXPANSION.

When price retests the broken edge and holds outside the range, confirmation can improve.

When price closes back through the failure rail, the planner marks FAILED so the old expansion idea is not treated as clean anymore.


🧱 System Philosophy

Range Expansion Risk Planner follows the AGPro Series decision-engine approach:

Context first.
Risk before reaction.
Structure before signal.
Attention markers instead of promises.


🔐 Non-Promise Statement

No indicator can remove uncertainty.

No score, state, label, alert, range box, runway, or rail should be interpreted as guaranteed market direction.


📉 Risk Disclosure

Trading involves risk.

All decisions remain the responsibility of the user.

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


📚 Educational Note

Use this script to study how range expansions develop, how broken edges behave after release, and how failure risk can be organized visually before making discretionary decisions.
הערות שחרור
🔧 UPDATE NOTES - V1.3

This update focuses on Editors Picks-level screenshot polish, cleaner label rhythm, and stronger first-glance interpretation.

The core purpose of the script remains unchanged.
This release improves how active range expansion context is presented so the chart feels less like a technical debug map and more like a polished publication-ready planning tool.

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

• Cleaner event-label language
Chart labels now keep the main story clearer by reducing low-value room details on ordinary expansion and failure-review labels.

• Reduced repeated failure noise
Failure-review event labels are now more selective, while the active failure zone and panel continue to communicate the risk context clearly.

• Stronger retest selectivity
Retest Accepted labels now require higher-quality retest context before appearing on the chart.

• Improved publication rhythm
Default label spacing and maximum visible labels were adjusted to reduce clutter on 1H and 4H charts while keeping enough visual activity for public screenshots.

• Preserved the merged panel header standard
The panel header remains a single merged blue title row with the AG Pro brand identity.


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

• Reduced chart-label clutter without making the script feel empty.

• Removed weak-looking low-room label details from ordinary event labels.

• Improved the balance between source range, active runway, failure review, and right-side reference tags.

• Kept important zone text inside filled, contrast-safe badges.


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

• Optimized default label density for a cleaner publication screenshot.

• Kept panel location, theme, show/hide, and font controls intact.

• Kept label and badge font-size control unified for consistent presentation.

• Enhanced overall user experience without changing core analytical logic.


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

This update does not change the core analytical model.

The goal is to improve first-glance clarity, screenshot quality, and interpretation flow.

Users should interpret outputs the same way as before, but with cleaner chart emphasis and less low-value visual repetition.


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

The script remains a rule-based analytical tool.

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

This update focuses on decision transparency.

The core purpose of the script remains unchanged.
This release adds an honest follow-through statistic so the strength of
qualified range expansions 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 Target-Room Hit Rate
A new "Target Rate" panel row reports how often a qualified range expansion went
on to reach the target-room marker before the failure rail was crossed. A win
means the target room was reached first and a loss means the failure rail was
crossed first. This reuses the planner's own target and failure rails, now
measured across history. Expansions that resolve neither way inside the active
window are left uncounted, and the row shows the sample size and reads
"Building" until enough plans have completed. This adds context to the live
planner score without changing how the score or any state is calculated.


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

• Added a follow-through context row to the panel for clearer interpretation

• Preserved the existing range box, runway, failure band, rail, and tag layout

• Maintained contrast-safe label, badge, and tag text as before

• Kept the chart-first presentation balanced and uncluttered


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

• Optimized panel layout with a new target-room follow-through row

• Improved decision context without changing core logic

• Adjusted nothing in the default visual presentation beyond the added row

• Enhanced overall user experience


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

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

The range detection, expansion, scoring, retest, failure rail, and target-room
logic behave the same as before. The Target Rate is an observational statistic
only.

Users should interpret outputs the same way as before, but with 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 ranges, expansions, and the target rate appear.

The target rate is a historical observation on the current chart and does not
predict future expansions. 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. קרא עוד ב־תנאי השימוש.