OPEN-SOURCE SCRIPT
HERTZ Order Block - Active Market Bias & Depletion [5M]

HERTZ Order Block - Active Market Bias & Depletion [5M]
HERTZ Order Block is a market-structure-based Order Block analysis tool designed primarily for short-term cryptocurrency charts, with a particular focus on 5-minute analysis.
The indicator does not treat every opposite-colored candle as an Order Block. Instead, an Order Block can only be created after a confirmed structural event and a qualifying displacement move. The script then evaluates the resulting zone using multiple contextual factors, including displacement strength, candle structure, optional Fair Value Gap confirmation, optional candle-pattern confirmation, volume expansion, liquidity sweep context, zone size, age, retests, nearby opposing Order Blocks, and repeated-use depletion.
The purpose of the script is not to predict the next candle or guarantee a reversal. Its purpose is to identify structurally relevant Order Block zones, track how price interacts with them over time, rank their current importance, and summarize the balance between active bullish and bearish Order Blocks.
Order Block formation
A bullish Order Block is searched for after a confirmed bullish Break of Structure and bullish displacement. The script looks backward for a qualifying bearish candle that preceded the displacement and uses that candle as the source of the bullish zone.
A bearish Order Block uses the opposite process. After a confirmed bearish Break of Structure and bearish displacement, the script searches backward for a qualifying bullish candle and uses it as the source of the bearish zone.
Depending on the selected zone mode, the Order Block can be constructed from the refined portion of the source candle, its candle body, or its full high-to-low range.
Once an Order Block is created, its original price boundaries are preserved. The zone is not continuously relocated to follow price.
Confirmed lifecycle states
Each active Order Block has a lifecycle. These lifecycle states are primarily updated from confirmed bars so that an unclosed candle does not permanently change the historical state of a zone.
FRESH means that the Order Block has been created and has not yet completed a confirmed retest.
APPROACH means price has moved within the defined ATR-based approach distance of the Order Block.
IN ZONE means a confirmed price bar has interacted with the Order Block.
HOLD means the zone was tested and a later confirmed bar moved away from the zone in the expected direction by the required ATR-based confirmation distance.
These states are used not only for display purposes but also to control which Order Blocks are considered immediately actionable.
Action priority
The indicator separates structural importance from immediate trading relevance.
Structural Score (S) represents the current structural strength of an active Order Block after considering its original quality, displacement characteristics, age, mitigation status, opposing-zone conflict, and repeated-test depletion.
Action Score (A) represents how relevant an Order Block is to the current price interaction.
A distant Order Block is therefore not automatically labeled as the most important trading zone simply because it had a high initial quality score.
Only Order Blocks in the APPROACH or IN ZONE states are eligible for ACTION #1 or ACTION #2.
A FRESH zone that is still too far from current price can remain a RESERVE zone.
A completed HOLD also returns to reserve status rather than continuously encouraging entries after the original reaction has already occurred.
If opposing bullish and bearish actionable zones have similar scores, the indicator can display a WAIT condition instead of presenting a small numerical difference as a meaningful directional advantage.
Conflict-aware Order Blocks
Active bullish and bearish Order Blocks are not evaluated independently.
The script checks whether an opposing Order Block overlaps the current zone or is located close enough to interfere with the expected reaction path.
Strong and nearby opposing zones reduce the structural score of the affected Order Block. Multiple opposing zones can create an additional conflict penalty.
This allows the indicator to distinguish between a structurally isolated Order Block and one that is operating inside a congested bullish/bearish conflict area.
Repeated-test depletion
Order Blocks are not assumed to retain the same strength indefinitely.
A separate retest counter tracks independent interactions with each zone. Multiple consecutive candles remaining inside the same zone are treated as one interaction rather than multiple independent tests.
For another test to be counted, price must first leave the interaction and later return to the Order Block.
The default progressive depletion model is:
T1 - first successful test, no additional depletion.
T2 - moderate structural reduction.
T3 - stronger structural reduction.
T4 - substantial structural reduction.
T5+ - additional progressive depletion up to the configured maximum.
This mechanism is intended to represent the idea that repeatedly tested liquidity or order-flow areas may become less structurally significant as they are revisited.
The depletion values are scoring adjustments. They should not be interpreted as measured probabilities of failure.
Live warnings versus confirmed states
The indicator deliberately separates confirmed lifecycle information from intrabar warnings.
The confirmed state may continue to display HOLD, IN ZONE, or another locked state while the current realtime candle is still open.
AT RISK is a realtime warning that price is approaching the Order Block's invalidation boundary.
LIVE BREAK indicates that the current unconfirmed candle is temporarily trading beyond the relevant invalidation boundary.
These live warnings can appear and disappear while the realtime candle is forming. They do not by themselves rewrite the confirmed lifecycle of the Order Block.
With close-based invalidation, an Order Block is not permanently invalidated until the relevant candle closes beyond the zone boundary.
With wick-based invalidation, the configured wick condition is used instead.
Active Order Block Market Bias panel
The information panel in the upper-right corner summarizes the current balance between active bullish and bearish Order Blocks.
MARKET displays BULLISH, BEARISH, or NEUTRAL.
BULL DOM shows the bullish share of the active Order Block dominance calculation.
BEAR DOM shows the bearish share.
ACTIVE displays the number of active bullish and bearish Order Blocks.
TOP BULL identifies the strongest currently relevant bullish Order Block score and state.
TOP BEAR provides the equivalent information for bearish Order Blocks.
EDGE displays the difference between bullish and bearish dominance.
The market-bias calculation does not simply count bullish and bearish boxes. Each active Order Block is weighted according to its structural or actionable score, lifecycle state, and proximity to price. Conflict and repeated-test depletion are already reflected in the underlying structural evaluation.
An IN ZONE Order Block therefore contributes more immediate contextual importance than a distant and heavily depleted historical Order Block.
The Bull and Bear Dominance percentages are relative Order Block dominance measurements. They are not probabilities that price will rise or fall, and they should not be interpreted as expected win rates.
Scoring terminology
Q represents formation quality based on the qualifying contextual conditions available when the Order Block is identified.
RP is an internal reversal-power score derived from formation quality, Order Block size characteristics, and displacement strength.
S is the current Structural Score.
A is the current Action Score.
T1, T2, T3, etc. represent independent confirmed tests of a previously held Order Block.
ACTION #1 is the highest-ranked currently actionable Order Block.
ACTION #2 is the second-ranked actionable Order Block when available.
RESERVE identifies a structurally relevant zone that is not currently considered an immediate actionable interaction.
WAIT indicates that opposing actionable Order Blocks are sufficiently close in ranking that the script does not assign a meaningful directional advantage.
Intended use
The indicator is designed as a discretionary market-structure and context tool rather than an automated trading strategy.
On a 5-minute cryptocurrency chart, traders can use it to identify active demand and supply areas, observe whether price is approaching or testing those areas, compare opposing Order Block strength, recognize repeatedly tested/depleted zones, and monitor whether active Order Block structure currently favors the bullish side, bearish side, or neither side.
The indicator does not generate orders, calculate position size, or provide a complete risk-management system.
Calculation and repainting considerations
Order Block creation requires confirmed structural conditions. Historical Order Block boundaries are based on already available candle data and are stored when the zone is created.
Confirmed lifecycle transitions such as retests, holds, and close-based invalidations are evaluated using confirmed bars.
The realtime AT RISK and LIVE BREAK warnings are intentionally intrabar and can therefore change before the current candle closes. This behavior is expected and is visually separated from confirmed lifecycle states.
Users should distinguish between a confirmed state and a realtime warning when interpreting the chart.
Limitations
Order Blocks are subjective market-structure concepts and there is no universally accepted mathematical definition of the exact boundaries or validity of an Order Block.
ATR thresholds, structure lookbacks, zone construction methods, displacement requirements, and optional confirmation filters can materially affect which zones are detected.
Cryptocurrency volatility can also change significantly across symbols and market regimes. Settings appropriate for one asset or period may not behave identically on another.
A high Quality, Structural, Action, RP, Bull Dominance, or Bear Dominance value does not guarantee that price will react from a zone.
The indicator does not account for every possible source of market information, including news, fundamental events, exchange-specific liquidity conditions, hidden orders, or external derivatives positioning.
For these reasons, the indicator should be used as one component of a broader analysis and risk-management process rather than as a standalone prediction system.
What is different about this implementation
Instead of displaying every detected Order Block with equal importance, this implementation maintains a lifecycle for each zone and continually differentiates between formation quality, structural relevance, immediate action relevance, opposing-zone conflict, and repeated-use depletion.
Its state-locked FRESH / APPROACH / IN ZONE / HOLD workflow, progressive T1/T2/T3/T4 depletion model, conflict-aware scoring, live-warning separation, and active Order Block dominance panel are designed to reduce visual ambiguity and make the changing condition of each active zone easier to interpret.
Recommended starting context
The default parameters were designed with 5-minute cryptocurrency analysis in mind. They are starting values, not universally optimal settings. Users should evaluate the script on the symbol, timeframe, market conditions, and execution method relevant to their own analysis.
This indicator is provided for analytical and educational purposes. It does not constitute investment advice, does not guarantee future results, and does not claim that any displayed score represents a future return or a statistically guaranteed probability.
HERTZ Order Block is a market-structure-based Order Block analysis tool designed primarily for short-term cryptocurrency charts, with a particular focus on 5-minute analysis.
The indicator does not treat every opposite-colored candle as an Order Block. Instead, an Order Block can only be created after a confirmed structural event and a qualifying displacement move. The script then evaluates the resulting zone using multiple contextual factors, including displacement strength, candle structure, optional Fair Value Gap confirmation, optional candle-pattern confirmation, volume expansion, liquidity sweep context, zone size, age, retests, nearby opposing Order Blocks, and repeated-use depletion.
The purpose of the script is not to predict the next candle or guarantee a reversal. Its purpose is to identify structurally relevant Order Block zones, track how price interacts with them over time, rank their current importance, and summarize the balance between active bullish and bearish Order Blocks.
Order Block formation
A bullish Order Block is searched for after a confirmed bullish Break of Structure and bullish displacement. The script looks backward for a qualifying bearish candle that preceded the displacement and uses that candle as the source of the bullish zone.
A bearish Order Block uses the opposite process. After a confirmed bearish Break of Structure and bearish displacement, the script searches backward for a qualifying bullish candle and uses it as the source of the bearish zone.
Depending on the selected zone mode, the Order Block can be constructed from the refined portion of the source candle, its candle body, or its full high-to-low range.
Once an Order Block is created, its original price boundaries are preserved. The zone is not continuously relocated to follow price.
Confirmed lifecycle states
Each active Order Block has a lifecycle. These lifecycle states are primarily updated from confirmed bars so that an unclosed candle does not permanently change the historical state of a zone.
FRESH means that the Order Block has been created and has not yet completed a confirmed retest.
APPROACH means price has moved within the defined ATR-based approach distance of the Order Block.
IN ZONE means a confirmed price bar has interacted with the Order Block.
HOLD means the zone was tested and a later confirmed bar moved away from the zone in the expected direction by the required ATR-based confirmation distance.
These states are used not only for display purposes but also to control which Order Blocks are considered immediately actionable.
Action priority
The indicator separates structural importance from immediate trading relevance.
Structural Score (S) represents the current structural strength of an active Order Block after considering its original quality, displacement characteristics, age, mitigation status, opposing-zone conflict, and repeated-test depletion.
Action Score (A) represents how relevant an Order Block is to the current price interaction.
A distant Order Block is therefore not automatically labeled as the most important trading zone simply because it had a high initial quality score.
Only Order Blocks in the APPROACH or IN ZONE states are eligible for ACTION #1 or ACTION #2.
A FRESH zone that is still too far from current price can remain a RESERVE zone.
A completed HOLD also returns to reserve status rather than continuously encouraging entries after the original reaction has already occurred.
If opposing bullish and bearish actionable zones have similar scores, the indicator can display a WAIT condition instead of presenting a small numerical difference as a meaningful directional advantage.
Conflict-aware Order Blocks
Active bullish and bearish Order Blocks are not evaluated independently.
The script checks whether an opposing Order Block overlaps the current zone or is located close enough to interfere with the expected reaction path.
Strong and nearby opposing zones reduce the structural score of the affected Order Block. Multiple opposing zones can create an additional conflict penalty.
This allows the indicator to distinguish between a structurally isolated Order Block and one that is operating inside a congested bullish/bearish conflict area.
Repeated-test depletion
Order Blocks are not assumed to retain the same strength indefinitely.
A separate retest counter tracks independent interactions with each zone. Multiple consecutive candles remaining inside the same zone are treated as one interaction rather than multiple independent tests.
For another test to be counted, price must first leave the interaction and later return to the Order Block.
The default progressive depletion model is:
T1 - first successful test, no additional depletion.
T2 - moderate structural reduction.
T3 - stronger structural reduction.
T4 - substantial structural reduction.
T5+ - additional progressive depletion up to the configured maximum.
This mechanism is intended to represent the idea that repeatedly tested liquidity or order-flow areas may become less structurally significant as they are revisited.
The depletion values are scoring adjustments. They should not be interpreted as measured probabilities of failure.
Live warnings versus confirmed states
The indicator deliberately separates confirmed lifecycle information from intrabar warnings.
The confirmed state may continue to display HOLD, IN ZONE, or another locked state while the current realtime candle is still open.
AT RISK is a realtime warning that price is approaching the Order Block's invalidation boundary.
LIVE BREAK indicates that the current unconfirmed candle is temporarily trading beyond the relevant invalidation boundary.
These live warnings can appear and disappear while the realtime candle is forming. They do not by themselves rewrite the confirmed lifecycle of the Order Block.
With close-based invalidation, an Order Block is not permanently invalidated until the relevant candle closes beyond the zone boundary.
With wick-based invalidation, the configured wick condition is used instead.
Active Order Block Market Bias panel
The information panel in the upper-right corner summarizes the current balance between active bullish and bearish Order Blocks.
MARKET displays BULLISH, BEARISH, or NEUTRAL.
BULL DOM shows the bullish share of the active Order Block dominance calculation.
BEAR DOM shows the bearish share.
ACTIVE displays the number of active bullish and bearish Order Blocks.
TOP BULL identifies the strongest currently relevant bullish Order Block score and state.
TOP BEAR provides the equivalent information for bearish Order Blocks.
EDGE displays the difference between bullish and bearish dominance.
The market-bias calculation does not simply count bullish and bearish boxes. Each active Order Block is weighted according to its structural or actionable score, lifecycle state, and proximity to price. Conflict and repeated-test depletion are already reflected in the underlying structural evaluation.
An IN ZONE Order Block therefore contributes more immediate contextual importance than a distant and heavily depleted historical Order Block.
The Bull and Bear Dominance percentages are relative Order Block dominance measurements. They are not probabilities that price will rise or fall, and they should not be interpreted as expected win rates.
Scoring terminology
Q represents formation quality based on the qualifying contextual conditions available when the Order Block is identified.
RP is an internal reversal-power score derived from formation quality, Order Block size characteristics, and displacement strength.
S is the current Structural Score.
A is the current Action Score.
T1, T2, T3, etc. represent independent confirmed tests of a previously held Order Block.
ACTION #1 is the highest-ranked currently actionable Order Block.
ACTION #2 is the second-ranked actionable Order Block when available.
RESERVE identifies a structurally relevant zone that is not currently considered an immediate actionable interaction.
WAIT indicates that opposing actionable Order Blocks are sufficiently close in ranking that the script does not assign a meaningful directional advantage.
Intended use
The indicator is designed as a discretionary market-structure and context tool rather than an automated trading strategy.
On a 5-minute cryptocurrency chart, traders can use it to identify active demand and supply areas, observe whether price is approaching or testing those areas, compare opposing Order Block strength, recognize repeatedly tested/depleted zones, and monitor whether active Order Block structure currently favors the bullish side, bearish side, or neither side.
The indicator does not generate orders, calculate position size, or provide a complete risk-management system.
Calculation and repainting considerations
Order Block creation requires confirmed structural conditions. Historical Order Block boundaries are based on already available candle data and are stored when the zone is created.
Confirmed lifecycle transitions such as retests, holds, and close-based invalidations are evaluated using confirmed bars.
The realtime AT RISK and LIVE BREAK warnings are intentionally intrabar and can therefore change before the current candle closes. This behavior is expected and is visually separated from confirmed lifecycle states.
Users should distinguish between a confirmed state and a realtime warning when interpreting the chart.
Limitations
Order Blocks are subjective market-structure concepts and there is no universally accepted mathematical definition of the exact boundaries or validity of an Order Block.
ATR thresholds, structure lookbacks, zone construction methods, displacement requirements, and optional confirmation filters can materially affect which zones are detected.
Cryptocurrency volatility can also change significantly across symbols and market regimes. Settings appropriate for one asset or period may not behave identically on another.
A high Quality, Structural, Action, RP, Bull Dominance, or Bear Dominance value does not guarantee that price will react from a zone.
The indicator does not account for every possible source of market information, including news, fundamental events, exchange-specific liquidity conditions, hidden orders, or external derivatives positioning.
For these reasons, the indicator should be used as one component of a broader analysis and risk-management process rather than as a standalone prediction system.
What is different about this implementation
Instead of displaying every detected Order Block with equal importance, this implementation maintains a lifecycle for each zone and continually differentiates between formation quality, structural relevance, immediate action relevance, opposing-zone conflict, and repeated-use depletion.
Its state-locked FRESH / APPROACH / IN ZONE / HOLD workflow, progressive T1/T2/T3/T4 depletion model, conflict-aware scoring, live-warning separation, and active Order Block dominance panel are designed to reduce visual ambiguity and make the changing condition of each active zone easier to interpret.
Recommended starting context
The default parameters were designed with 5-minute cryptocurrency analysis in mind. They are starting values, not universally optimal settings. Users should evaluate the script on the symbol, timeframe, market conditions, and execution method relevant to their own analysis.
This indicator is provided for analytical and educational purposes. It does not constitute investment advice, does not guarantee future results, and does not claim that any displayed score represents a future return or a statistically guaranteed probability.
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน