OPEN-SOURCE SCRIPT
Edo Order Blocks

Edo Order Blocks — Displacement-Detected Order Blocks Scored 0-100, with Active / Tested / Mitigated States and a Strongest-Block Panel



An order block is the last opposite candle before an impulse that breaks away from a level — the last bearish candle before a sharp move up, or the last bullish candle before a sharp move down. In the Smart Money Concepts approach, that candle marks a zone where institutional activity was left unfilled, so when price returns to it, it becomes a natural reference of supply or demand. The problem with most order block tools is that they draw every zone, cluttering the chart with references that never mattered. Edo Order Blocks takes the opposite approach: it scores each zone and draws only the ones that earn it.
Edo Order Blocks detects order blocks by displacement, scores each one from 0 to 100 on objective quality factors, filters out the weak ones, and tracks every surviving zone through its full life — from Active to Tested to Mitigated. Everything is validated on closed bars, so the indicator does not repaint. It is the order-block specialist of the Edolab structure family, designed to pair with Edo Smart Money Map, which maps the BOS / CHoCH structure around these zones.
DISPLACEMENT DETECTION
A new order block is triggered by a displacement: a confirmed candle that closes beyond the highest high (bullish) or lowest low (bearish) of the last N bars, in the direction of its own body. The Displacement Lookback input (10 by default) sets how many bars define that range. This impulse-based trigger captures the moment price breaks away with conviction, which is precisely when an order block is left behind. From the impulse, the indicator looks back up to the Origin Lookback (15 by default) to find the last opposite candle — the origin of the move — and draws the zone between its high and low.
THE QUALITY SCORE
Every candidate order block is scored from 0 to 100 before it is drawn, combining four objective factors: body strength (the candle's body relative to ATR), volume strength (volume relative to its 20-period average), displacement strength (how far the close pushed beyond the range, in ATR units), and trend alignment (whether the block sits on the right side of the EMA 50). Body and volume weigh 30% each, displacement and trend alignment 20% each. The Minimum Score input (40 by default) acts as a filter: only blocks that score at or above it ever reach the chart. Raise it to keep only the highest-conviction zones; lower it to see more. The score is printed on each block's label, so its quality is visible at a glance.
ORDER BLOCKS AND THEIR LIFE
Each drawn zone is a box between the high and low of the origin candle, labelled Bull OB or Bear OB with its score, extended to the right as a live reference. To keep the chart clean, only the most recent blocks per side are kept, up to Max Order Blocks per side (8 by default); older ones are removed as new ones appear.
THREE STATES: ACTIVE, TESTED, MITIGATED
Unlike a simple active/used flag, Edo Order Blocks tracks three states, evaluated on every closed bar. Active: a fresh zone price has not touched since creation — a solid box extending to the right. Tested: price has tapped the zone but not closed through it — the border turns solid and bold, marking that the zone has been challenged and held. Mitigated: price has closed through the zone — the box turns dashed, fades and stops extending, recording that the zone has been consumed. The Touch Mode input decides what counts as a test: Wick (default) marks it as soon as a wick reaches the zone, while Close requires a candle to close inside it. A bullish block is mitigated when price closes below its base; a bearish block, when price closes above its top. Each transition fires its own alert.
INFORMATION PANEL
The panel condenses the read into a compact table. It shows the number of active order blocks on each side, the Strongest OB — the highest-scoring active block, with its side, score and price level — and the active Minimum Score filter. The Strongest OB row is the quickest way to find the single zone the indicator rates highest right now. The panel sits in any of the four chart corners (Top Right by default), comes in three sizes (Tiny / Small / Normal) and two themes (Dark / Light), and can be hidden entirely.
NO REPAINTING
Displacement is validated on closed bars only, using the highest/lowest of completed candles offset by one bar, so a zone never appears or disappears intrabar. A wick that pierces a level but closes back inside generates nothing — the indicator waits for the close. This removes the false zones that clutter tools which react instantly, at the cost of confirming each block once the impulse has completed. There are no higher-timeframe functions: all logic runs on the current chart timeframe.
CONFIGURATION
The inputs are grouped by block. Detection sets the displacement lookback, the origin lookback and the minimum score. Order Blocks sets the maximum per side and the touch mode (Wick / Close). Style exposes the bull and bear colours, the zone opacity, whether the score is shown on the label, the label size and the Dark/Light theme. Panel controls panel visibility, position and size. The defaults are calibrated to work without adjustment on stocks, crypto, forex, indices and futures, on any timeframe — the only input most users tune is the Minimum Score, to make the indicator more or less selective.
ALERTS
Six predefined alerts cover the full life of a zone: New Bull OB and New Bear OB fire when a fresh order block above the score threshold is created; Bull OB Tested and Bear OB Tested fire when price first taps a zone; and Bull OB Mitigated and Bear OB Mitigated fire when price closes through a zone and consumes it. The new-block alerts flag fresh references, the tested alerts fire exactly when a zone is challenged, and the mitigation alerts mark when a reference is spent. All alerts fire on bar close, consistent with the indicator's anti-repaint validation.
HOW TO READ IT
A clean reading uses the score and the states together. High-score zones are the references worth watching: a Bull OB scored 80 sits on a strong-bodied, high-volume, trend-aligned impulse, a far more reliable demand zone than one scored 45. Watch the Active-to-Tested transition: when price returns to an active block and taps it, the zone is being challenged — the bold border marks the moment of reaction. A Tested block that holds and sends price away keeps its relevance; a Mitigated one has been consumed and steps aside. The Strongest OB panel row points to the single best active zone at any time, and pairing Edo Order Blocks with Edo Smart Money Map places these scored zones inside the broader BOS / CHoCH structure for full context.
OPEN SOURCE
Edo Order Blocks is published as a free open source indicator. The full Pine Script is publicly accessible on TradingView for study, adaptation and integration into any workflow. Part of the Edolab Markets free tools ecosystem alongside Edo Smart Money Map, Edo Liquidity Zones, Edo ZigZag Auto Fib SR, Edo Multi Stoch and more available on TradingView.
This indicator is a technical analysis tool for educational and informational purposes only. It does not generate automatic buy or sell signals and should not be considered financial advice. Trading financial markets involves significant risk of capital loss. Past performance does not guarantee future results. Always use proper risk management.
An order block is the last opposite candle before an impulse that breaks away from a level — the last bearish candle before a sharp move up, or the last bullish candle before a sharp move down. In the Smart Money Concepts approach, that candle marks a zone where institutional activity was left unfilled, so when price returns to it, it becomes a natural reference of supply or demand. The problem with most order block tools is that they draw every zone, cluttering the chart with references that never mattered. Edo Order Blocks takes the opposite approach: it scores each zone and draws only the ones that earn it.
Edo Order Blocks detects order blocks by displacement, scores each one from 0 to 100 on objective quality factors, filters out the weak ones, and tracks every surviving zone through its full life — from Active to Tested to Mitigated. Everything is validated on closed bars, so the indicator does not repaint. It is the order-block specialist of the Edolab structure family, designed to pair with Edo Smart Money Map, which maps the BOS / CHoCH structure around these zones.
DISPLACEMENT DETECTION
A new order block is triggered by a displacement: a confirmed candle that closes beyond the highest high (bullish) or lowest low (bearish) of the last N bars, in the direction of its own body. The Displacement Lookback input (10 by default) sets how many bars define that range. This impulse-based trigger captures the moment price breaks away with conviction, which is precisely when an order block is left behind. From the impulse, the indicator looks back up to the Origin Lookback (15 by default) to find the last opposite candle — the origin of the move — and draws the zone between its high and low.
THE QUALITY SCORE
Every candidate order block is scored from 0 to 100 before it is drawn, combining four objective factors: body strength (the candle's body relative to ATR), volume strength (volume relative to its 20-period average), displacement strength (how far the close pushed beyond the range, in ATR units), and trend alignment (whether the block sits on the right side of the EMA 50). Body and volume weigh 30% each, displacement and trend alignment 20% each. The Minimum Score input (40 by default) acts as a filter: only blocks that score at or above it ever reach the chart. Raise it to keep only the highest-conviction zones; lower it to see more. The score is printed on each block's label, so its quality is visible at a glance.
ORDER BLOCKS AND THEIR LIFE
Each drawn zone is a box between the high and low of the origin candle, labelled Bull OB or Bear OB with its score, extended to the right as a live reference. To keep the chart clean, only the most recent blocks per side are kept, up to Max Order Blocks per side (8 by default); older ones are removed as new ones appear.
THREE STATES: ACTIVE, TESTED, MITIGATED
Unlike a simple active/used flag, Edo Order Blocks tracks three states, evaluated on every closed bar. Active: a fresh zone price has not touched since creation — a solid box extending to the right. Tested: price has tapped the zone but not closed through it — the border turns solid and bold, marking that the zone has been challenged and held. Mitigated: price has closed through the zone — the box turns dashed, fades and stops extending, recording that the zone has been consumed. The Touch Mode input decides what counts as a test: Wick (default) marks it as soon as a wick reaches the zone, while Close requires a candle to close inside it. A bullish block is mitigated when price closes below its base; a bearish block, when price closes above its top. Each transition fires its own alert.
INFORMATION PANEL
The panel condenses the read into a compact table. It shows the number of active order blocks on each side, the Strongest OB — the highest-scoring active block, with its side, score and price level — and the active Minimum Score filter. The Strongest OB row is the quickest way to find the single zone the indicator rates highest right now. The panel sits in any of the four chart corners (Top Right by default), comes in three sizes (Tiny / Small / Normal) and two themes (Dark / Light), and can be hidden entirely.
NO REPAINTING
Displacement is validated on closed bars only, using the highest/lowest of completed candles offset by one bar, so a zone never appears or disappears intrabar. A wick that pierces a level but closes back inside generates nothing — the indicator waits for the close. This removes the false zones that clutter tools which react instantly, at the cost of confirming each block once the impulse has completed. There are no higher-timeframe functions: all logic runs on the current chart timeframe.
CONFIGURATION
The inputs are grouped by block. Detection sets the displacement lookback, the origin lookback and the minimum score. Order Blocks sets the maximum per side and the touch mode (Wick / Close). Style exposes the bull and bear colours, the zone opacity, whether the score is shown on the label, the label size and the Dark/Light theme. Panel controls panel visibility, position and size. The defaults are calibrated to work without adjustment on stocks, crypto, forex, indices and futures, on any timeframe — the only input most users tune is the Minimum Score, to make the indicator more or less selective.
ALERTS
Six predefined alerts cover the full life of a zone: New Bull OB and New Bear OB fire when a fresh order block above the score threshold is created; Bull OB Tested and Bear OB Tested fire when price first taps a zone; and Bull OB Mitigated and Bear OB Mitigated fire when price closes through a zone and consumes it. The new-block alerts flag fresh references, the tested alerts fire exactly when a zone is challenged, and the mitigation alerts mark when a reference is spent. All alerts fire on bar close, consistent with the indicator's anti-repaint validation.
HOW TO READ IT
A clean reading uses the score and the states together. High-score zones are the references worth watching: a Bull OB scored 80 sits on a strong-bodied, high-volume, trend-aligned impulse, a far more reliable demand zone than one scored 45. Watch the Active-to-Tested transition: when price returns to an active block and taps it, the zone is being challenged — the bold border marks the moment of reaction. A Tested block that holds and sends price away keeps its relevance; a Mitigated one has been consumed and steps aside. The Strongest OB panel row points to the single best active zone at any time, and pairing Edo Order Blocks with Edo Smart Money Map places these scored zones inside the broader BOS / CHoCH structure for full context.
OPEN SOURCE
Edo Order Blocks is published as a free open source indicator. The full Pine Script is publicly accessible on TradingView for study, adaptation and integration into any workflow. Part of the Edolab Markets free tools ecosystem alongside Edo Smart Money Map, Edo Liquidity Zones, Edo ZigZag Auto Fib SR, Edo Multi Stoch and more available on TradingView.
This indicator is a technical analysis tool for educational and informational purposes only. It does not generate automatic buy or sell signals and should not be considered financial advice. Trading financial markets involves significant risk of capital loss. Past performance does not guarantee future results. Always use proper risk management.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
EdoLab Markets – Precision Trading Tools
Get Exclusive Indicators:
edolab.io
All content provided is for informational and educational purposes only. Past performance does not guarantee future results.
Get Exclusive Indicators:
edolab.io
All content provided is for informational and educational purposes only. Past performance does not guarantee future results.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
EdoLab Markets – Precision Trading Tools
Get Exclusive Indicators:
edolab.io
All content provided is for informational and educational purposes only. Past performance does not guarantee future results.
Get Exclusive Indicators:
edolab.io
All content provided is for informational and educational purposes only. Past performance does not guarantee future results.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.