OPEN-SOURCE SCRIPT
מעודכן AG Pro ATR Envelope Breakout Quality [AGPro Series]

AG Pro ATR Envelope Breakout Quality [AGPro Series]
Overview / What it does
AG Pro ATR Envelope Breakout Quality is a volatility-aware breakout framework built around a dynamic ATR envelope rather than a static horizontal level, fixed box, or session-defined range. The script tracks when price closes outside an ATR-based outer band, then evaluates whether that move shows enough quality to be treated as a meaningful breakout instead of a weak expansion, short-lived overshoot, or low-conviction push.
The core logic is centered on three linked questions. First, did price achieve a valid close outside the active envelope? Second, was that move supported by enough momentum and relative participation to deserve attention? Third, what happened when price came back toward the broken area? This progression allows the script to move beyond a simple breakout marker and present a more structured breakout-quality workflow.
Because the reference structure is dynamic, the script adapts to changing market conditions instead of forcing all setups into a fixed box logic. In periods of contraction, the envelope tightens and makes outside acceptance more meaningful. In periods of expansion, the envelope widens and helps separate true continuation pressure from ordinary volatility noise. This makes the tool especially useful for traders who want to judge whether an expansion is merely visible or genuinely tradable.
The visual design is intentionally clean and overlay-first. The envelope defines the active volatility shell, breakout markers show where price escapes that shell, the throwback zone highlights the key acceptance pocket after the move, and the optional target line provides a simple expansion objective. A compact panel then summarizes the current state without taking over the chart. The result is a script that aims to look premium while still keeping the main story readable in a publish screenshot.
Unique Edge
The main distinction of this script is that it does not evaluate breakout quality from a static support/resistance line, a consolidation rectangle, a Donchian extreme, or an opening range boundary. It evaluates breakout quality from a moving ATR envelope. That difference is not cosmetic. It changes the entire logic of what counts as a breakout, how follow-through is judged, and how retests are interpreted.
In several classic breakout tools, the market is asked to escape a fixed historical structure. Here, the market is asked to achieve acceptance outside a live volatility shell. This creates a different analytical lens. A move that looks impressive relative to a flat level may not be meaningful relative to a volatility-adjusted envelope. On the other hand, a clean close outside an adaptive outer band can reveal expansion quality that a simple line break would miss.
This also separates the script from our other AG Pro tools. It is not a consolidation breakout evaluator, because its reference structure is not a box. It is not a Donchian breakout tool, because it is not based on period highs and lows. It is not an opening-range breakout model, because it is not session-box dependent. It is not a standard break-retest script, because the retest here happens around a dynamic envelope acceptance area rather than around a static horizontal level.
That distinction matters both analytically and visually. Analytically, the script focuses on volatility-adjusted breakout acceptance. Visually, it produces a different type of chart story: an active envelope, a breakout event, a throwback pocket, and a projected path. This gives the script its own place inside the AG Pro catalog rather than making it feel like a variation of an existing breakout family member.
Methodology
The script begins with an ATR-based envelope built around a moving basis. This creates an adaptive upper and lower band that expand or contract with market volatility. A bullish breakout candidate appears when price closes outside the upper band. A bearish breakout candidate appears when price closes outside the lower band. Wick-only excursions are not enough. The script is designed to care about acceptance, not mere contact.
Once an outside close is detected, the script evaluates breakout quality through a compact scoring framework. Momentum contribution helps measure whether the breakout candle shows real displacement or just a hesitant push. Volume contribution helps detect whether the breakout is supported by stronger-than-usual participation or whether it lacks confirmation. The combined result becomes the displayed breakout-quality score.
After the initial breakout, the script monitors the first return toward the broken band area. This is where the throwback logic becomes important. Instead of treating every pullback the same way, the script classifies what happens around the envelope area and updates the state accordingly. A successful hold suggests that the market accepted the breakout. A failure suggests that the move lost structural quality after the initial expansion.
An optional target line can be used to project a simple post-breakout objective. This is not presented as a promise of outcome. It is a visual planning reference intended to show a possible expansion path if the breakout continues to behave constructively. Together, the envelope, the breakout signal, the throwback state, and the target framework create a full breakout-quality sequence rather than a single event label.
Signals & Alerts
The script is designed to organize the breakout workflow into visible states rather than flooding the chart with constant commentary. The main states include bullish breakout, bearish breakout, throwback monitoring, throwback hold, breakout failure, and target hit. This makes the chart easier to read and helps the user understand where the setup currently stands.
Bullish and bearish breakout markers appear when price achieves a confirmed outside close beyond the relevant envelope band. These are the initial expansion events. They are then followed by a monitoring phase in which the script watches how price behaves around the broken band area. If the return is constructive, the script can label that behavior as a successful hold. If the move loses quality and breaks down, the script can classify it as a failure.
The target marker is optional and functions as a planning aid, not as a certainty engine. It simply shows that the projected expansion objective has been reached based on the chosen configuration. In practical use, this can help traders separate the breakout event itself from the later progression of the move.
The alert set is intended to remain deterministic and chart-state aware. It focuses on confirmed breakout events, throwback behavior, breakout failure, and target completion. This keeps the script aligned with workflow clarity instead of turning it into a noisy alert generator.
Key Inputs
The envelope settings control the moving basis, ATR length, and multiplier that define the adaptive breakout shell. These settings determine how sensitive the script is to changing volatility and how demanding the outside-close condition becomes.
The breakout filter settings allow the user to regulate confirmation quality. Depending on the selected configuration, the script can require stronger momentum, clearer outside distance, and optional volume confirmation. This helps users decide whether they want a more selective or more responsive model.
The throwback analysis settings define how the script interprets the first return toward the broken envelope area. These settings influence how deeply price can revisit the area before the move is treated as weak, failed, or still acceptable.
The target settings control whether the projected objective is shown and how far it is placed from the breakout area. The visual settings then manage panel visibility, panel placement, font sizing, historical object behavior, and label density so the script can remain clean in live use and in publish screenshots.
Limitations & Transparency
This script is a breakout-quality framework, not a prediction engine. It does not know in advance whether a breakout will continue. It evaluates the quality of a breakout after a valid outside-close event occurs and then tracks how price behaves afterward. That distinction is important.
The ATR envelope is an adaptive reference, which means the same market move may be classified differently under different volatility regimes. That is intentional. The script is designed to respond to changing market structure, but any adaptive model will also reflect the sensitivity of its settings. Users should therefore expect the behavior of the tool to vary across symbols, timeframes, and volatility environments.
Volume inputs may also behave differently across markets and data feeds. On some instruments, volume can add useful confirmation. On others, it may be less informative. For that reason, volume should be treated as a supporting factor rather than as an absolute truth layer.
The target projection is a chart-planning feature, not a guaranteed outcome. Likewise, a breakout failure label does not mean the market cannot later recover, and a target hit does not mean the move was universally optimal. The script is meant to help structure chart reading, not replace trade management, context analysis, or personal decision-making.
How this script differs from our other AG Pro tools
Within the AG Pro lineup, this script is intentionally positioned as a volatility-envelope breakout tool. It does not compete with our box-based breakout logic, our period-high/low breakout logic, or our static break-retest logic. Its role is to answer a different question: did price achieve meaningful acceptance outside an adaptive ATR shell, and did that acceptance survive the first return test?
That makes it especially useful when traders want a volatility-adjusted view of expansion quality. In markets where static levels are repeatedly pierced, an adaptive envelope framework can provide a cleaner read on whether the move is truly escaping current volatility conditions or simply stretching within ordinary noise.
In that sense, the script is not a replacement for our other breakout-oriented tools. It is a separate layer with a different reference model, different retest logic, and a different chart story. That separation is deliberate and is one of the reasons the script belongs in its own category inside the broader AG Pro collection.
Risk Disclosure
This script is an analytical chart tool designed to visualize volatility-adjusted breakout conditions, breakout quality, and post-breakout behavior. It is not financial advice, not a signal service, and not a guarantee of future price direction.
All breakout conditions can fail. Momentum can fade, volume can be inconsistent, and throwback behavior can change quickly. Markets remain uncertain, and no indicator can eliminate risk. Users should always apply their own market judgment, risk controls, and execution rules.
Use the script as a structured decision-support layer, not as a stand-alone trading instruction. Confirmation from broader context, trend conditions, liquidity structure, and personal risk management remains essential.
Overview / What it does
AG Pro ATR Envelope Breakout Quality is a volatility-aware breakout framework built around a dynamic ATR envelope rather than a static horizontal level, fixed box, or session-defined range. The script tracks when price closes outside an ATR-based outer band, then evaluates whether that move shows enough quality to be treated as a meaningful breakout instead of a weak expansion, short-lived overshoot, or low-conviction push.
The core logic is centered on three linked questions. First, did price achieve a valid close outside the active envelope? Second, was that move supported by enough momentum and relative participation to deserve attention? Third, what happened when price came back toward the broken area? This progression allows the script to move beyond a simple breakout marker and present a more structured breakout-quality workflow.
Because the reference structure is dynamic, the script adapts to changing market conditions instead of forcing all setups into a fixed box logic. In periods of contraction, the envelope tightens and makes outside acceptance more meaningful. In periods of expansion, the envelope widens and helps separate true continuation pressure from ordinary volatility noise. This makes the tool especially useful for traders who want to judge whether an expansion is merely visible or genuinely tradable.
The visual design is intentionally clean and overlay-first. The envelope defines the active volatility shell, breakout markers show where price escapes that shell, the throwback zone highlights the key acceptance pocket after the move, and the optional target line provides a simple expansion objective. A compact panel then summarizes the current state without taking over the chart. The result is a script that aims to look premium while still keeping the main story readable in a publish screenshot.
Unique Edge
The main distinction of this script is that it does not evaluate breakout quality from a static support/resistance line, a consolidation rectangle, a Donchian extreme, or an opening range boundary. It evaluates breakout quality from a moving ATR envelope. That difference is not cosmetic. It changes the entire logic of what counts as a breakout, how follow-through is judged, and how retests are interpreted.
In several classic breakout tools, the market is asked to escape a fixed historical structure. Here, the market is asked to achieve acceptance outside a live volatility shell. This creates a different analytical lens. A move that looks impressive relative to a flat level may not be meaningful relative to a volatility-adjusted envelope. On the other hand, a clean close outside an adaptive outer band can reveal expansion quality that a simple line break would miss.
This also separates the script from our other AG Pro tools. It is not a consolidation breakout evaluator, because its reference structure is not a box. It is not a Donchian breakout tool, because it is not based on period highs and lows. It is not an opening-range breakout model, because it is not session-box dependent. It is not a standard break-retest script, because the retest here happens around a dynamic envelope acceptance area rather than around a static horizontal level.
That distinction matters both analytically and visually. Analytically, the script focuses on volatility-adjusted breakout acceptance. Visually, it produces a different type of chart story: an active envelope, a breakout event, a throwback pocket, and a projected path. This gives the script its own place inside the AG Pro catalog rather than making it feel like a variation of an existing breakout family member.
Methodology
The script begins with an ATR-based envelope built around a moving basis. This creates an adaptive upper and lower band that expand or contract with market volatility. A bullish breakout candidate appears when price closes outside the upper band. A bearish breakout candidate appears when price closes outside the lower band. Wick-only excursions are not enough. The script is designed to care about acceptance, not mere contact.
Once an outside close is detected, the script evaluates breakout quality through a compact scoring framework. Momentum contribution helps measure whether the breakout candle shows real displacement or just a hesitant push. Volume contribution helps detect whether the breakout is supported by stronger-than-usual participation or whether it lacks confirmation. The combined result becomes the displayed breakout-quality score.
After the initial breakout, the script monitors the first return toward the broken band area. This is where the throwback logic becomes important. Instead of treating every pullback the same way, the script classifies what happens around the envelope area and updates the state accordingly. A successful hold suggests that the market accepted the breakout. A failure suggests that the move lost structural quality after the initial expansion.
An optional target line can be used to project a simple post-breakout objective. This is not presented as a promise of outcome. It is a visual planning reference intended to show a possible expansion path if the breakout continues to behave constructively. Together, the envelope, the breakout signal, the throwback state, and the target framework create a full breakout-quality sequence rather than a single event label.
Signals & Alerts
The script is designed to organize the breakout workflow into visible states rather than flooding the chart with constant commentary. The main states include bullish breakout, bearish breakout, throwback monitoring, throwback hold, breakout failure, and target hit. This makes the chart easier to read and helps the user understand where the setup currently stands.
Bullish and bearish breakout markers appear when price achieves a confirmed outside close beyond the relevant envelope band. These are the initial expansion events. They are then followed by a monitoring phase in which the script watches how price behaves around the broken band area. If the return is constructive, the script can label that behavior as a successful hold. If the move loses quality and breaks down, the script can classify it as a failure.
The target marker is optional and functions as a planning aid, not as a certainty engine. It simply shows that the projected expansion objective has been reached based on the chosen configuration. In practical use, this can help traders separate the breakout event itself from the later progression of the move.
The alert set is intended to remain deterministic and chart-state aware. It focuses on confirmed breakout events, throwback behavior, breakout failure, and target completion. This keeps the script aligned with workflow clarity instead of turning it into a noisy alert generator.
Key Inputs
The envelope settings control the moving basis, ATR length, and multiplier that define the adaptive breakout shell. These settings determine how sensitive the script is to changing volatility and how demanding the outside-close condition becomes.
The breakout filter settings allow the user to regulate confirmation quality. Depending on the selected configuration, the script can require stronger momentum, clearer outside distance, and optional volume confirmation. This helps users decide whether they want a more selective or more responsive model.
The throwback analysis settings define how the script interprets the first return toward the broken envelope area. These settings influence how deeply price can revisit the area before the move is treated as weak, failed, or still acceptable.
The target settings control whether the projected objective is shown and how far it is placed from the breakout area. The visual settings then manage panel visibility, panel placement, font sizing, historical object behavior, and label density so the script can remain clean in live use and in publish screenshots.
Limitations & Transparency
This script is a breakout-quality framework, not a prediction engine. It does not know in advance whether a breakout will continue. It evaluates the quality of a breakout after a valid outside-close event occurs and then tracks how price behaves afterward. That distinction is important.
The ATR envelope is an adaptive reference, which means the same market move may be classified differently under different volatility regimes. That is intentional. The script is designed to respond to changing market structure, but any adaptive model will also reflect the sensitivity of its settings. Users should therefore expect the behavior of the tool to vary across symbols, timeframes, and volatility environments.
Volume inputs may also behave differently across markets and data feeds. On some instruments, volume can add useful confirmation. On others, it may be less informative. For that reason, volume should be treated as a supporting factor rather than as an absolute truth layer.
The target projection is a chart-planning feature, not a guaranteed outcome. Likewise, a breakout failure label does not mean the market cannot later recover, and a target hit does not mean the move was universally optimal. The script is meant to help structure chart reading, not replace trade management, context analysis, or personal decision-making.
How this script differs from our other AG Pro tools
Within the AG Pro lineup, this script is intentionally positioned as a volatility-envelope breakout tool. It does not compete with our box-based breakout logic, our period-high/low breakout logic, or our static break-retest logic. Its role is to answer a different question: did price achieve meaningful acceptance outside an adaptive ATR shell, and did that acceptance survive the first return test?
That makes it especially useful when traders want a volatility-adjusted view of expansion quality. In markets where static levels are repeatedly pierced, an adaptive envelope framework can provide a cleaner read on whether the move is truly escaping current volatility conditions or simply stretching within ordinary noise.
In that sense, the script is not a replacement for our other breakout-oriented tools. It is a separate layer with a different reference model, different retest logic, and a different chart story. That separation is deliberate and is one of the reasons the script belongs in its own category inside the broader AG Pro collection.
Risk Disclosure
This script is an analytical chart tool designed to visualize volatility-adjusted breakout conditions, breakout quality, and post-breakout behavior. It is not financial advice, not a signal service, and not a guarantee of future price direction.
All breakout conditions can fail. Momentum can fade, volume can be inconsistent, and throwback behavior can change quickly. Markets remain uncertain, and no indicator can eliminate risk. Users should always apply their own market judgment, risk controls, and execution rules.
Use the script as a structured decision-support layer, not as a stand-alone trading instruction. Confirmation from broader context, trend conditions, liquidity structure, and personal risk management remains essential.
הערות שחרור
UPDATE NOTES - V1.4This update focuses on presentation quality, chart readability, and setup clarity.
The core purpose of the script remains the same: to detect ATR envelope breakout conditions, qualify the breakout using internal filters, and track the post-breakout path through throwback and target logic. This release does not reposition the script as a prediction engine, and it does not introduce any promise-oriented behavior. Instead, the work in this version is centered on improving how the existing structure is displayed on the chart so the output is easier to read during live use and cleaner in published screenshots.
In earlier versions, the visual layer could become heavier than intended in some market conditions. The latest refinements were made to reduce that effect and keep the chart presentation more controlled. Envelope lines were softened, the fill zone was reduced visually, and unnecessary clutter from overly persistent visual elements was removed from the default experience. The result is a cleaner chart view that keeps the analytical context visible without overwhelming price action.
A major part of this update was label placement refinement. Break, throwback, and target labels were reviewed and repositioned to improve separation from the active zone structure. The goal was straightforward: labels should remain readable, identifiable, and visually detached enough from the envelope area so they do not look embedded inside the zone. This was especially important for lower-side labels, which now sit farther outside the zone region and read more clearly in fast inspection.
The panel was also kept in the standardized AG Pro presentation format. The first row remains a single merged title row with the established blue background, while the rest of the dashboard preserves a compact structure intended for quick state reading. Default panel font sizing and label sizing were aligned with the latest visual standard so the script opens in a cleaner, more balanced layout without requiring immediate manual adjustment.
What changed in this update:
• Refined the visual presentation of the ATR envelope so the chart feels lighter and more readable.
• Reduced the visual weight of the envelope boundaries for a more polished appearance.
• Softened the zone fill so price remains the primary visual focus.
• Cleaned the default chart behavior to avoid unnecessary visual crowding.
• Reworked label placement logic to improve separation from active envelope zones.
• Increased the effective distance of lower-side labels so they sit more clearly outside the zone area.
• Preserved the script’s core breakout, throwback, failure, and target workflow while improving presentation quality.
• Maintained the compact panel structure and standardized title-row styling.
What did not change:
• The script still uses an ATR envelope framework as its structural base.
• Breakout qualification still depends on the existing rules-based filter set.
• Throwback and target states continue to function within the same analytical logic.
• The script remains a chart analysis and alerting tool, not an execution system.
This release should be viewed as a refinement update rather than a methodology rewrite. The emphasis is on clearer chart communication, cleaner default behavior, and stronger first-glance readability while preserving the underlying logic that defines the script.
הערות שחרור
ATR Envelope Breakout Quality [AGPro Series] — v1.5 Update NotesWhat's new
──────────
• Compression Pre-Break Detection — envelope width contraction
vs its long-term baseline, highlighted with an inline tag and
subtle background flash. Catches coil conditions before the
breakout bar.
• Breakout Base Shelf — a long horizontal reference zone drawn
at the breakout boundary, marking the broken structure as
support / resistance for the rest of the setup's life.
• Dual-zone retest architecture — the adaptive retest pocket
(ATR-scaled, narrow) now works alongside the base shelf, so
pullbacks can be read at two levels of precision.
• Full AGPro visual refresh — locked brand palette (teal-green
bull, pink bear, amber target, indigo compression), unified
blue header bar, dark/light panel themes.
• Historical setups persist by default with faded resolved
objects, so past Throwback Holds, Fails, and Target Hits stay
visible as a visual track record.
Refinements
───────────
• Composite Break Score engine rebalanced across Outside,
Momentum, Volume, Slope, Cleanliness and Retest components.
• Larger label offset (0.90 ATR) — labels no longer collide
with wicks.
• Panel font, label font, and help text default to Normal.
• Shelf forward projection, retest pocket depth, and label
offset are all user-configurable.
• Array-capped historical object management — predictable
memory footprint on long charts.
New alerts
──────────
Compression Detected • plus the existing eight lifecycle
alerts (Bull/Bear Break, Throwback Hold, Target Hit, Fail).
Notes
─────
Signals confirm on bar close. Not financial advice; not a
trading strategy. Use with your own risk management.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
⚡ Precision Pine tools for crypto & FX traders
📊 ICT • Smart Money • Market Structure • Liquidity
🧠 Rules-based decision tools. No hype. No guesswork
⭐ Public AGPro Series + advanced invite-only tools
💬 t.me/agprolabs
📊 ICT • Smart Money • Market Structure • Liquidity
🧠 Rules-based decision tools. No hype. No guesswork
⭐ Public AGPro Series + advanced invite-only tools
💬 t.me/agprolabs
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
⚡ Precision Pine tools for crypto & FX traders
📊 ICT • Smart Money • Market Structure • Liquidity
🧠 Rules-based decision tools. No hype. No guesswork
⭐ Public AGPro Series + advanced invite-only tools
💬 t.me/agprolabs
📊 ICT • Smart Money • Market Structure • Liquidity
🧠 Rules-based decision tools. No hype. No guesswork
⭐ Public AGPro Series + advanced invite-only tools
💬 t.me/agprolabs
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.