AG Pro Inside Bar Breakout Quality [AGPro Series]AG Pro Inside Bar Breakout Quality
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.
Indicador Pine Script®















