OPEN-SOURCE SCRIPT
Aktualisiert AG Pro BOS & CHoCH Auto Detector [AGPro Series]

AG Pro BOS & CHoCH Auto Detector [AGPro Series]
OVERVIEW / WHAT IT DOES
AG Pro BOS & CHoCH Auto Detector is a market structure overlay designed to organize swing-based price action into a more readable workflow. Instead of leaving the chart covered with disconnected pivot labels or generic break markers, this script tracks structural swing progression, identifies when prior highs or lows are broken, and classifies those breaks as either BOS (Break of Structure) or CHoCH (Change of Character). The goal is not to predict the next move, but to help traders read whether price is continuing an existing structure or beginning to challenge it.
The script monitors HH, HL, LH, and LL development using pivot logic, then uses those reference points to detect structural breaks. A break in the direction of the active structure is treated as BOS, while the first meaningful break against the prior directional structure is treated as CHoCH. This distinction matters because many charts show every break in the same visual language, even though continuation and character shift do not carry the same analytical meaning. Here, those events are separated clearly.
A second layer of usefulness comes from presentation discipline. This script is built to keep structural information visible without turning the chart into a wall of labels. Swing density can be reduced, major structures can be emphasized, and the higher timeframe overlay can remain active in the background to keep local execution aligned with broader structure. The result is a structure map that stays informative without becoming visually noisy.
This tool is intended for traders who already use price structure as part of their chart reading and want a cleaner way to monitor continuation versus transition. It can support discretionary workflows around trend continuation, pullback analysis, structure failure, and higher timeframe context, while still remaining transparent about how its signals are formed.
UNIQUE EDGE
Many market structure tools stop at plotting swing points or printing BOS / CHoCH text when a level is crossed. AG Pro BOS & CHoCH Auto Detector is built around a more organized structure engine approach.
Its edge is not based on trying to forecast direction or force trade entries. Its edge is based on classification, hierarchy, and chart readability:
- It separates continuation breaks from character-change breaks instead of treating all structural violations as equivalent.
- It preserves the swing chain context behind each event, so BOS and CHoCH are not isolated labels detached from surrounding structure.
- It allows confirmation mode selection, so the user can decide whether structure breaks require close confirmation or can react to intrabar violations.
- It includes higher timeframe structure context directly on the chart rather than forcing the user to reconstruct that context manually.
- It includes swing-density controls so the visual output can be kept clean even when structure is active.
This makes the script less like a simple labeling utility and more like a workflow layer for structure-based chart reading.
METHODOLOGY
1) Swing Structure Detection
The script uses pivot-based highs and lows to identify structural reference points. Those pivots are then classified into HH, HL, LH, and LL sequences, allowing the chart to reflect whether structure is strengthening, weakening, or transitioning.
2) BOS Logic
When price breaks a prior structural level in the direction of the active trend, the event is labeled as BOS. In practical terms, this represents structural continuation rather than directional reversal.
3) CHoCH Logic
When price breaks against the previously established directional structure, the event is labeled as CHoCH. This is treated as a possible character shift, not as a guaranteed reversal. It highlights that the prior structure has been challenged.
4) Confirmation Mode
Users can choose whether structure breaks are confirmed by candle close or by intrabar price action. Close mode is more conservative and can reduce noise. Intrabar mode is more responsive and may show earlier breaks.
5) Higher Timeframe Overlay
An optional MTF layer allows the script to bring higher timeframe structure context onto the active chart. This can help users avoid reading local swings in isolation when broader structure is still dominant.
6) Visual Hierarchy
The script uses horizontal structure levels, event labels, optional arrows, controlled swing density, and a compact information panel to keep key structure events readable. The design priority is to preserve analytical clarity.
SIGNALS & ALERTS
This script can generate structure-based alerts for the following event types:
- Bullish BOS
- Bearish BOS
- Bullish CHoCH
- Bearish CHoCH
- Any structure break
These alerts are event-driven and tied to the script's structural logic. They are intended to notify the user when a relevant break occurs according to the selected confirmation mode. They are not trade instructions and should be interpreted within the user's broader process.
KEY INPUTS
Swing Pivot Length
Controls pivot sensitivity. Lower values detect swings faster but may produce more noise. Higher values are more selective.
Confirmation Mode
Choose between Close and Intrabar logic for structure break confirmation.
Max Structures to Show
Limits how many structural events remain plotted on the chart.
Swing Label Density
Lets users choose between fuller swing annotation and a cleaner major-structure view.
Max Swing Labels on Chart
Helps prevent excessive label build-up in active market conditions.
Enable MTF Overlay
Adds higher timeframe structure context to the active chart.
MTF Timeframe
Defines which higher timeframe structure layer is projected onto the chart.
Label Size / Panel Font Size / Line Settings
Allow visual tuning without changing structural logic.
LIMITATIONS & TRANSPARENCY
This script uses pivot-based structure logic. That means swing points are confirmed only after the required pivot bars are completed. Because of this, the tool is confirmation-based by design and does not attempt to label unfinished pivots as confirmed structure.
BOS and CHoCH are structural events, not certainty statements. A CHoCH may signal that the prior directional structure is being challenged, but it does not guarantee a lasting reversal. Likewise, a BOS indicates continuation within the script's structural framework, but not guaranteed follow-through.
The higher timeframe overlay is designed to add context, not to replace direct higher timeframe chart review. Users should still interpret local and higher timeframe structure together rather than relying on a single signal state.
This script is best used as a structure-mapping tool within a broader analytical framework. It is not a standalone trading system, not a predictor, and not a substitute for risk management.
RISK DISCLOSURE
This indicator is for chart analysis and educational use. It does not provide financial advice, does not guarantee outcomes, and should not be treated as a complete trading methodology on its own. Market structure tools can help organize price action, but all trading decisions remain the responsibility of the user.
OVERVIEW / WHAT IT DOES
AG Pro BOS & CHoCH Auto Detector is a market structure overlay designed to organize swing-based price action into a more readable workflow. Instead of leaving the chart covered with disconnected pivot labels or generic break markers, this script tracks structural swing progression, identifies when prior highs or lows are broken, and classifies those breaks as either BOS (Break of Structure) or CHoCH (Change of Character). The goal is not to predict the next move, but to help traders read whether price is continuing an existing structure or beginning to challenge it.
The script monitors HH, HL, LH, and LL development using pivot logic, then uses those reference points to detect structural breaks. A break in the direction of the active structure is treated as BOS, while the first meaningful break against the prior directional structure is treated as CHoCH. This distinction matters because many charts show every break in the same visual language, even though continuation and character shift do not carry the same analytical meaning. Here, those events are separated clearly.
A second layer of usefulness comes from presentation discipline. This script is built to keep structural information visible without turning the chart into a wall of labels. Swing density can be reduced, major structures can be emphasized, and the higher timeframe overlay can remain active in the background to keep local execution aligned with broader structure. The result is a structure map that stays informative without becoming visually noisy.
This tool is intended for traders who already use price structure as part of their chart reading and want a cleaner way to monitor continuation versus transition. It can support discretionary workflows around trend continuation, pullback analysis, structure failure, and higher timeframe context, while still remaining transparent about how its signals are formed.
UNIQUE EDGE
Many market structure tools stop at plotting swing points or printing BOS / CHoCH text when a level is crossed. AG Pro BOS & CHoCH Auto Detector is built around a more organized structure engine approach.
Its edge is not based on trying to forecast direction or force trade entries. Its edge is based on classification, hierarchy, and chart readability:
- It separates continuation breaks from character-change breaks instead of treating all structural violations as equivalent.
- It preserves the swing chain context behind each event, so BOS and CHoCH are not isolated labels detached from surrounding structure.
- It allows confirmation mode selection, so the user can decide whether structure breaks require close confirmation or can react to intrabar violations.
- It includes higher timeframe structure context directly on the chart rather than forcing the user to reconstruct that context manually.
- It includes swing-density controls so the visual output can be kept clean even when structure is active.
This makes the script less like a simple labeling utility and more like a workflow layer for structure-based chart reading.
METHODOLOGY
1) Swing Structure Detection
The script uses pivot-based highs and lows to identify structural reference points. Those pivots are then classified into HH, HL, LH, and LL sequences, allowing the chart to reflect whether structure is strengthening, weakening, or transitioning.
2) BOS Logic
When price breaks a prior structural level in the direction of the active trend, the event is labeled as BOS. In practical terms, this represents structural continuation rather than directional reversal.
3) CHoCH Logic
When price breaks against the previously established directional structure, the event is labeled as CHoCH. This is treated as a possible character shift, not as a guaranteed reversal. It highlights that the prior structure has been challenged.
4) Confirmation Mode
Users can choose whether structure breaks are confirmed by candle close or by intrabar price action. Close mode is more conservative and can reduce noise. Intrabar mode is more responsive and may show earlier breaks.
5) Higher Timeframe Overlay
An optional MTF layer allows the script to bring higher timeframe structure context onto the active chart. This can help users avoid reading local swings in isolation when broader structure is still dominant.
6) Visual Hierarchy
The script uses horizontal structure levels, event labels, optional arrows, controlled swing density, and a compact information panel to keep key structure events readable. The design priority is to preserve analytical clarity.
SIGNALS & ALERTS
This script can generate structure-based alerts for the following event types:
- Bullish BOS
- Bearish BOS
- Bullish CHoCH
- Bearish CHoCH
- Any structure break
These alerts are event-driven and tied to the script's structural logic. They are intended to notify the user when a relevant break occurs according to the selected confirmation mode. They are not trade instructions and should be interpreted within the user's broader process.
KEY INPUTS
Swing Pivot Length
Controls pivot sensitivity. Lower values detect swings faster but may produce more noise. Higher values are more selective.
Confirmation Mode
Choose between Close and Intrabar logic for structure break confirmation.
Max Structures to Show
Limits how many structural events remain plotted on the chart.
Swing Label Density
Lets users choose between fuller swing annotation and a cleaner major-structure view.
Max Swing Labels on Chart
Helps prevent excessive label build-up in active market conditions.
Enable MTF Overlay
Adds higher timeframe structure context to the active chart.
MTF Timeframe
Defines which higher timeframe structure layer is projected onto the chart.
Label Size / Panel Font Size / Line Settings
Allow visual tuning without changing structural logic.
LIMITATIONS & TRANSPARENCY
This script uses pivot-based structure logic. That means swing points are confirmed only after the required pivot bars are completed. Because of this, the tool is confirmation-based by design and does not attempt to label unfinished pivots as confirmed structure.
BOS and CHoCH are structural events, not certainty statements. A CHoCH may signal that the prior directional structure is being challenged, but it does not guarantee a lasting reversal. Likewise, a BOS indicates continuation within the script's structural framework, but not guaranteed follow-through.
The higher timeframe overlay is designed to add context, not to replace direct higher timeframe chart review. Users should still interpret local and higher timeframe structure together rather than relying on a single signal state.
This script is best used as a structure-mapping tool within a broader analytical framework. It is not a standalone trading system, not a predictor, and not a substitute for risk management.
RISK DISCLOSURE
This indicator is for chart analysis and educational use. It does not provide financial advice, does not guarantee outcomes, and should not be treated as a complete trading methodology on its own. Market structure tools can help organize price action, but all trading decisions remain the responsibility of the user.
Versionshinweise
Update Notes (V1.1)This update focuses on panel standardization and visual consistency.
What changed:
- Refined the top-right information panel to match the current AG Pro panel standard.
- Rebuilt the first panel row as a single merged header row.
- Applied the standard blue header background for a cleaner and more consistent panel identity.
- Simplified the header content so the first row now displays only the script name.
- Set the default panel font size to Small for a more compact chart footprint.
- Kept the default label size at Normal.
What did not change:
- No change to BOS or CHoCH detection logic.
- No change to swing labeling logic.
- No change to MTF structure behavior.
- No change to alert conditions.
- No change to confirmation mode behavior.
Notes:
- This is a visual and layout-focused update only.
- The purpose of this revision is to improve panel readability, layout discipline, and presentation consistency without changing the analytical core of the script.
Risk Disclosure:
This script is designed for chart analysis and educational use. It does not provide financial advice and does not guarantee future results.
Versionshinweise
Version 1.3 Update Notes- Tightened the screenshot-facing layout by reducing BOS continuation label repetition with a dedicated visual cooldown.
- Shortened BOS and CHoCH label text so structure events read faster and occupy less chart space.
- Locked Structure Memory Windows to explicit left/top/right/bottom coordinates so the projected zones stay horizontal and cleaner on-chart.
- Kept the AGPro panel standard intact while preserving the same BOS and CHoCH engine logic from the prior update.
- This pass is focused on visual polish, readability, and publish presentation rather than changing the script concept.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
⚡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
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
⚡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
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.