OPEN-SOURCE SCRIPT
Orderblocks & Breakers

This indicator identifies potential orderblocks and breakers based on recent swing highs and lows. It is built to offer a structured, customizable, and noise-controlled view of how price interacts with supply and demand levels.
The script applies pivot-based swing detection to identify swing highs and lows.
Bullish Orderblocks: The script Identifies and stores the last down candle before a swing high is breached and confirms and plots the orderblock with a market structure break (close above the swing high).
Bearish Orderblocks: The script Identifies and stores the last up candle before a swing low is breached and confirms and plots the orderblock with a market structure break (close below the swing low).
When price later closes through an existing orderblock, it is reclassified as a Breaker and recolored accordingly. (all colors can be changed in the settings)
What Makes It Different
Unlike most orderblock tools that simply mark every swing-based block, this version introduces:
1. Chop Control – automatically hides breakers that price repeatedly closes through (2 closes after the orderblock becomes a breaker), keeping only relevant zones visible.
2. Recent Block Filtering – limits how many of the recent orderblocks or breakers are displayed, preventing chart clutter.
3. Dynamic Updating – orderblocks automatically convert to breakers when price closes beyond them, with clear color changes.
These features make it easier to study cleaner price structure without manually managing old or invalid zones. The optional Chop Control filter can reduce overlapping or repeatedly invalidated zones to keep the chart clearer.
Customizable Parameters
- Swing detection length (shorter means more aggressive pivot detection, longer means less aggressive so less highs/lows detected)
- Number of recent blocks to display
- Visibility toggles for orderblocks or breakers
- Color and transparency controls for each type
Alerts
Alerts can be set to trigger when price tests any defined zone.
Purpose
This indicator is designed as a price structure visualization and study tool.
It may assist in understanding how price interacts with previously active regions, but it does not produce signals or trade recommendations.
The script applies pivot-based swing detection to identify swing highs and lows.
Bullish Orderblocks: The script Identifies and stores the last down candle before a swing high is breached and confirms and plots the orderblock with a market structure break (close above the swing high).
Bearish Orderblocks: The script Identifies and stores the last up candle before a swing low is breached and confirms and plots the orderblock with a market structure break (close below the swing low).
When price later closes through an existing orderblock, it is reclassified as a Breaker and recolored accordingly. (all colors can be changed in the settings)
What Makes It Different
Unlike most orderblock tools that simply mark every swing-based block, this version introduces:
1. Chop Control – automatically hides breakers that price repeatedly closes through (2 closes after the orderblock becomes a breaker), keeping only relevant zones visible.
2. Recent Block Filtering – limits how many of the recent orderblocks or breakers are displayed, preventing chart clutter.
3. Dynamic Updating – orderblocks automatically convert to breakers when price closes beyond them, with clear color changes.
These features make it easier to study cleaner price structure without manually managing old or invalid zones. The optional Chop Control filter can reduce overlapping or repeatedly invalidated zones to keep the chart clearer.
Customizable Parameters
- Swing detection length (shorter means more aggressive pivot detection, longer means less aggressive so less highs/lows detected)
- Number of recent blocks to display
- Visibility toggles for orderblocks or breakers
- Color and transparency controls for each type
Alerts
Alerts can be set to trigger when price tests any defined zone.
Purpose
This indicator is designed as a price structure visualization and study tool.
It may assist in understanding how price interacts with previously active regions, but it does not produce signals or trade recommendations.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.