OPEN-SOURCE SCRIPT
Updated Order Block Zone Study + Confirmation

Order Block Zone Study + Confirmation marks support and resistance order-block zones, then helps users judge whether price is only reaching a zone or reacting with confirmation.
It is designed to answer three simple questions:
==================================================
WARNING
==================================================
This indicator is a chart-reading tool. It does not predict the future and does not guarantee that any order block will hold.
The labels, scores, observed stats, and confirmation markers are based on the script's internal model and the available chart data. They should be used as context, not as financial advice or as standalone buy/sell instructions.
==================================================
(1) OVERVIEW
==================================================
This indicator has two main parts.
1) Order-block zone detection
The script detects bullish and bearish order-block-style zones.
The zone logic uses several chart conditions together, including:
2) Confirmation add-on
The confirmation layer checks whether price is simply reaching the zone or whether the reaction is supported by additional conditions.
It can use:
==================================================
(2) WHAT YOU SEE ON THE CHART
==================================================
The indicator is designed to keep the latest active zones visible and reduce chart clutter by limiting how many zones and labels remain on the chart.
==================================================
(3) HOW TO USE IT PROPERLY
==================================================
The correct way to use this indicator is to read the zone step by step, not only look at the box.
Simple workflow
==================================================
(4) LABEL EXPLANATION
==================================================
A label may look like this:
Pine Script®
Support OB / Resistance OB
This tells you the zone type.
Grade
The grade summarizes the internal zone score.
A++ and A are stronger model grades. B+ is acceptable. B and C are weaker.
Status
The status explains the current condition of the zone.
Fresh is usually cleaner than tested. Broken means the zone is no longer active.
Observed
Observed shows the script's chart-based observation for that side of the model. It combines how often zones were touched and how often resolved zones reached the model target before invalidation.
This is not a guaranteed win rate. It depends on available chart history and the number of resolved examples.
Edge
Edge classifies the model's observed reward/risk behavior into simple language:
This is based on observed target/invalidation behavior, ATR-based target and invalidation distances, and confidence from sample size.
Model
Model is the final combined rating from 1 to 10.
It combines:
A practical reading:
==================================================
(5) PRACTICAL LABEL EXAMPLES
==================================================
Example 1
Pine Script®
This is a stronger support-zone reading. If price returns and confirmation appears, the reaction has better model support.
Example 2
Pine Script®
This is a watchlist-quality resistance zone. It may be useful, but it is not as strong unless confirmation appears.
Example 3
Pine Script®
The grade is strong, but the zone has already been tested. It can still matter, but it is less clean than a fresh zone.
Example 4
Pine Script®
This is a weak model reading. Even if price reaches it, it should not be trusted alone.
Example 5
Pine Script®
This is a decent zone, but if there is no confirmation, it is usually better to keep watching instead of treating the touch as enough.
==================================================
(6) CONFIRMATION
==================================================
Confirmation is optional, but useful.
The order block marks the important area. The confirmation add-on checks whether price is reacting with enough supporting evidence.
Simple logic
For support confirmation, the script checks whether price is inside or near the support OB and whether enough bullish confirmation conditions are active.
For resistance confirmation, it checks the opposite side.
The confirmation engine can include:
==================================================
(7) ALERTS
==================================================
The alert conditions can be grouped into three simple types.
1) Zone reached alerts
These alerts tell you price has reached a support or resistance OB zone.
This means the area is active, but confirmation may not be present yet.
2) Zone reached + confirmation alerts
These alerts tell you price reached the zone and confirmation conditions are active.
This is the stronger alert type, but it is still only a chart condition.
3) Confirmation only / any event alerts
These alerts are broader monitoring alerts. They are useful when you want to know that a support or resistance event is happening, even if you do not want a very specific alert.
Pine Script®
==================================================
(8) HOW THE MODEL IS CALCULATED
==================================================
1. Zone Score
Pine Script®
The score combines several pieces of zone quality, including displacement strength, structure break, trend alignment, candle body expansion, volume expansion, premium/discount location, pivot confluence, market bias, and observed edge.
2. Quality Grade
Pine Script®
The raw score is converted into A++, A, B+, B, or C.
3. Zone Status
Pine Script®
The status depends on whether price has touched or invalidated the zone.
4. Observed Rate
Pine Script®
This combines how often zones are revisited and how often resolved zones reach the model target before invalidation.
5. Target Rate
Pine Script®
This measures resolved zones only.
6. Touch Rate
Pine Script®
This measures how often detected zones were revisited by price.
7. Reward/Risk Ratio
Pine Script®
This is based on the ATR target and invalidation settings.
8. Edge
Pine Script®
This estimates whether the observed target/invalidation behavior is positive, neutral, or weak.
9. Confidence
Pine Script®
Confidence adjusts how much trust is placed on the observed stats. Low sample size means lower confidence.
10. Final Model Rating
Pine Script®
This creates the final label rating from 1 to 10.
==================================================
(9) IMPORTANT LIMITATIONS
==================================================
This script does not know the future. It only evaluates chart conditions using its internal rules.
Observed stats can be unreliable when there are not enough resolved examples. A label can show useful context, but it should not be treated as proof that the next zone will work.
Order blocks can fail during strong trends, news events, low-liquidity conditions, or when broader market structure changes.
==================================================
DISCLAIMER
==================================================
This script is a public open-source indicator for educational and informational use.
It is not financial advice, investment advice, or a recommendation to buy or sell any asset.
The script identifies order-block-style chart zones and confirmation conditions only. It does not guarantee profitable trades, signal accuracy, or future performance.
Users should always apply their own analysis, position sizing, and risk management before making any trading decision.
It is designed to answer three simple questions:
- Where is the order-block zone?
- How strong is the zone based on the model?
- Is price only touching it, or is confirmation also active?
The goal is not to give automatic trade calls. The goal is to make order-block zones easier to read, compare, and monitor.
==================================================
WARNING
==================================================
This indicator is a chart-reading tool. It does not predict the future and does not guarantee that any order block will hold.
The labels, scores, observed stats, and confirmation markers are based on the script's internal model and the available chart data. They should be used as context, not as financial advice or as standalone buy/sell instructions.
A zone can look strong and still fail. Always check the broader trend, market structure, liquidity, news risk, and your own risk management.
==================================================
(1) OVERVIEW
==================================================
This indicator has two main parts.
1) Order-block zone detection
The script detects bullish and bearish order-block-style zones.
- Support OB - a bullish order-block zone that may act as support.
- Resistance OB - a bearish order-block zone that may act as resistance.
The zone logic uses several chart conditions together, including:
- swing highs and swing lows
- the last opposite candle before a displacement move
- ATR-based displacement strength
- EMA trend alignment
- premium / discount location
- pivot support or resistance confluence
- body expansion and relative volume
- current market bias
2) Confirmation add-on
The confirmation layer checks whether price is simply reaching the zone or whether the reaction is supported by additional conditions.
It can use:
- fast EMA position
- fast EMA direction
- RSI behavior
- MACD behavior
- candle direction
- relative volume
The box shows where the zone is. The label explains the zone quality. The triangle shows that confirmation conditions are active.
==================================================
(2) WHAT YOU SEE ON THE CHART
==================================================
- Boxes - active support or resistance OB zones.
- Labels - zone type, grade, status, observed behavior, edge class, and model rating.
- Triangles - confirmation conditions after price reaches or approaches a zone.
- Faded zones - historical or invalidated zones kept for visual context.
- Midline - the center of the zone, useful for reading depth of reaction.
The indicator is designed to keep the latest active zones visible and reduce chart clutter by limiting how many zones and labels remain on the chart.
==================================================
(3) HOW TO USE IT PROPERLY
==================================================
The correct way to use this indicator is to read the zone step by step, not only look at the box.
Simple workflow
- Find the zone.
Check whether price is reacting around a support OB or resistance OB. - Read the label.
The label explains the model grade, zone status, observed behavior, edge class, and final model rating. - Check the status.
Fresh zones are usually cleaner than tested zones. Broken zones should not be treated as active zones. - Wait for reaction quality.
A zone touch alone is only the first step. Confirmation adds evidence that price is reacting. - Use the triangle as confirmation context.
A triangle means the confirmation engine found enough supporting conditions. It is not a guaranteed entry. - Check broader market structure.
Use the indicator together with trend, support/resistance, liquidity, and risk management.
The best reading comes when the zone type, label quality, status, confirmation, and broader market structure all support the same idea.
==================================================
(4) LABEL EXPLANATION
==================================================
A label may look like this:
Support OB / Resistance OB
This tells you the zone type.
- Support OB - bullish order-block zone, treated as possible support.
- Resistance OB - bearish order-block zone, treated as possible resistance.
Grade
The grade summarizes the internal zone score.
- A++ - 86 or higher
- A - 72 to 85.99
- B+ - 60 to 71.99
- B - 48 to 59.99
- C - below 48
A++ and A are stronger model grades. B+ is acceptable. B and C are weaker.
Status
The status explains the current condition of the zone.
- Fresh - price has not touched the zone yet.
- Tested - price already touched the zone.
- Broken - price invalidated the zone.
Fresh is usually cleaner than tested. Broken means the zone is no longer active.
Observed
Observed shows the script's chart-based observation for that side of the model. It combines how often zones were touched and how often resolved zones reached the model target before invalidation.
This is not a guaranteed win rate. It depends on available chart history and the number of resolved examples.
Edge
Edge classifies the model's observed reward/risk behavior into simple language:
- Weak
- Slightly Weak
- Neutral
- Strong
- Very Strong
This is based on observed target/invalidation behavior, ATR-based target and invalidation distances, and confidence from sample size.
Model
Model is the final combined rating from 1 to 10.
It combines:
- zone grade
- zone status
- observed behavior
- edge class
- confidence from available outcomes
A practical reading:
- 8 to 10 - stronger model reading
- 6 to 7.9 - decent model reading
- 4 to 5.9 - average or weaker reading
- below 4 - low-quality reading
==================================================
(5) PRACTICAL LABEL EXAMPLES
==================================================
Example 1
This is a stronger support-zone reading. If price returns and confirmation appears, the reaction has better model support.
Example 2
This is a watchlist-quality resistance zone. It may be useful, but it is not as strong unless confirmation appears.
Example 3
The grade is strong, but the zone has already been tested. It can still matter, but it is less clean than a fresh zone.
Example 4
This is a weak model reading. Even if price reaches it, it should not be trusted alone.
Example 5
This is a decent zone, but if there is no confirmation, it is usually better to keep watching instead of treating the touch as enough.
==================================================
(6) CONFIRMATION
==================================================
Confirmation is optional, but useful.
The order block marks the important area. The confirmation add-on checks whether price is reacting with enough supporting evidence.
Simple logic
- OB zone = where price may react.
- Label = how good the zone looks according to the model.
- Triangle = confirmation conditions are active.
For support confirmation, the script checks whether price is inside or near the support OB and whether enough bullish confirmation conditions are active.
For resistance confirmation, it checks the opposite side.
The confirmation engine can include:
- EMA position
- EMA direction
- RSI behavior
- MACD behavior
- candle behavior
- relative volume
A zone touch starts the observation. Confirmation adds extra evidence that the reaction may be developing.
==================================================
(7) ALERTS
==================================================
The alert conditions can be grouped into three simple types.
1) Zone reached alerts
These alerts tell you price has reached a support or resistance OB zone.
This means the area is active, but confirmation may not be present yet.
2) Zone reached + confirmation alerts
These alerts tell you price reached the zone and confirmation conditions are active.
This is the stronger alert type, but it is still only a chart condition.
3) Confirmation only / any event alerts
These alerts are broader monitoring alerts. They are useful when you want to know that a support or resistance event is happening, even if you do not want a very specific alert.
Alerts are monitoring tools. They are not trade instructions and do not guarantee a result.
==================================================
(8) HOW THE MODEL IS CALCULATED
==================================================
1. Zone Score
The score combines several pieces of zone quality, including displacement strength, structure break, trend alignment, candle body expansion, volume expansion, premium/discount location, pivot confluence, market bias, and observed edge.
2. Quality Grade
The raw score is converted into A++, A, B+, B, or C.
3. Zone Status
The status depends on whether price has touched or invalidated the zone.
4. Observed Rate
This combines how often zones are revisited and how often resolved zones reach the model target before invalidation.
5. Target Rate
This measures resolved zones only.
6. Touch Rate
This measures how often detected zones were revisited by price.
7. Reward/Risk Ratio
This is based on the ATR target and invalidation settings.
8. Edge
This estimates whether the observed target/invalidation behavior is positive, neutral, or weak.
9. Confidence
Confidence adjusts how much trust is placed on the observed stats. Low sample size means lower confidence.
10. Final Model Rating
This creates the final label rating from 1 to 10.
==================================================
(9) IMPORTANT LIMITATIONS
==================================================
This script does not know the future. It only evaluates chart conditions using its internal rules.
Observed stats can be unreliable when there are not enough resolved examples. A label can show useful context, but it should not be treated as proof that the next zone will work.
Order blocks can fail during strong trends, news events, low-liquidity conditions, or when broader market structure changes.
Use the model rating as context, not certainty.
==================================================
DISCLAIMER
==================================================
This script is a public open-source indicator for educational and informational use.
It is not financial advice, investment advice, or a recommendation to buy or sell any asset.
The script identifies order-block-style chart zones and confirmation conditions only. It does not guarantee profitable trades, signal accuracy, or future performance.
Users should always apply their own analysis, position sizing, and risk management before making any trading decision.
Release Notes
Order Block Zone Study + Confirmation — Updated OLR Label SystemThis update focuses on making the Order Block labels easier to read and more useful directly on the chart.
The previous label included several mixed terms such as Grade, Status, Observed, Edge, and Model.
In this version, the label was simplified and rebuilt around a clearer scoring model called OLR.
What changed?
- The old label structure was replaced with a cleaner OLR label.
- The label now focuses on three key parts: Origin, Location, and Reaction.
- Each part is scored from 0 to 10.
- The final OLR Score is shown from 0 to 30.
- The score weights can now be adjusted in the settings.
- More detailed GUI tooltips were added to explain the inputs and help users understand what each setting does.
O = Origin
Origin measures how strongly the Order Block was created.
It looks at the impulse move after the source candle, displacement strength, candle body strength, volume, and whether price made a clear break.
If Origin is high, it means the OB was created from a stronger price move.
This does not mean price must react again, but it shows that the zone came from stronger market activity.
L = Location
Location measures where the Order Block sits on the chart.
It checks whether the zone is placed in a meaningful area, such as premium/discount, near pivot support or resistance, aligned with trend, and aligned with market bias.
If Location is high, it means the OB is positioned in a better technical area.
A strong Origin with poor Location can still be less useful, because the zone may not be in the best chart context.
R = Reaction
Reaction measures how price behaved after returning to the Order Block.
A fresh OB starts neutral because price has not fully tested it yet.
If price respects the zone, Reaction can improve. If price moves deeply through the zone or invalidates it, Reaction becomes weaker.
If Reaction is high, it means price has interacted with the zone in a stronger way.
If Reaction is low, it usually means the zone was weakened, failed, or did not react well.
OLR Score
The OLR Score combines Origin, Location, and Reaction into one final score from 0 to 30.
- 0–8 = Weak
- 9–15 = Moderate
- 16–22 = Good
- 23–30 = Strong
If the OLR Score is high, it means the Order Block has stronger overall conditions across creation quality, chart location, and price reaction.
The OLR Score is not a buy or sell signal. It is a quick way to compare Order Block zones and understand their condition more clearly.
How to use the label
First, check whether the label is a Support OB or Resistance OB.
Then read O, L, and R to understand why the final OLR Score is high or low.
- High Origin = the zone was created by a strong move.
- High Location = the zone is placed in a better technical area.
- High Reaction = price respected or reacted well to the zone.
- High OLR Score = the OB has stronger overall conditions.
The label is designed to help users read zones faster, compare multiple OBs more easily, and understand which zones have better structure.
New GUI improvements
A new OB Rating section was added to the settings.
Users can now adjust how much each part affects the final OLR Score:
- Origin weight — controls how much the creation strength affects the final score.
- Location weight — controls how much the chart position affects the final score.
- Reaction weight — controls how much the price reaction affects the final score.
Additional tooltips were also added across the settings to explain the purpose, range, and practical use of the inputs.
This should make the indicator easier to adjust without guessing what each parameter does.
Important note
This indicator is a chart study and confirmation tool.
The OLR Score helps evaluate Order Block conditions, but it does not guarantee future price movement and should not be treated as a standalone trading signal.
If you find this useful, feel free to follow so you do not miss future updates. I still have more indicators and older tools that I plan to publish or improve over time.
Release Notes
Release Notes
- Updated indicator title/shorttitle to v1.1
- Added Show score class in labels
- Now labels can show Weak / Moderate / Good / Strong
- Cleaned label text from OLR Score to Score
- Standardized alert titles/messages spacing
- Left the OB detection, scoring, and confirmation logic unchanged
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.