Breakout Retest Readiness [AGPro Series]Breakout Retest Readiness
🧠 Core Idea
Is the post-breakout retest being accepted with structure, or is the breakout losing quality at the risk edge?
📌 Overview / What it does
Breakout Retest Readiness is a chart-first planning tool built to evaluate what happens after a confirmed breakout and after price starts interacting with the retest pocket.
The script maps the broken structure level, builds a retest pocket around it, places a risk-edge shelf beyond the pocket, and projects a target-room guide for context. It then scores the active retest environment with a 0-100 Acceptance Score and displays a clear next-action state in the AG Pro panel.
This script does not predict continuation. It does not automate entries. It is designed to organize post-breakout retest context so traders can review acceptance, rejection, risk edge, and plan quality in a cleaner way.
🎯 Purpose & Design Philosophy
Most breakout tools focus on the moment price crosses a level. In practice, many useful decisions happen after the break, when price returns toward the broken level and either accepts it or fails around it.
This script was built for traders who want a structured retest planning layer rather than another basic breakout marker. It supports a patient workflow: wait for structure, observe the pocket, evaluate acceptance, and review risk before reacting.
The design philosophy is simple: the chart should answer what state the retest is in, how strong the acceptance context is, where risk is being tested, and what the next review step should be.
⚡ Why This Script Is Different
Most tools focus on detecting a breakout or grading the first retest as a standalone signal.
This script does NOT try to clone a classic break-retest quality grader, and it does not print simple buy or sell commands.
Instead, it works as a post-breakout readiness planner. It arms a retest pocket after a confirmed breakout, waits for price to interact with that pocket, evaluates acceptance versus rejection, tracks the risk edge, and keeps the next-action state visible in the panel.
The difference is the decision layer. The script is less about saying "a retest happened" and more about answering whether the active retest environment is constructive enough to keep reviewing.
⚙️ Methodology
1. Context Detection
The script identifies a confirmed break beyond recent structure using a prior high or prior low reference. The breakout must clear the structure by an ATR-normalized buffer so minor pokes are filtered.
2. Reference Mapping
After a valid break, the script stores the breakout line, builds a retest pocket around it, places an invalidation shelf beyond the broken level, and projects a target-room guide from the prior structure range.
3. Reaction Evaluation
When price interacts with the retest pocket, the script evaluates breakout quality, retest depth, wick rejection, volume change, and trend agreement. These components combine into a 0-100 Acceptance Score.
4. Visual Output
The chart shows the active retest pocket, breakout line, risk edge, target guide, compact event labels, and the AG Pro panel. The panel summarizes retest state, acceptance score, breakout quality, risk edge, and action.
🗺️ How to Read the Chart
Retest Pocket = the zone around the broken structure level where price is being evaluated after the breakout.
Breakout Line = the structure level that was crossed and now anchors the retest plan.
Risk Edge = the invalidation shelf beyond the retest pocket. It is a planning reference, not a stop recommendation.
Target Guide = a target-room marker projected from the prior range. It is context only, not a forecast.
Labels = compact state markers such as ARMED, TEST, ACCEPT, REJECT, RISK EDGE, or EXPIRE.
Colors = bullish retest plans use the AGPro teal tone, bearish plans use the AGPro pink tone, watch states use indigo or amber, and risk conditions use red.
Panel = the main decision interface showing retest state, acceptance score, breakout quality, risk edge, and next action.
🚦 Signals & States
• Breakout Armed → a breakout retest plan has been created after price cleared structure.
• Testing Pocket → price is interacting with the active retest pocket and acceptance is being evaluated.
• Accepted Retest → the retest has held the pocket with enough acceptance quality to deserve review.
• Rejected Retest → the retest has failed around the pocket and quality has weakened.
• Risk Edge Hit → price has moved beyond the mapped risk shelf.
• Expired → the retest window aged out before a constructive interaction.
🔔 Alerts Logic
Alerts are available for breakout plan arming, retest pocket interaction, accepted retest readiness, rejected retest or risk-edge pressure, and expired retest plans.
Each alert is an attention marker. Alerts do not represent trade instructions, guaranteed outcomes, or automated strategy decisions.
🧩 Confluence Logic
The strongest acceptance context appears when the breakout quality, retest depth, wick rejection, volume behavior, and trend agreement support the same side.
When these components align, the retest score improves. When the pocket is too deep, volume behavior is poor, trend context disagrees, or the risk edge is pressured, the readiness state weakens.
📊 When to Use
• After clean breakouts from recent structure
• During trend continuation review
• When price returns toward a broken level
• When the trader wants to separate constructive retests from weak post-break reactions
• On liquid symbols where structure, volume, and candle behavior are readable
⚠️ When NOT to Use
• Extremely low-liquidity instruments
• Highly noisy lower timeframes
• News-driven volatility spikes
• Markets with no clear structure reference
• Situations where the breakout level is too close to major external obstruction
🎛️ Key Inputs
• Breakout Structure Lookback → controls the prior structure reference used for breakout detection.
• Maximum Bars To Retest → controls how long the script waits for the retest pocket to matter.
• Sensitivity → adjusts how strict the breakout and acceptance model should be.
• Minimum Acceptance Score → defines the score needed before accepted readiness can appear.
• Retest Pocket Width ATR → controls the width of the post-breakout pocket.
• Invalidation Shelf ATR → controls the mapped risk-edge distance beyond the broken level.
• Target Guide Range Multiple → controls the forward target-room guide.
• Visual Settings → control pockets, lines, labels, label density, label size, and forward rendering.
• Panel Settings → control panel visibility, location, theme, and font size.
🖥️ Interface & Visual Design
The interface is built around a clean AG Pro panel and one main chart object family: the retest pocket.
The pocket label is centered inside the zone so the active state is visible without needing extra clutter. The breakout line, invalidation shelf, and target guide create a simple visual hierarchy: level, risk, and room.
Labels are intentionally compact and controlled by cooldown and maximum-visible settings so the chart remains active without becoming crowded.
🧪 Practical Usage Workflow
1. Read the panel state.
2. Locate the active retest pocket.
3. Check whether price is testing, accepting, rejecting, or pressing the risk edge.
4. Compare the Acceptance Score with the breakout quality.
5. Use the action row as a review prompt, not as an instruction.
🔍 Interpretation Guidelines
The Acceptance Score should be read as context quality, not certainty.
A higher score means the current retest has cleaner structural behavior under the script's rules. A lower score means the retest is less constructive, too deep, poorly supported, or not aligned with trend context.
The Risk Edge matters because a retest can look acceptable for a few bars and still lose structure if price pushes beyond the invalidation shelf. The panel keeps that condition visible.
🚫 What This Script Is NOT
This script is not a prediction engine.
This script is not financial advice.
This script is not an auto-trading system.
This script does not provide guaranteed signals.
This script is not a generic support and resistance map.
This script is not a clone of a first-retest grading tool.
⚠️ Limitations & Transparency
The script is rule-based and depends on the selected lookback, timeframe, and market structure.
Different symbols can produce different retest behavior. Lower timeframes may show more noise. Higher timeframes may produce fewer but stronger events.
Volatility changes can affect pocket size, risk-edge distance, and event frequency. Users should interpret every output within broader market context.
🧠 Market Context Notes
Breakout retests are most useful when structure is clear, liquidity is sufficient, and price has enough room to continue without immediate obstruction.
Volume behavior can add context, but volume data quality varies across markets. When volume is unreliable, the script treats that component more neutrally.
The retest pocket is not a guaranteed support or resistance zone. It is a structured review area around the broken level.
🧾 Use Case Examples
When price breaks above recent structure and later returns to the pocket with a controlled pullback, the script can mark the retest as Testing Pocket or Accepted Retest depending on score quality.
When price breaks below structure but quickly pushes back above the pocket and pressures the mapped risk edge, the script can mark rejection or risk-edge pressure.
When a breakout never returns to the pocket within the selected time window, the script can expire the plan instead of keeping old context alive.
🧱 System Philosophy
AGPro tools are designed to support structured chart reading. The goal is not to add more random signals, but to turn market behavior into clearer states, cleaner context, and better review discipline.
Breakout Retest Readiness follows that philosophy by turning a common post-breakout question into a visible planning workflow.
🔐 Non-Promise Statement
No script can confirm future price direction with certainty.
This tool organizes retest context. It does not promise continuation, reversal, profit, or accuracy.
📉 Risk Disclosure
Trading involves risk.
All outputs from this script are educational and analytical in nature.
Users are responsible for their own decisions, risk management, position sizing, and market interpretation.
This script does not provide financial advice.
📚 Educational Note
Use the script to study how breakouts behave after price returns to the broken level. The most useful insight is often not the breakout itself, but how the market reacts when the level is tested again.
Chỉ báo Pine Script®






















