OPEN-SOURCE SCRIPT
Breaker Block Detector [algotim]

Overview
Breaker Block Detector is a structure-based indicator designed to identify Breaker Block formations only after a defined swing sequence and structural break have occurred.
The purpose of the script is to make Breaker Block analysis more systematic. Instead of marking every visually similar candle formation, it first establishes confirmed swing structure, waits for a qualifying Break of Structure, validates the displacement of the breakout candle relative to ATR, and then derives the relevant zone from the preceding Order Block structure.
This creates a sequential workflow in which a breaker is the result of a structural event rather than an isolated candle pattern.
Problem Statement
Basic Breaker Block indicators can produce large numbers of zones because the underlying concept is often reduced to simple swing relationships.
The difficulty is determining which structural events are significant enough to retain.
This script addresses that problem by adding confirmation layers around the Breaker Block formation:
1. Confirm the relevant swing structure.
2. Detect the structural break.
3. Test the breakout candle for sufficient displacement.
4. Identify the originating Order Block candle.
5. Create the Breaker Block zone.
6. Filter near-duplicate zones and manage the number of active zones.
The result is intended to provide a more structured representation of breaker formations while reducing some of the visual noise created by treating every local pattern equally.
Methodology
1. Confirmed Swing Structure
The script uses configurable pivot length to identify swing highs and swing lows.
A pivot is only available after the required bars on both sides have formed. Consequently, the swing itself is confirmed retrospectively rather than being treated as known at the original pivot bar.
This confirmation process is important because the subsequent Break of Structure calculation depends on established swing levels.
2. Break of Structure
Once a confirmed swing level is available, price is monitored for a structural break.
For bullish structure, price must move above the relevant confirmed swing high.
For bearish structure, price must move below the relevant confirmed swing low.
The BOS confirmation method can be configured to use either the candle close or the candle wick.
Using Close requires the candle to finish beyond the structural level. Using Wick allows the structural event to be recognized from an intrabar excursion beyond that level.
3. Displacement Validation
A structural break alone does not automatically qualify as a breaker event.
The BOS candle is measured using its complete high-to-low range.
That range is compared with the current ATR:
Displacement requirement = ATR × Displacement Multiplier
Only when the BOS candle exceeds the configured ATR threshold does the displacement filter pass.
This provides a volatility-adjusted way to distinguish larger structural moves from relatively small breaks.
4. Originating Order Block
After a qualifying structural event, the script examines the configurable number of candles preceding the BOS impulse.
The relevant opposite-direction candle is used to define the originating Order Block region.
This means the Breaker Block is not selected independently from the structural event. The zone is derived from the candle structure associated with the move that produced the qualifying break.
5. Breaker Formation
The script evaluates the relationship between confirmed swing points to determine whether the required structural sequence has occurred.
Bearish formations are based on a high-low-high relationship followed by a close or wick break through the intervening structure, depending on the selected confirmation mode.
Bullish formations use the corresponding low-high-low relationship followed by a break through the intervening structure.
This structural sequence is what determines whether a region is treated as a Breaker Block.
6. Zone Management
Once created, breaker zones are maintained as chart objects and extended to the right for the configured number of bars.
The script can limit the number of active breaker zones displayed on each side.
ATR-relative duplicate filtering is also used so that closely overlapping breaker formations are not unnecessarily repeated on the chart.
Signal Workflow
The complete analytical workflow is:
1. Detect and confirm swing highs/lows.
2. Store the relevant structural levels.
3. Monitor price for a Break of Structure.
4. Determine whether the BOS candle satisfies the ATR displacement threshold.
5. Evaluate the associated structural sequence.
6. Locate the originating Order Block candle.
7. Create the corresponding bullish or bearish Breaker Block.
8. Reject sufficiently similar duplicate zones.
9. Extend and maintain the active zone.
10. Monitor subsequent interaction with the zone and its validity state.
The indicator therefore treats a Breaker Block as the output of a sequence of structural conditions rather than as a standalone visual pattern.
Why This Indicator Is Different
A conventional Breaker Block script can simply identify a swing pattern and draw a box around it.
This implementation adds a validation layer between structure and zone creation.
The important distinction is the sequence:
**Confirmed Structure -> Break of Structure -> ATR Displacement Validation -> Originating Order Block -> Breaker Zone**
The ATR component is not included as a separate volatility indicator. Its purpose is specifically to determine whether the structural break has sufficient range relative to the current market volatility.
Likewise, the Order Block component is not intended to create an unrelated collection of zones. It provides the price region from which the qualifying structural move originated.
This interaction is the central design of the indicator.
Inputs
Structure Detection
**Swing Length**
Controls the number of bars used on each side to confirm swing highs and swing lows. Larger values produce fewer, more significant structural points.
**BOS Confirmation**
Choose between Close and Wick confirmation for structural breaks.
**Max Active Breakers**
Controls the maximum number of active breaker zones retained on each side.
Breaker Validity Engine
**ATR Length**
Determines the ATR calculation used for displacement validation.
**Displacement Multiplier**
Sets the minimum BOS candle range relative to ATR required for the displacement filter.
**OB Candle Lookback**
Controls how many candles preceding the BOS impulse are examined when identifying the originating Order Block.
Visual Settings
Users can configure bullish and bearish zone colors, borders, midline width, right-side extension length, mitigation labels, and BOS lines.
Alerts
The script provides alert conditions for:
* New Bullish Breaker
* New Bearish Breaker
* Bullish Breaker Retest
* Bearish Breaker Retest
* Bullish Breaker Invalidation
* Bearish Breaker Invalidation
These alerts allow users to monitor newly created zones and subsequent interactions without continuously watching the chart.
Practical Usage
The indicator is intended primarily as a structural analysis tool.
A typical workflow is to first use the confirmed swing structure to understand the current market context, then examine newly created breaker zones only after the structural break and displacement conditions have been satisfied.
Users may then monitor a breaker for a later retest or invalidation and combine that information with their own price-action, trend, volatility, or risk-management framework.
The configurable swing length and displacement threshold can be adjusted according to the instrument and timeframe. More restrictive settings generally produce fewer qualifying formations, while less restrictive settings can produce more zones.
Limitations
Breaker Block terminology represents a market-structure interpretation rather than a directly observable measurement of institutional orders.
The script does not measure actual institutional order flow, market participant identity, or future price direction.
Confirmed pivots require subsequent bars before the swing is established, so historical swing points become available only after confirmation.
Wick-based BOS confirmation is less restrictive than close-based confirmation and can therefore recognize structural breaks that do not persist through the candle close.
ATR displacement is a volatility-relative filter; it does not determine whether a move will continue.
Breaker zones and alerts should therefore be treated as analytical references rather than standalone trading signals.
Notes
This indicator is designed to provide a systematic framework for studying Breaker Block formations through confirmed swing structure, structural breaks, volatility-adjusted displacement, and originating candle analysis.
The calculations describe price behavior observable in the chart. Terms such as Break of Structure, Order Block, and Breaker Block are used as technical-analysis concepts and should not be interpreted as evidence of specific institutional activity.
Users should validate the resulting zones within their own market analysis and risk-management process.
Breaker Block Detector is a structure-based indicator designed to identify Breaker Block formations only after a defined swing sequence and structural break have occurred.
The purpose of the script is to make Breaker Block analysis more systematic. Instead of marking every visually similar candle formation, it first establishes confirmed swing structure, waits for a qualifying Break of Structure, validates the displacement of the breakout candle relative to ATR, and then derives the relevant zone from the preceding Order Block structure.
This creates a sequential workflow in which a breaker is the result of a structural event rather than an isolated candle pattern.
Problem Statement
Basic Breaker Block indicators can produce large numbers of zones because the underlying concept is often reduced to simple swing relationships.
The difficulty is determining which structural events are significant enough to retain.
This script addresses that problem by adding confirmation layers around the Breaker Block formation:
1. Confirm the relevant swing structure.
2. Detect the structural break.
3. Test the breakout candle for sufficient displacement.
4. Identify the originating Order Block candle.
5. Create the Breaker Block zone.
6. Filter near-duplicate zones and manage the number of active zones.
The result is intended to provide a more structured representation of breaker formations while reducing some of the visual noise created by treating every local pattern equally.
Methodology
1. Confirmed Swing Structure
The script uses configurable pivot length to identify swing highs and swing lows.
A pivot is only available after the required bars on both sides have formed. Consequently, the swing itself is confirmed retrospectively rather than being treated as known at the original pivot bar.
This confirmation process is important because the subsequent Break of Structure calculation depends on established swing levels.
2. Break of Structure
Once a confirmed swing level is available, price is monitored for a structural break.
For bullish structure, price must move above the relevant confirmed swing high.
For bearish structure, price must move below the relevant confirmed swing low.
The BOS confirmation method can be configured to use either the candle close or the candle wick.
Using Close requires the candle to finish beyond the structural level. Using Wick allows the structural event to be recognized from an intrabar excursion beyond that level.
3. Displacement Validation
A structural break alone does not automatically qualify as a breaker event.
The BOS candle is measured using its complete high-to-low range.
That range is compared with the current ATR:
Displacement requirement = ATR × Displacement Multiplier
Only when the BOS candle exceeds the configured ATR threshold does the displacement filter pass.
This provides a volatility-adjusted way to distinguish larger structural moves from relatively small breaks.
4. Originating Order Block
After a qualifying structural event, the script examines the configurable number of candles preceding the BOS impulse.
The relevant opposite-direction candle is used to define the originating Order Block region.
This means the Breaker Block is not selected independently from the structural event. The zone is derived from the candle structure associated with the move that produced the qualifying break.
5. Breaker Formation
The script evaluates the relationship between confirmed swing points to determine whether the required structural sequence has occurred.
Bearish formations are based on a high-low-high relationship followed by a close or wick break through the intervening structure, depending on the selected confirmation mode.
Bullish formations use the corresponding low-high-low relationship followed by a break through the intervening structure.
This structural sequence is what determines whether a region is treated as a Breaker Block.
6. Zone Management
Once created, breaker zones are maintained as chart objects and extended to the right for the configured number of bars.
The script can limit the number of active breaker zones displayed on each side.
ATR-relative duplicate filtering is also used so that closely overlapping breaker formations are not unnecessarily repeated on the chart.
Signal Workflow
The complete analytical workflow is:
1. Detect and confirm swing highs/lows.
2. Store the relevant structural levels.
3. Monitor price for a Break of Structure.
4. Determine whether the BOS candle satisfies the ATR displacement threshold.
5. Evaluate the associated structural sequence.
6. Locate the originating Order Block candle.
7. Create the corresponding bullish or bearish Breaker Block.
8. Reject sufficiently similar duplicate zones.
9. Extend and maintain the active zone.
10. Monitor subsequent interaction with the zone and its validity state.
The indicator therefore treats a Breaker Block as the output of a sequence of structural conditions rather than as a standalone visual pattern.
Why This Indicator Is Different
A conventional Breaker Block script can simply identify a swing pattern and draw a box around it.
This implementation adds a validation layer between structure and zone creation.
The important distinction is the sequence:
**Confirmed Structure -> Break of Structure -> ATR Displacement Validation -> Originating Order Block -> Breaker Zone**
The ATR component is not included as a separate volatility indicator. Its purpose is specifically to determine whether the structural break has sufficient range relative to the current market volatility.
Likewise, the Order Block component is not intended to create an unrelated collection of zones. It provides the price region from which the qualifying structural move originated.
This interaction is the central design of the indicator.
Inputs
Structure Detection
**Swing Length**
Controls the number of bars used on each side to confirm swing highs and swing lows. Larger values produce fewer, more significant structural points.
**BOS Confirmation**
Choose between Close and Wick confirmation for structural breaks.
**Max Active Breakers**
Controls the maximum number of active breaker zones retained on each side.
Breaker Validity Engine
**ATR Length**
Determines the ATR calculation used for displacement validation.
**Displacement Multiplier**
Sets the minimum BOS candle range relative to ATR required for the displacement filter.
**OB Candle Lookback**
Controls how many candles preceding the BOS impulse are examined when identifying the originating Order Block.
Visual Settings
Users can configure bullish and bearish zone colors, borders, midline width, right-side extension length, mitigation labels, and BOS lines.
Alerts
The script provides alert conditions for:
* New Bullish Breaker
* New Bearish Breaker
* Bullish Breaker Retest
* Bearish Breaker Retest
* Bullish Breaker Invalidation
* Bearish Breaker Invalidation
These alerts allow users to monitor newly created zones and subsequent interactions without continuously watching the chart.
Practical Usage
The indicator is intended primarily as a structural analysis tool.
A typical workflow is to first use the confirmed swing structure to understand the current market context, then examine newly created breaker zones only after the structural break and displacement conditions have been satisfied.
Users may then monitor a breaker for a later retest or invalidation and combine that information with their own price-action, trend, volatility, or risk-management framework.
The configurable swing length and displacement threshold can be adjusted according to the instrument and timeframe. More restrictive settings generally produce fewer qualifying formations, while less restrictive settings can produce more zones.
Limitations
Breaker Block terminology represents a market-structure interpretation rather than a directly observable measurement of institutional orders.
The script does not measure actual institutional order flow, market participant identity, or future price direction.
Confirmed pivots require subsequent bars before the swing is established, so historical swing points become available only after confirmation.
Wick-based BOS confirmation is less restrictive than close-based confirmation and can therefore recognize structural breaks that do not persist through the candle close.
ATR displacement is a volatility-relative filter; it does not determine whether a move will continue.
Breaker zones and alerts should therefore be treated as analytical references rather than standalone trading signals.
Notes
This indicator is designed to provide a systematic framework for studying Breaker Block formations through confirmed swing structure, structural breaks, volatility-adjusted displacement, and originating candle analysis.
The calculations describe price behavior observable in the chart. Terms such as Break of Structure, Order Block, and Breaker Block are used as technical-analysis concepts and should not be interpreted as evidence of specific institutional activity.
Users should validate the resulting zones within their own market analysis and risk-management process.
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.
Build your trading tools with AI : algotim.com
All content provided by AlgoTim (algo_aakash) is for informational and educational purposes only. Trading involves risk, and past performance does not guarantee future results.
All content provided by AlgoTim (algo_aakash) is for informational and educational purposes only. Trading involves risk, and past performance does not guarantee future results.
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.
Build your trading tools with AI : algotim.com
All content provided by AlgoTim (algo_aakash) is for informational and educational purposes only. Trading involves risk, and past performance does not guarantee future results.
All content provided by AlgoTim (algo_aakash) is for informational and educational purposes only. Trading involves risk, and past performance does not guarantee future results.
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.