OPEN-SOURCE SCRIPT
Zaktualizowano Breakout Base Defense Planner [AGPro Series]

Breakout Base Defense Planner [AGPro Series]
🧠 Core Idea
After a breakout, is the original base being defended or is price losing control back into the base?
📌 Overview / What it does
Breakout Base Defense Planner [AGPro Series] maps the structure price broke from and tracks whether the broken base edge is being defended.
The script displays the breakout base, a projected base defense zone, defense rail, failure shelf, room reference, defense labels, pressure labels, invalidation labels, right-side tags, and a compact AG Pro dashboard.
It does not predict that a breakout will continue. It helps organize the post-breakout base context: defense score, pressure, room, failure risk, and action state.
🎯 Purpose & Design Philosophy
Many breakout tools focus on the breakout candle or the first follow-through move.
This script was built for a different question: does the original base still matter after the breakout?
It helps traders separate clean base defense from weak breaks that fall back into the structure they came from.
⚡ Why This Script Is Different
Most breakout indicators highlight breakouts or target projections.
This script does NOT build a full R ladder, position planner, or generic breakout continuation system.
Instead, it focuses on the broken base itself: the base box, defense zone, pressure behavior, failure shelf, target room reference, and clear action state.
⚙️ Methodology
1. Base Detection
The script defines a recent base using completed bars and filters it by ATR-based width.
2. Breakout Lock
When price closes beyond the base edge with enough displacement and participation, the base is locked as the active reference.
3. Defense Evaluation
The broken base edge becomes a defense zone. The script checks whether price holds, pressures, or loses that zone.
4. Visual Output
The chart receives a breakout base box, defense zone, defense rail, failure shelf, room rail, labels, right-side tags, optional bar coloring, and a dashboard panel.
🗺️ How to Read the Chart
The breakout base shows the structure price broke from.
The defense zone marks the broken edge that should act as support in bullish breaks or resistance in bearish breaks.
The failure shelf marks where the base defense context fails.
The room rail marks the nearest swing-room reference beyond the breakout direction.
Labels highlight base lock, base defended, defense pressure, room tests, and base lost events.
Colors represent context:
• Teal → bullish base defense
• Pink → bearish base defense or invalidation
• Gold → room reference or waiting context
• Indigo → pressure or monitoring context
The panel summarizes:
• Base
• Defense Score
• Pressure
• Room
• Action
🚦 Signals & States
• Bull Base Breakout → price closed above the base with acceptable quality
• Bear Base Breakout → price closed below the base with acceptable quality
• Base Defended → price tested the broken edge and closed back in the breakout direction
• Defense Pressure → price is testing the defense zone without a clean hold
• Room Test → price reached the active room reference
• Base Lost → price closed beyond the failure shelf
• READY → base defense quality is strong enough to monitor
• MONITOR → price is actively testing the base defense zone
• WAIT → no strong active context exists
• INVALIDATED → the base defense context failed
• EXPIRED → the locked base is too old to remain active
🔔 Alerts Logic
Alerts can trigger when a breakout base is locked, when the base is defended, when READY state appears, when defense pressure appears, when the room rail is reached, or when the base is lost.
Alerts are attention markers only. They are not trade instructions.
🧩 Confluence Logic
The base defense context becomes stronger when the breakout base is well-sized, the breakout close has quality, the defense zone holds, participation is acceptable, and target room remains available.
When base defense and room align, the structure is cleaner. When price presses through the defense zone toward the failure shelf, the context weakens.
📊 When to Use
• After clear breakout moves
• During breakout retests
• When price returns to a broken range edge
• In trending markets where base defense matters
• On liquid symbols with readable structure and volume
• On 4h and 1D charts where base boxes remain visually clear
⚠️ When NOT to Use
• Very low-liquidity markets
• Extremely noisy sideways ranges
• Breakouts without a meaningful base
• News candles with unstable spreads
• Late moves where the base is already too far away to matter
🎛️ Key Inputs
• Base Lookback Bars → controls how the breakout base is detected
• Minimum / Maximum Base Range ATR → filters bases that are too small or too large
• Break Buffer ATR → controls how far beyond the base price must close
• Minimum Break Body Ratio → filters weak wick-only breaks
• Minimum Relative Volume → filters low-participation breaks
• Defense Zone ATR → controls the defended zone around the broken edge
• Failure Buffer ATR → controls where base defense fails
• Target Room Lookback → controls the nearest swing-room reference
• Visual settings → control boxes, rails, labels, tags, panel, and bar colors
🖥️ Interface & Visual Design
The visual design is built around the original base.
The base box provides context, the defense zone shows the key retest area, the failure shelf defines where the idea weakens, and the panel compresses the state into a quick decision-support read.
The goal is a premium, structured chart that feels like a breakout defense map, not a crowded signal board.
🧪 Practical Usage Workflow
1. Check whether a breakout base is active
2. Read the defense score and action state
3. Inspect the defense zone
4. Compare pressure with room
5. Watch the failure shelf for invalidation
6. Confirm the context with broader market structure
🔍 Interpretation Guidelines
A READY state means the base defense context has enough structure to monitor.
Defense pressure means price is testing the broken base edge and the context needs attention.
Base defended means price reacted at the edge, but it does not guarantee continuation.
Room measures available structure beyond the current price, not a promised target.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not a guaranteed breakout system.
It is not an R-ladder tool.
It is not a position sizing tool.
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
Breakout base behavior depends on market structure, volatility, liquidity, timeframe, and participation.
Some defended bases may later fail.
Some failed bases may reclaim again later.
The score is a rule-based context score, not a certainty model.
🧠 Market Context Notes
Breakout bases often become important memory zones.
When price breaks out and later defends the original edge, the structure can remain organized.
When price falls back through the edge and failure shelf, the breakout context becomes weaker.
🧾 Use Case Examples
When price breaks above a recent base, the script locks the base and projects a defense zone around the broken edge.
If price returns to the defense zone and closes back above the edge, the script can mark base defense.
If price closes through the failure shelf, the script marks the base as lost.
🧱 System Philosophy
This script follows the AGPro Series approach: turn one important market structure question into a focused decision-support map.
The focus is not prediction. The focus is base context, defense quality, pressure awareness, failure logic, 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 breakout base defense 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
A breakout is not complete just because price leaves a base.
The quality of the first base defense can often provide more useful context than the breakout candle alone.
🧠 Core Idea
After a breakout, is the original base being defended or is price losing control back into the base?
📌 Overview / What it does
Breakout Base Defense Planner [AGPro Series] maps the structure price broke from and tracks whether the broken base edge is being defended.
The script displays the breakout base, a projected base defense zone, defense rail, failure shelf, room reference, defense labels, pressure labels, invalidation labels, right-side tags, and a compact AG Pro dashboard.
It does not predict that a breakout will continue. It helps organize the post-breakout base context: defense score, pressure, room, failure risk, and action state.
🎯 Purpose & Design Philosophy
Many breakout tools focus on the breakout candle or the first follow-through move.
This script was built for a different question: does the original base still matter after the breakout?
It helps traders separate clean base defense from weak breaks that fall back into the structure they came from.
⚡ Why This Script Is Different
Most breakout indicators highlight breakouts or target projections.
This script does NOT build a full R ladder, position planner, or generic breakout continuation system.
Instead, it focuses on the broken base itself: the base box, defense zone, pressure behavior, failure shelf, target room reference, and clear action state.
⚙️ Methodology
1. Base Detection
The script defines a recent base using completed bars and filters it by ATR-based width.
2. Breakout Lock
When price closes beyond the base edge with enough displacement and participation, the base is locked as the active reference.
3. Defense Evaluation
The broken base edge becomes a defense zone. The script checks whether price holds, pressures, or loses that zone.
4. Visual Output
The chart receives a breakout base box, defense zone, defense rail, failure shelf, room rail, labels, right-side tags, optional bar coloring, and a dashboard panel.
🗺️ How to Read the Chart
The breakout base shows the structure price broke from.
The defense zone marks the broken edge that should act as support in bullish breaks or resistance in bearish breaks.
The failure shelf marks where the base defense context fails.
The room rail marks the nearest swing-room reference beyond the breakout direction.
Labels highlight base lock, base defended, defense pressure, room tests, and base lost events.
Colors represent context:
• Teal → bullish base defense
• Pink → bearish base defense or invalidation
• Gold → room reference or waiting context
• Indigo → pressure or monitoring context
The panel summarizes:
• Base
• Defense Score
• Pressure
• Room
• Action
🚦 Signals & States
• Bull Base Breakout → price closed above the base with acceptable quality
• Bear Base Breakout → price closed below the base with acceptable quality
• Base Defended → price tested the broken edge and closed back in the breakout direction
• Defense Pressure → price is testing the defense zone without a clean hold
• Room Test → price reached the active room reference
• Base Lost → price closed beyond the failure shelf
• READY → base defense quality is strong enough to monitor
• MONITOR → price is actively testing the base defense zone
• WAIT → no strong active context exists
• INVALIDATED → the base defense context failed
• EXPIRED → the locked base is too old to remain active
🔔 Alerts Logic
Alerts can trigger when a breakout base is locked, when the base is defended, when READY state appears, when defense pressure appears, when the room rail is reached, or when the base is lost.
Alerts are attention markers only. They are not trade instructions.
🧩 Confluence Logic
The base defense context becomes stronger when the breakout base is well-sized, the breakout close has quality, the defense zone holds, participation is acceptable, and target room remains available.
When base defense and room align, the structure is cleaner. When price presses through the defense zone toward the failure shelf, the context weakens.
📊 When to Use
• After clear breakout moves
• During breakout retests
• When price returns to a broken range edge
• In trending markets where base defense matters
• On liquid symbols with readable structure and volume
• On 4h and 1D charts where base boxes remain visually clear
⚠️ When NOT to Use
• Very low-liquidity markets
• Extremely noisy sideways ranges
• Breakouts without a meaningful base
• News candles with unstable spreads
• Late moves where the base is already too far away to matter
🎛️ Key Inputs
• Base Lookback Bars → controls how the breakout base is detected
• Minimum / Maximum Base Range ATR → filters bases that are too small or too large
• Break Buffer ATR → controls how far beyond the base price must close
• Minimum Break Body Ratio → filters weak wick-only breaks
• Minimum Relative Volume → filters low-participation breaks
• Defense Zone ATR → controls the defended zone around the broken edge
• Failure Buffer ATR → controls where base defense fails
• Target Room Lookback → controls the nearest swing-room reference
• Visual settings → control boxes, rails, labels, tags, panel, and bar colors
🖥️ Interface & Visual Design
The visual design is built around the original base.
The base box provides context, the defense zone shows the key retest area, the failure shelf defines where the idea weakens, and the panel compresses the state into a quick decision-support read.
The goal is a premium, structured chart that feels like a breakout defense map, not a crowded signal board.
🧪 Practical Usage Workflow
1. Check whether a breakout base is active
2. Read the defense score and action state
3. Inspect the defense zone
4. Compare pressure with room
5. Watch the failure shelf for invalidation
6. Confirm the context with broader market structure
🔍 Interpretation Guidelines
A READY state means the base defense context has enough structure to monitor.
Defense pressure means price is testing the broken base edge and the context needs attention.
Base defended means price reacted at the edge, but it does not guarantee continuation.
Room measures available structure beyond the current price, not a promised target.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not a guaranteed breakout system.
It is not an R-ladder tool.
It is not a position sizing tool.
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
Breakout base behavior depends on market structure, volatility, liquidity, timeframe, and participation.
Some defended bases may later fail.
Some failed bases may reclaim again later.
The score is a rule-based context score, not a certainty model.
🧠 Market Context Notes
Breakout bases often become important memory zones.
When price breaks out and later defends the original edge, the structure can remain organized.
When price falls back through the edge and failure shelf, the breakout context becomes weaker.
🧾 Use Case Examples
When price breaks above a recent base, the script locks the base and projects a defense zone around the broken edge.
If price returns to the defense zone and closes back above the edge, the script can mark base defense.
If price closes through the failure shelf, the script marks the base as lost.
🧱 System Philosophy
This script follows the AGPro Series approach: turn one important market structure question into a focused decision-support map.
The focus is not prediction. The focus is base context, defense quality, pressure awareness, failure logic, 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 breakout base defense 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
A breakout is not complete just because price leaves a base.
The quality of the first base defense can often provide more useful context than the breakout candle alone.
Informacje o Wersji
🔧 UPDATE NOTES - 1.1This update focuses on chart readability, zone-label structure, panel consistency, and visual control.
The core purpose of the script remains unchanged.
This release improves how the existing breakout-base defense 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
------------------------
• Corrected the script header version line.
The header now uses the standard Version field.
• Reworked zone text into separate centered badges.
Breakout Base and Base Defense Zone text now uses dedicated labels instead of zone text payloads.
• Added Show Centered Zone Badges.
Users can hide or show the centered base and defense-zone badges without changing the core zones.
• Added Adaptive HTF Projection.
The visual projection expands on higher timeframes so defense zones remain easier to read.
• Expanded panel controls.
The panel now supports Elite Dark, Slate, and Clean Light themes, expanded location options, and live position updates.
• Expanded font-size controls.
Label and panel font-size inputs now include Huge, and chart labels, centered badges, right-side tags, and panel text follow the configured settings.
------------------------
Visual Improvements
------------------------
• Improved chart readability by separating zone text from transparent base and defense objects.
• Improved contrast by placing important zone text inside dedicated badges.
• Reduced visual crowding around the active defense zone.
• Refined visual hierarchy so base, defense edge, failure rail, room rail, labels, and panel context are easier to scan.
------------------------
Interface & Usability
------------------------
• Panel show/hide remains available and enabled by default.
• Panel theme, location, and font size remain user-adjustable.
• The panel location now updates live through table positioning.
• The panel header remains a single merged blue row with only the script name.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
The goal is to improve clarity and usability, not to introduce new predictive behavior.
Users should interpret outputs the same way as before, but with cleaner zone structure and more controlled visual density.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Defense score, pressure state, room context, and base-loss behavior can vary across symbols, timeframes, volatility conditions, and liquidity conditions.
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.
Informacje o Wersji
🔧 UPDATE NOTES - [1.2]This update focuses on readability, decision clarity, and honest validation.
The core purpose of the script remains unchanged.
This release improves how the existing logic is presented, organized, and
interpreted on the chart, and adds an empirical follow-through proof rate.
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
------------------------
• Added a stop-aware Proof rate
A new panel row tracks how often a defended base is followed by continuation,
using a fixed 1.5 ATR target against a 1.0 ATR stop, evaluated only on confirmed
bars. Until at least 6 samples exist it shows "Building (n)" and remains
uncounted, so the figure stays honest.
• Rebuilt the target Room logic
Room is now projected as a measured move beyond the broken edge (a multiple of
base height), combined with the nearest structure so the engine always uses
whichever target gives real room. This removes the case where Room collapsed
onto the base level and read as near-zero space.
• Repositioned and de-duplicated zone elements
The chart now shows a single centered badge inside the active defense zone.
The breakout base is kept as faded historical context without its own badge,
which removes the crowded overlapping cluster around the breakout point.
• Applied a luminance-based contrast rule to all on-chart text
Every label, badge, and tag now sits on a filled opaque colored background with
text color chosen for readability, so text is never lost on bright fills.
• Hardened ATR handling
All zone, failure, room, label, and proof distances now use a guarded ATR with
true-range and mintick fallbacks for stability on thin or early data.
------------------------
Visual Improvements
------------------------
• Improved chart readability by adjusting labels, badges, and spacing
• Reduced visual clutter to enhance first-glance interpretation
• Refined visual hierarchy so the active zone and key levels stand out clearly
• Adjusted positioning of elements to avoid overlap with candles, including
vertical anti-collision for event labels and a fanned layout for the
defense / failure / room right-side tags
------------------------
Interface & Usability
------------------------
• Optimized panel layout for clearer information flow (Base, Defense Score,
Proof, Pressure, Room, Action)
• Improved label readability for better chart interaction
• Adjusted default visual settings for a more balanced appearance
• Enhanced overall user experience without changing the core breakout-base logic
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
The goal is to improve clarity and usability and to add transparent validation,
not to introduce new predictive behavior.
Users should interpret outputs the same way as before, but with improved visual
structure and an added empirical context figure.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, and timeframe differences may
affect how signals appear, and the proof rate is a historical sample, not a
forecast.
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.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.