OPEN-SOURCE SCRIPT
Reversal OB Zones

REVERSAL OB ZONES
Reversal OB Zones locates the first Break of Structure in a trend and marks the Order Block and rebound zone that come with it - one setup at a time, drawn the moment the break confirms, using only price structure that already exists on the chart.
THE IDEA BEHIND IT
The indicator is built on the Smart Money Concepts / ICT idea that a trend doesn't reverse randomly: it reverses at the last point where "smart money" was still positioned in the direction of the old trend before structure broke. That point is the Order Block - the last opposing candle before the move that produced the reversal - and it tends to act as support or resistance the first time price returns to it.
To find that moment, the script tracks a trailing key level: the support (in an uptrend) or resistance (in a downtrend) left behind by the most recent genuine higher high or lower low. A pullback that doesn't make a new extreme never moves this level - only an actual new high or low does. The first candle to close back through that level is the first Break of Structure (BOS). Everything else - the Order Block and the rebound zone - is already sitting in the chart's history at that exact moment, so both are drawn immediately, on the same candle as the break, with no repainting and no waiting for future bars to "confirm" anything further.
Swing highs and lows themselves come from a pure, zero-threshold structure detector (a point counts the moment the next candle confirms it was a local extreme) - there is no ATR filter or fixed lookback window involved, so the logic behaves the same in quiet and in noisy price action.
WHAT'S ON THE CHART
Each setup is made of three parts, always drawn together:
- First BOS line and label: marks the level that broke and the candle that broke it.
- Order Block zone (teal for longs, maroon for shorts): the last opposite-colored candle before the trend's real high/low, with a small ATR buffer added beyond that extreme.
- Rebound zone (gray box): the two prior structural support/resistance levels immediately behind the Order Block. This is the room price is expected to use while retracing back up (or down) into the Order Block; it is not a level to be traded on its own - see below.
Only one setup is ever active at a time: while an Order Block and its rebound zone are on the chart, the indicator will not flag a new BOS in either direction. A setup stays on the chart until it is invalidated - there is no time-based expiry.
HOW TO USE IT
The Order Block is the only zone you trade. A bearish (maroon) Order Block is a level to look for shorts; a bullish (teal) Order Block is a level to look for longs - the trade direction always matches the color of the Order Block, not the gray zone.
The gray rebound zone is not tradable. It exists purely to define how far price is allowed to retrace before the setup is considered dead: it marks the boundary between "price is still reasonably retracing toward the Order Block" and "price has gone too far and the level no longer means anything." It is a boundary, not an entry.
A setup is invalidated - and both zones disappear together - under exactly two conditions:
1. Price closes back through the far side of the Order Block (the old trend has genuinely resumed).
2. Price closes through the far side of the gray rebound zone (support/resistance failed with no bounce, so the Order Block is no longer valid either).
If neither happens, the zones simply stay on the chart - there's no bar-count expiry to worry about.
A practical read: wait for the BOS, then watch for price to retrace back into the Order Block zone. The gray zone underneath (or above, for longs) is your line in the sand - if price closes beyond it before ever tagging the Order Block, treat the setup as invalidated rather than waiting for a reaction that structurally shouldn't be expected anymore.
INPUTS
- Look for bearish / bullish setups: enable or disable each direction independently.
- Order Block lookback: how many bars back to search for the Order Block candle.
- Pivot history to remember: how many structural key levels to keep for rebound-zone lookups.
- ATR length / buffer: controls the small buffer added beyond the Order Block's originating extreme.
- Style: colors and label size for both zones and the BOS marker.
NOTES
Because everything is built from confirmed structure rather than fixed-length pivots or volatility thresholds, the indicator works the same way across instruments and timeframes without needing to be re-tuned. As with any structural/SMC tool, treat it as a way to frame where price is likely to react, not as a standalone signal - combine it with your own confirmation and risk management.
Reversal OB Zones locates the first Break of Structure in a trend and marks the Order Block and rebound zone that come with it - one setup at a time, drawn the moment the break confirms, using only price structure that already exists on the chart.
THE IDEA BEHIND IT
The indicator is built on the Smart Money Concepts / ICT idea that a trend doesn't reverse randomly: it reverses at the last point where "smart money" was still positioned in the direction of the old trend before structure broke. That point is the Order Block - the last opposing candle before the move that produced the reversal - and it tends to act as support or resistance the first time price returns to it.
To find that moment, the script tracks a trailing key level: the support (in an uptrend) or resistance (in a downtrend) left behind by the most recent genuine higher high or lower low. A pullback that doesn't make a new extreme never moves this level - only an actual new high or low does. The first candle to close back through that level is the first Break of Structure (BOS). Everything else - the Order Block and the rebound zone - is already sitting in the chart's history at that exact moment, so both are drawn immediately, on the same candle as the break, with no repainting and no waiting for future bars to "confirm" anything further.
Swing highs and lows themselves come from a pure, zero-threshold structure detector (a point counts the moment the next candle confirms it was a local extreme) - there is no ATR filter or fixed lookback window involved, so the logic behaves the same in quiet and in noisy price action.
WHAT'S ON THE CHART
Each setup is made of three parts, always drawn together:
- First BOS line and label: marks the level that broke and the candle that broke it.
- Order Block zone (teal for longs, maroon for shorts): the last opposite-colored candle before the trend's real high/low, with a small ATR buffer added beyond that extreme.
- Rebound zone (gray box): the two prior structural support/resistance levels immediately behind the Order Block. This is the room price is expected to use while retracing back up (or down) into the Order Block; it is not a level to be traded on its own - see below.
Only one setup is ever active at a time: while an Order Block and its rebound zone are on the chart, the indicator will not flag a new BOS in either direction. A setup stays on the chart until it is invalidated - there is no time-based expiry.
HOW TO USE IT
The Order Block is the only zone you trade. A bearish (maroon) Order Block is a level to look for shorts; a bullish (teal) Order Block is a level to look for longs - the trade direction always matches the color of the Order Block, not the gray zone.
The gray rebound zone is not tradable. It exists purely to define how far price is allowed to retrace before the setup is considered dead: it marks the boundary between "price is still reasonably retracing toward the Order Block" and "price has gone too far and the level no longer means anything." It is a boundary, not an entry.
A setup is invalidated - and both zones disappear together - under exactly two conditions:
1. Price closes back through the far side of the Order Block (the old trend has genuinely resumed).
2. Price closes through the far side of the gray rebound zone (support/resistance failed with no bounce, so the Order Block is no longer valid either).
If neither happens, the zones simply stay on the chart - there's no bar-count expiry to worry about.
A practical read: wait for the BOS, then watch for price to retrace back into the Order Block zone. The gray zone underneath (or above, for longs) is your line in the sand - if price closes beyond it before ever tagging the Order Block, treat the setup as invalidated rather than waiting for a reaction that structurally shouldn't be expected anymore.
INPUTS
- Look for bearish / bullish setups: enable or disable each direction independently.
- Order Block lookback: how many bars back to search for the Order Block candle.
- Pivot history to remember: how many structural key levels to keep for rebound-zone lookups.
- ATR length / buffer: controls the small buffer added beyond the Order Block's originating extreme.
- Style: colors and label size for both zones and the BOS marker.
NOTES
Because everything is built from confirmed structure rather than fixed-length pivots or volatility thresholds, the indicator works the same way across instruments and timeframes without needing to be re-tuned. As with any structural/SMC tool, treat it as a way to frame where price is likely to react, not as a standalone signal - combine it with your own confirmation and risk management.
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.