OPEN-SOURCE SCRIPT
ที่อัปเดต: AG Pro Inside Bar Breakout Quality [AGPro Series]

AG Pro Inside Bar Breakout Quality [AGPro Series]
Overview / What it does
AG Pro Inside Bar Breakout Quality is an overlay tool built to study one of the market’s most familiar compression structures: the inside bar. Instead of stopping at simple detection, the script evaluates what happens after the pattern forms and grades the breakout attempt with a structured quality model. The result is a workflow-oriented view of inside bar compression, breakout strength, and failed continuation behavior.
The script first identifies a strict inside bar condition, where the current bar remains fully contained within the previous bar’s range. That parent range becomes the active reference zone. From there, the script monitors whether price resolves above or below the structure, whether the move is confirmed by close, whether volume supports the breakout, and whether the breakout later fails and re-enters the range within a user-defined window.
This is not designed as a generic “any breakout” marker. Its purpose is narrower and more specific: it focuses on a compact volatility contraction event, then measures how decisively price leaves that compression. In practical chart work, this helps separate a low-commitment range poke from a more convincing expansion move.
The visual presentation is intentionally structured. Inside bar zones are boxed, breakout direction is marked, quality is scored, and fakeouts are labeled when the breakout reverses back into the monitored range. This makes the script suitable for traders who want a cleaner way to inspect inside bar behavior without manually drawing every structure.
Unique Edge
The main difference here is that the script does not treat every inside bar break as equally meaningful. Many tools stop at “pattern detected” or “level broken.” This script adds a second layer: breakout quality. That layer is derived from close position, volume context, candle body participation, and alignment with the parent candle’s directional bias.
A second differentiator is the built-in fakeout logic. After a breakout is detected, the script continues to watch price for a limited number of bars. If the move quickly returns back through the breakout boundary, the event is tagged as a fakeout. This adds post-event context instead of only marking the first directional move.
Another distinction is that the methodology is deterministic and chart-native. The logic is rule-based, visible, and reproducible from bar to bar. Users can decide whether to require close confirmation beyond the inside bar range, whether to require volume confirmation, and how strict they want the displayed threshold to be through the minimum score filter.
In short, this script is not only about finding compression. It is about ranking the quality of the expansion attempt that follows the compression, while also acknowledging that some breakouts fail quickly and should be read differently.
Methodology
1) Inside Bar Detection
An inside bar is identified when the current bar’s high is lower than the previous bar’s high and the current bar’s low is higher than the previous bar’s low. This creates a strict containment definition based on the previous candle’s full range.
2) Reference Zone
Once an inside bar is detected, the prior candle becomes the parent reference bar. Its high and low define the active breakout boundaries. That range can be visualized as a box, with an optional midpoint line to make the compression zone easier to read on chart.
3) Breakout Confirmation
A bullish breakout occurs when price moves above the parent high. A bearish breakout occurs when price moves below the parent low. Users can choose whether breakout confirmation should be based on close beyond the range or on a less restrictive intrabar break condition.
4) Quality Score
Each breakout can be scored on a 0–10 scale. The score is built from multiple components:
- close position relative to the inside bar boundary
- volume ratio versus the selected moving average
- body participation within the breakout candle’s total range
- directional alignment between the breakout and the parent candle bias
This scoring model is designed to estimate how committed the breakout candle appears, rather than assuming all breaks have equal informational value.
5) Fakeout Detection
If enabled, the script monitors a user-defined number of bars after breakout. A bullish breakout that returns back below the upper boundary within that window is labeled as a bull trap / fakeout. A bearish breakout that returns back above the lower boundary within that window is labeled as a bear trap / fakeout.
6) Visual Layer
The script can display the inside bar zone, midpoint, breakout arrows, score labels, and fakeout markers. A summary panel tracks aggregate statistics such as total inside bars, total breakouts, breakout direction counts, fakeouts, and the latest breakout score.
Signals & Alerts
The script can provide alert conditions for:
- bullish inside bar breakout
- bearish inside bar breakout
- fakeout detection
- high-quality breakout events
- any breakout event
These alerts are intended to help users monitor the pattern and its resolution more efficiently. They do not replace trade planning, confirmation from broader market context, or independent risk management.
Key Inputs
Min Score to Show Breakout
Filters displayed breakout labels by quality threshold. This can be useful for reducing low-quality visual noise.
Volume Confirmation Required
When enabled, breakout evaluation requires volume to be above its moving average threshold. This can help remove low-participation breaks.
Volume MA Period
Defines the lookback length for average volume comparison.
Require Close Beyond IB
When enabled, breakout confirmation depends on bar close beyond the parent range. This creates a more conservative and more stable breakout definition.
Max IBs to Display
Controls how many recent structures and related objects remain visible on chart.
Show IB Box / Midline / Breakout Arrow / Score Label
Lets users decide how much visual detail they want to keep on screen.
Glow Effect on High Score
Adds emphasis to stronger breakout events without changing the underlying logic.
Fakeout Window
Defines how many bars after breakout the script should continue monitoring for a return back through the breakout boundary.
Limitations & Transparency
This script studies inside bar compression and subsequent breakout behavior. It does not claim to identify all meaningful consolidations, and it does not attempt to classify every market regime. The methodology is intentionally focused on one structure.
The score is a rule-based quality model, not an objective measure of future outcome. A high score does not guarantee continuation, and a lower score does not guarantee failure. It simply reflects how the breakout candle and its context behave according to the script’s internal criteria.
Volume-based interpretation may vary across symbols and markets. On some instruments, especially those with inconsistent or synthetic volume data, volume confirmation may be less informative than on others. Users should evaluate whether volume filtering is appropriate for the asset they are studying.
Fakeout detection is also definition-dependent. The script labels a fakeout when price returns through the breakout boundary within the selected lookback window. Different traders may prefer a different timing window or a different failure definition.
As with any overlay, chart readability depends on market volatility, timeframe, and user settings. On lower timeframes or during highly active periods, more visual events may appear. The built-in filters and display controls are there to help manage that density.
Risk Disclosure
This script is an analytical tool for chart study. It is not financial advice, not a trade recommendation, and not a promise of future results.
Inside bar breakouts can behave differently across timeframes, instruments, and market regimes. Users should not rely on a single pattern, score, or alert in isolation. Context still matters, including trend condition, liquidity environment, nearby structure, volatility regime, and execution discipline.
Before using this script in any live decision process, it should be reviewed in the specific market and timeframe relevant to the user’s own approach. Testing, observation, and risk controls remain essential.
Overview / What it does
AG Pro Inside Bar Breakout Quality is an overlay tool built to study one of the market’s most familiar compression structures: the inside bar. Instead of stopping at simple detection, the script evaluates what happens after the pattern forms and grades the breakout attempt with a structured quality model. The result is a workflow-oriented view of inside bar compression, breakout strength, and failed continuation behavior.
The script first identifies a strict inside bar condition, where the current bar remains fully contained within the previous bar’s range. That parent range becomes the active reference zone. From there, the script monitors whether price resolves above or below the structure, whether the move is confirmed by close, whether volume supports the breakout, and whether the breakout later fails and re-enters the range within a user-defined window.
This is not designed as a generic “any breakout” marker. Its purpose is narrower and more specific: it focuses on a compact volatility contraction event, then measures how decisively price leaves that compression. In practical chart work, this helps separate a low-commitment range poke from a more convincing expansion move.
The visual presentation is intentionally structured. Inside bar zones are boxed, breakout direction is marked, quality is scored, and fakeouts are labeled when the breakout reverses back into the monitored range. This makes the script suitable for traders who want a cleaner way to inspect inside bar behavior without manually drawing every structure.
Unique Edge
The main difference here is that the script does not treat every inside bar break as equally meaningful. Many tools stop at “pattern detected” or “level broken.” This script adds a second layer: breakout quality. That layer is derived from close position, volume context, candle body participation, and alignment with the parent candle’s directional bias.
A second differentiator is the built-in fakeout logic. After a breakout is detected, the script continues to watch price for a limited number of bars. If the move quickly returns back through the breakout boundary, the event is tagged as a fakeout. This adds post-event context instead of only marking the first directional move.
Another distinction is that the methodology is deterministic and chart-native. The logic is rule-based, visible, and reproducible from bar to bar. Users can decide whether to require close confirmation beyond the inside bar range, whether to require volume confirmation, and how strict they want the displayed threshold to be through the minimum score filter.
In short, this script is not only about finding compression. It is about ranking the quality of the expansion attempt that follows the compression, while also acknowledging that some breakouts fail quickly and should be read differently.
Methodology
1) Inside Bar Detection
An inside bar is identified when the current bar’s high is lower than the previous bar’s high and the current bar’s low is higher than the previous bar’s low. This creates a strict containment definition based on the previous candle’s full range.
2) Reference Zone
Once an inside bar is detected, the prior candle becomes the parent reference bar. Its high and low define the active breakout boundaries. That range can be visualized as a box, with an optional midpoint line to make the compression zone easier to read on chart.
3) Breakout Confirmation
A bullish breakout occurs when price moves above the parent high. A bearish breakout occurs when price moves below the parent low. Users can choose whether breakout confirmation should be based on close beyond the range or on a less restrictive intrabar break condition.
4) Quality Score
Each breakout can be scored on a 0–10 scale. The score is built from multiple components:
- close position relative to the inside bar boundary
- volume ratio versus the selected moving average
- body participation within the breakout candle’s total range
- directional alignment between the breakout and the parent candle bias
This scoring model is designed to estimate how committed the breakout candle appears, rather than assuming all breaks have equal informational value.
5) Fakeout Detection
If enabled, the script monitors a user-defined number of bars after breakout. A bullish breakout that returns back below the upper boundary within that window is labeled as a bull trap / fakeout. A bearish breakout that returns back above the lower boundary within that window is labeled as a bear trap / fakeout.
6) Visual Layer
The script can display the inside bar zone, midpoint, breakout arrows, score labels, and fakeout markers. A summary panel tracks aggregate statistics such as total inside bars, total breakouts, breakout direction counts, fakeouts, and the latest breakout score.
Signals & Alerts
The script can provide alert conditions for:
- bullish inside bar breakout
- bearish inside bar breakout
- fakeout detection
- high-quality breakout events
- any breakout event
These alerts are intended to help users monitor the pattern and its resolution more efficiently. They do not replace trade planning, confirmation from broader market context, or independent risk management.
Key Inputs
Min Score to Show Breakout
Filters displayed breakout labels by quality threshold. This can be useful for reducing low-quality visual noise.
Volume Confirmation Required
When enabled, breakout evaluation requires volume to be above its moving average threshold. This can help remove low-participation breaks.
Volume MA Period
Defines the lookback length for average volume comparison.
Require Close Beyond IB
When enabled, breakout confirmation depends on bar close beyond the parent range. This creates a more conservative and more stable breakout definition.
Max IBs to Display
Controls how many recent structures and related objects remain visible on chart.
Show IB Box / Midline / Breakout Arrow / Score Label
Lets users decide how much visual detail they want to keep on screen.
Glow Effect on High Score
Adds emphasis to stronger breakout events without changing the underlying logic.
Fakeout Window
Defines how many bars after breakout the script should continue monitoring for a return back through the breakout boundary.
Limitations & Transparency
This script studies inside bar compression and subsequent breakout behavior. It does not claim to identify all meaningful consolidations, and it does not attempt to classify every market regime. The methodology is intentionally focused on one structure.
The score is a rule-based quality model, not an objective measure of future outcome. A high score does not guarantee continuation, and a lower score does not guarantee failure. It simply reflects how the breakout candle and its context behave according to the script’s internal criteria.
Volume-based interpretation may vary across symbols and markets. On some instruments, especially those with inconsistent or synthetic volume data, volume confirmation may be less informative than on others. Users should evaluate whether volume filtering is appropriate for the asset they are studying.
Fakeout detection is also definition-dependent. The script labels a fakeout when price returns through the breakout boundary within the selected lookback window. Different traders may prefer a different timing window or a different failure definition.
As with any overlay, chart readability depends on market volatility, timeframe, and user settings. On lower timeframes or during highly active periods, more visual events may appear. The built-in filters and display controls are there to help manage that density.
Risk Disclosure
This script is an analytical tool for chart study. It is not financial advice, not a trade recommendation, and not a promise of future results.
Inside bar breakouts can behave differently across timeframes, instruments, and market regimes. Users should not rely on a single pattern, score, or alert in isolation. Context still matters, including trend condition, liquidity environment, nearby structure, volatility regime, and execution discipline.
Before using this script in any live decision process, it should be reviewed in the specific market and timeframe relevant to the user’s own approach. Testing, observation, and risk controls remain essential.
Release Note
Update Notes — V1.2This update focuses on structure, readability, and chart hygiene.
What changed:
- Refined the visual presentation of inside-bar clusters for a cleaner and more consistent chart layout.
- Improved breakout labeling so quality signals remain easier to read during active market phases.
- Reduced fakeout label density to lower visual noise and keep higher-value events more visible.
- Added extra spacing logic to help prevent label crowding in tighter price sections.
- Softened box and midline visuals slightly so candles remain clearer underneath the structure.
- Standardized the panel header with the current AG Pro layout, including the merged first row and blue title bar.
- Preserved the quality-based breakout framework while improving the overall chart balance and presentation.
Notes:
- This update is focused on visual clarity and usability rather than promising outcomes.
- Signals should still be interpreted in context with market structure, liquidity, volatility, and confirmation behavior.
- The script is designed as a chart analysis tool and alert framework, not as a stand-alone trading system.
Risk Disclosure:
This script is for market analysis and educational use only. It does not guarantee performance, profitability, or trade outcomes. Always use your own risk management and confirmation process.
Release Note
Update Notes - v2.0This update keeps the original Inside Bar Breakout Quality concept intact, but makes the workflow sharper, cleaner, and more visually persuasive on chart.
What changed
- Refined the breakout quality engine so strong expansion bars stand out more clearly after inside-bar compression.
- Added an Acceptance Pocket around the broken mother-bar edge to show whether price is holding the breakout or starting to lose acceptance.
- Added Pocket Hold logic so the script can distinguish a clean hold from a fast failure after breakout.
- Improved fakeout handling so fast returns back inside the mother-bar range are tracked more reliably.
- Upgraded label placement with ATR-based spacing so markers stay readable instead of getting buried inside candles.
- Reworked the premium panel to match the current AGPro standard:
blue merged header row,
script-name-only top row,
adjustable panel location,
adjustable panel theme,
default panel font size set to Normal.
- Updated the public title format to the current AGPro Series naming standard while keeping the same script identity.
- Kept the chart cleaner by preserving label-gap controls and limiting visual clutter during active periods.
Why this update matters
The script is still focused on inside-bar compression and breakout quality, but now it tells a fuller story:
compression,
breakout,
acceptance at the broken edge,
or fakeout back into range.
That makes the tool more useful for chart reading without turning it into a generic breakout dashboard or overlapping with other AGPro breakout tools.
Best use case
Use it when you want to evaluate whether an inside-bar break is only a quick push, a trap, or a cleaner expansion that can actually hold beyond the mother-bar boundary.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
⚡Precision Pine tools for crypto & FX traders
📊ICT • Smart Money • Market Structure • Liquidity
🧠Rules-based decision tools. No hype. No guesswork
🆕Public-free releases. Continuous updates
⭐Follow AGPro Series for new trading tools
💬t.me/agprolabs
📊ICT • Smart Money • Market Structure • Liquidity
🧠Rules-based decision tools. No hype. No guesswork
🆕Public-free releases. Continuous updates
⭐Follow AGPro Series for new trading 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-free releases. Continuous updates
⭐Follow AGPro Series for new trading tools
💬t.me/agprolabs
📊ICT • Smart Money • Market Structure • Liquidity
🧠Rules-based decision tools. No hype. No guesswork
🆕Public-free releases. Continuous updates
⭐Follow AGPro Series for new trading tools
💬t.me/agprolabs
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน