Order Block Matrix [JOAT]

Order Block Matrix is an open-source market structure map built around order blocks. It reads the swings, marks every break of structure, and at each break goes back into the leg that did the breaking to find the candle at its swing extreme. That block is then scored from 0 to 100, split into a bought and a sold share, and followed for the rest of its life: fresh, tested, violated, and finally flipped into a breaker.
Everything a block knows is written on it. The right-edge tag reads like "OB 81 · 62% buy · 1.4 ATR", and a second line "tested 2x" appears once price has come back to it. Two thin bars inside the block show its candle's bought and sold share at a glance. Around the blocks the chart carries the rest of the structure picture: BOS / CHoCH / MSS tags, equal highs and lows, liquidity sweeps, a premium / discount gradient over the current dealing range, and candles painted by the major bias. A compact dashboard sums it up and ends in a 0-100 confluence score whose formula is written out below.
It draws structure, zones and scores only. There are no trade signals in it.
Core Concepts
1. Two layers of structure
Major swings come from an ATR-adaptive zigzag: a swing high is confirmed once price has fallen from it by 1.8 x ATR(14) (adjustable), so the swings stretch in fast markets and tighten in quiet ones. A fixed pivot window is available instead. Minor swings come from a small pivot window (4 bars on each side by default).
A close beyond the latest swing is a break. A break in the direction of the current bias is a BOS. A break against it is a CHoCH, and a CHoCH closed by a displacement candle (body at least 55% of its range and at least 1.2 ATR) is tagged MSS. Major breaks are drawn as solid lines from the broken pivot to the breaking candle with a filled tag. Minor breaks are dashed with smaller iBOS / iCHoCH tags. In Live mode only the newest 6 of each stay on the chart.
2. Finding the block at the structural extreme
At each major break (optionally at minor breaks as well) the search window runs from the swing extreme that launched the breaking leg, with three bars of slack, up to the break. Inside it the indicator picks the most extreme opposite-colour candle: the lowest bear candle for a bullish break, the highest bull candle for a bearish one. Candles wider than 2.5 ATR or with a body under 20% of their range are skipped, and an optional filter asks for above-average volume. The block spans that candle's high to low.
If a new block covers at least half of an existing block on the same side, only the higher-scoring one is kept, so the map never stacks duplicates.
3. The block score (0-100)
Pine Script®
The tooltip on every tag shows the four parts.
4. The volumetric split
Each block's candle is split by where it closed inside its own range: a close at the top is 100% bought, at the bottom 100% sold. Two bars sit inside the block outline: the bought share in the bull colour (upper bar) and the sold share in the bear colour (lower bar). Each bar is as long as its share of the block's width, so a block whose candle closed well off its low shows a long bull bar even when the candle itself was red.
5. Block life: tested, violated, breaker, MB
Every return of price into a block counts as one visit, and the tag gains a second line "tested 1x", "tested 2x" and so on. A block dies when a candle closes beyond its far edge (or wicks beyond it, if you choose Wick). A dead block flips role and becomes a breaker: dashed border in the opposite colour, tag "BRK 74" carrying the score of the block it was. A breaker dies when price closes back through it. After a major BOS, the first block built on that side is tagged MB (mitigation block) instead of OB.
6. Liquidity: equal highs / lows and sweeps
Two swing highs (or lows) within 0.15 ATR of each other, with no candle beyond them in between, are equal highs (EQH) or equal lows (EQL). The dotted line keeps running to the live bar while the level is untouched. When price trades through it, the line ends at that bar, dims and loses its text. A sweep (X) is a candle whose wick runs through an unbroken swing high or low and closes back inside, with a wick of at least 0.6 ATR and 35% of the candle.
7. Premium / discount
The dealing range runs from the latest major swing high to the latest major swing low, each extended by any new extreme since. Its equilibrium is either the AVWAP anchored at the start of the range or the plain midpoint. The premium half is shaded in the bear colour and the discount half in the bull colour, both deepening toward the range edges, with "Premium", "Discount" and the EQ level tagged at the right edge.
8. The confluence score (0-100)
The dashboard's last row reads the current bar toward the major bias (the minor bias when there is no major one yet):
Pine Script®
It measures how many parts of the map line up at the current bar. It is a description of the map, not a forecast.
Features
Input Parameters
General:
Market structure:
Order blocks:
Breakers and mitigation blocks:
Liquidity:
Premium / discount:
Higher-timeframe levels:
Confluence score:
Dashboard:
How to Use This Indicator
Give it room on the right
The blocks, breakers and gradient end 8 bars right of the last candle and their tags start there. A right margin of about 40 bars keeps every tag on screen.
Reading a block
The colour tells the side, the number is the score, the percentage is the bought share of the block candle, and the ATR figure is its height. A block with a high score, a strong bought share on a bull block (or sold share on a bear block) and no visits yet is the cleanest kind. "tested 3x" means price has already used it three times.
Reading the context
Read the bias from the candle colour and the last major tag, then check which half of the dealing range price is in. A bull block in discount under a bullish bias, with a recent sweep of a low, lines up on every part of the confluence score. The same block in premium against a bearish bias does not.
Keeping the chart clean
Leave Display mode on Live, keep 2-3 blocks per side, and raise Min block score if the map is too busy. Lower Draw within (ATR) on very volatile symbols so far zones do not squash the candles.
Indicator Limitations
Originality Statement
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Order blocks, breakers, sweeps and the confluence score describe what price has already done and how the map lines up now; they are not predictions of future price behaviour. The author accepts no responsibility for trading losses resulting from use of this indicator.
Made with passion by jackofalltrades
Everything a block knows is written on it. The right-edge tag reads like "OB 81 · 62% buy · 1.4 ATR", and a second line "tested 2x" appears once price has come back to it. Two thin bars inside the block show its candle's bought and sold share at a glance. Around the blocks the chart carries the rest of the structure picture: BOS / CHoCH / MSS tags, equal highs and lows, liquidity sweeps, a premium / discount gradient over the current dealing range, and candles painted by the major bias. A compact dashboard sums it up and ends in a 0-100 confluence score whose formula is written out below.
It draws structure, zones and scores only. There are no trade signals in it.
Core Concepts
1. Two layers of structure
Major swings come from an ATR-adaptive zigzag: a swing high is confirmed once price has fallen from it by 1.8 x ATR(14) (adjustable), so the swings stretch in fast markets and tighten in quiet ones. A fixed pivot window is available instead. Minor swings come from a small pivot window (4 bars on each side by default).
A close beyond the latest swing is a break. A break in the direction of the current bias is a BOS. A break against it is a CHoCH, and a CHoCH closed by a displacement candle (body at least 55% of its range and at least 1.2 ATR) is tagged MSS. Major breaks are drawn as solid lines from the broken pivot to the breaking candle with a filled tag. Minor breaks are dashed with smaller iBOS / iCHoCH tags. In Live mode only the newest 6 of each stay on the chart.
2. Finding the block at the structural extreme
At each major break (optionally at minor breaks as well) the search window runs from the swing extreme that launched the breaking leg, with three bars of slack, up to the break. Inside it the indicator picks the most extreme opposite-colour candle: the lowest bear candle for a bullish break, the highest bull candle for a bearish one. Candles wider than 2.5 ATR or with a body under 20% of their range are skipped, and an optional filter asks for above-average volume. The block spans that candle's high to low.
If a new block covers at least half of an existing block on the same side, only the higher-scoring one is kept, so the map never stacks duplicates.
3. The block score (0-100)
The tooltip on every tag shows the four parts.
4. The volumetric split
Each block's candle is split by where it closed inside its own range: a close at the top is 100% bought, at the bottom 100% sold. Two bars sit inside the block outline: the bought share in the bull colour (upper bar) and the sold share in the bear colour (lower bar). Each bar is as long as its share of the block's width, so a block whose candle closed well off its low shows a long bull bar even when the candle itself was red.
5. Block life: tested, violated, breaker, MB
Every return of price into a block counts as one visit, and the tag gains a second line "tested 1x", "tested 2x" and so on. A block dies when a candle closes beyond its far edge (or wicks beyond it, if you choose Wick). A dead block flips role and becomes a breaker: dashed border in the opposite colour, tag "BRK 74" carrying the score of the block it was. A breaker dies when price closes back through it. After a major BOS, the first block built on that side is tagged MB (mitigation block) instead of OB.
6. Liquidity: equal highs / lows and sweeps
Two swing highs (or lows) within 0.15 ATR of each other, with no candle beyond them in between, are equal highs (EQH) or equal lows (EQL). The dotted line keeps running to the live bar while the level is untouched. When price trades through it, the line ends at that bar, dims and loses its text. A sweep (X) is a candle whose wick runs through an unbroken swing high or low and closes back inside, with a wick of at least 0.6 ATR and 35% of the candle.
7. Premium / discount
The dealing range runs from the latest major swing high to the latest major swing low, each extended by any new extreme since. Its equilibrium is either the AVWAP anchored at the start of the range or the plain midpoint. The premium half is shaded in the bear colour and the discount half in the bull colour, both deepening toward the range edges, with "Premium", "Discount" and the EQ level tagged at the right edge.
8. The confluence score (0-100)
The dashboard's last row reads the current bar toward the major bias (the minor bias when there is no major one yet):
It measures how many parts of the map line up at the current bar. It is a description of the map, not a forecast.
Features
- Adaptive major structure: ATR-scaled zigzag swings (or a fixed window) with BOS / CHoCH / MSS filled tags
- Minor structure: dashed iBOS / iCHoCH breaks from a small pivot window
- Structural-extreme order blocks: the most extreme opposite-colour candle of the leg that broke the swing
- 0-100 block score: size, displacement, volume and FVG, broken down in every tooltip
- Volumetric split: bought and sold share of the block candle drawn as two inner bars
- Data on every tag: "OB 81 · 62% buy · 1.4 ATR", plus "tested 2x" after a return
- Breaker blocks: violated blocks flip role with a dashed border in the opposite colour, "BRK 74"
- Mitigation blocks: the first block after a BOS is tagged MB
- Clean by design: 3 blocks and 2 breakers drawn per side (nearest first), nothing drawn beyond 8 ATR, Live mode keeps the newest 6 structure breaks
- Tags never overlap: right-edge tags are stacked with a gap of 4.5% of the displayed price span
- Equal highs / lows: dotted, extended while untaken, dimmed and silent once taken
- Liquidity sweeps: filled X tags on wicks through unbroken swings
- Premium / discount gradient: over the current dealing range, AVWAP or midpoint equilibrium
- Bias candles: candles painted by the major bias (on by default)
- Optional previous day / week / month high and low (off by default)
- Dashboard: OB MATRIX CONFLUENCE | STATE, nine positions, three sizes
- Ten themes: Emerald Ruby (default), Mystic, Ice Magenta, Royal Gold, Aqua Ember, Ocean Amber, Sakura Teal, Aurora, Mono and Custom, with light-chart awareness
- Five alerts: major break up / down, price reached a bull / bear block, liquidity sweep
- No repainting of history: pivots, breaks, blocks, visits and sweeps are decided on closed bars
- Free-account safe: works on 5,000 bars of history with two indicators on the chart
Input Parameters
General:
- Display mode: Live (newest 6 structure breaks, sweeps and equal levels) or All history
- Theme: ten palettes including Mono and Custom (default Emerald Ruby)
- Paint candles by major bias (default on)
- Tag size: Small or Normal
Market structure:
- Major pivot engine: Adaptive ZigZag or Fixed window
- ZigZag reversal in ATR (default 1.8), Fixed window bars (default 25)
- Minor pivot window (default 4)
- Show major / minor structure, Mark displacement CHoCH as MSS, Displacement body in ATR (default 1.2)
- Label major swings HH / HL / LH / LL (default off)
Order blocks:
- Build blocks on: Major breaks, or Major and minor breaks
- Live blocks drawn per side (default 3), Draw within ATR (default 8)
- Max search window in bars (default 60)
- Violated by: Close or Wick (default Close)
- Candle must have above-average volume (default off) and its multiple
- Min block score (default 0)
- Volumetric split bars (default on)
- Zones end, in bars right of the last bar (default 8)
Breakers and mitigation blocks:
- Show breaker blocks (default on), Breakers drawn per side (default 2)
- Tag the first block after a BOS as MB (default on)
Liquidity:
- Show equal highs / lows, from minor or major pivots, tolerance in ATR (default 0.15), scan depth (default 100 bars)
- Show liquidity sweeps, min sweep wick in ATR (default 0.6), cooldown (default 8 bars)
Premium / discount:
- Show premium / discount, Equilibrium: AVWAP or Range midpoint, Gradient steps (default 6)
Higher-timeframe levels:
- Previous day, week and month high / low (all off by default)
Confluence score:
- Block proximity range in ATR (default 3)
- A sweep counts for N bars (default 20)
Dashboard:
- Show dashboard, position (nine choices), text size, background transparency
- Keep room for the dashboard: adds empty room above (or below) the candles on the last bar so the dashboard and the right-edge tags never cover each other
How to Use This Indicator
Give it room on the right
The blocks, breakers and gradient end 8 bars right of the last candle and their tags start there. A right margin of about 40 bars keeps every tag on screen.
Reading a block
The colour tells the side, the number is the score, the percentage is the bought share of the block candle, and the ATR figure is its height. A block with a high score, a strong bought share on a bull block (or sold share on a bear block) and no visits yet is the cleanest kind. "tested 3x" means price has already used it three times.
Reading the context
Read the bias from the candle colour and the last major tag, then check which half of the dealing range price is in. A bull block in discount under a bullish bias, with a recent sweep of a low, lines up on every part of the confluence score. The same block in premium against a bearish bias does not.
Keeping the chart clean
Leave Display mode on Live, keep 2-3 blocks per side, and raise Min block score if the map is too busy. Lower Draw within (ATR) on very volatile symbols so far zones do not squash the candles.
Indicator Limitations
- Swings are confirmed after the fact: an adaptive swing needs price to turn by the ATR multiple, a minor swing needs its right-side bars. Breaks and blocks therefore appear after the swing they refer to, never before
- Everything is decided on closed bars, so a break or sweep that forms inside the live candle appears when that candle closes
- The volumetric split comes from the close position inside the candle's range, not from tick-level order flow
- The volume part of the score is neutral (12.5 of 25) on symbols that publish no volume
- Only blocks within Draw within (ATR) of price are drawn; the rest are still tracked and still count in the dashboard
- The right-edge tag spacing follows the visible range, so after a large zoom or scroll the stacking adjusts on the next update
- The confluence score describes how the map lines up at the current bar. It does not predict where price will go
Originality Statement
- Each block is searched from the swing extreme that launched the breaking leg rather than a fixed number of bars before the break, so the block sits at the true structural origin of the move
- The four-part 0-100 score, the bought / sold split of the block candle drawn as inner bars, and the visit count are all printed on one tag per block, with the full breakdown in its tooltip
- Blocks are followed through their whole life: fresh, tested, violated, flipped to a breaker with its score carried over, and tagged MB when they are the first after a BOS
- The premium / discount equilibrium can be an AVWAP anchored at the start of the current dealing range, computed from running sums so it follows every new swing without a loop
- Right-edge tags are stacked against the displayed price span so they never overlap, and the dashboard reserves its own room above the candles
- The dashboard's confluence score is a fixed, published formula (bias 30, zone side 20, nearest block 35, recent sweep 15) rather than a hidden composite
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Order blocks, breakers, sweeps and the confluence score describe what price has already done and how the map lines up now; they are not predictions of future price behaviour. The author accepts no responsibility for trading losses resulting from use of this indicator.
Made with passion by jackofalltrades
Trading Indicators, Strategies, Tools, & Signals !! 🃏
Get Access and See Full Results👇
jackofalltrades.vip 🌐
Get Access and See Full Results👇
jackofalltrades.vip 🌐
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Trading Indicators, Strategies, Tools, & Signals !! 🃏
Get Access and See Full Results👇
jackofalltrades.vip 🌐
Get Access and See Full Results👇
jackofalltrades.vip 🌐
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.