Updated

OBIM - Order Blocks with Imbalance

2 630
OBIM - Order Blocks with Imbalance

Multi-timeframe order blocks, breakers and stars, built from the general smart money concept of an order block (the last opposite-colored candle before an impulsive move) combined with a fair-value-gap-style imbalance requirement. Inspired by the teachings of White Phoenix — this is an independent, open-source build, not a copy of any other script.

How a block is found
On every active higher timeframe:

The last opposite candle before a move away from it (last down candle before an up move, last up candle before a down move).
The move must leave a clean three-candle gap (no wick overlap) — the imbalance. No gap, no block.
The box spans that candle’s full wick, extending to the latest bar until price taps it (mitigated).
Your chart’s own timeframe is always scanned alongside the higher ones. A lower-timeframe block fully inside a same-direction higher-timeframe block stays hidden while that higher block is still clean.

Stars
A block earns a star when its move broke external structure and wasn’t pre-mitigated (no second entry, no long stay inside, no weak exit). Starred blocks get a solid border, a stronger fill, and a mark — a quick visual filter for the blocks that actually did something.

Breakers
A block that price closes clean through doesn’t just vanish — if the breaking candle also leaves a gap, the block flips polarity and stays on the chart as a breaker, tracking support/resistance role reversal.

Also included

Entry Lines: a ray off every active block’s trigger edge, fully customizable per type (color, style, width), with an optional price tag
True Price Scale Tags: real axis-docked labels for the blocks nearest current price
Per-type colors for fills, borders and timeframe labels
Adjustable mitigation display (remove / dim last per TF / dim all)
ATR-based size filter to cut micro zones
Scans six higher-timeframe groups automatically based on your chart’s timeframe
Release Notes
Bugs
Release Notes
**What's New:**

- Pending (preview) order blocks now draw the same entry-line and price tag as confirmed blocks, so you can see the exact level before the block fully confirms — no more guessing where the ray will land.
- Pending blocks are now included in the on-scale price tags (nearest 8 to current price), matching confirmed blocks.
- Fixed a bug where two blocks sitting almost on the same price could draw duplicate, overlapping price tags — now deduplicated.
- Price tag text color is now tied to the same label-color settings as the block's own text, so it stays consistent if you customize colors.
Release Notes
Order Blocks with Imbalance — Update

Fixed: duplicate blocks near current price

Some blocks were drawing twice. A block’s live preview is supposed to hand off to the real block when it confirms, but the handoff never happened — so any block whose gap stayed open kept a second copy stacked on itself. You’d see it as a block brighter than the rest, and with Extend Unmitigated Blocks on, one copy would extend while the other sat stranded behind it. Fixed, along with the duplicate price tags it caused on the scale.

New: Monochrome

One switch at the top of Visuals turns everything gray — useful if you run several indicators and want blocks sitting behind your chart instead of competing with it. Breakers stay dashed and a touch stronger so they still read at a glance, and mitigated blocks stay dimmer than live ones. Your own colors are untouched underneath; switch it off and they all come back as you set them.

New: Custom Timeframes

Four slots, 29 timeframes each — including ones no group scans, like 20m, 4D, 5D, 2W and 3M. They run on top of whichever Timeframe Group is active, so you can pin a timeframe you care about without giving up the automatic ones. Turn all four groups off for a fully custom setup.

Custom picks follow the same chart-size rules the groups do, so a 5D block won’t land on a 15m chart. And a custom timeframe the active group already scans is ignored rather than drawn twice.

2D and 6D are now off by default. The 12h–1M group scans 18h, 1D, 3D, 1W, 1M. If you used 2D or 6D, add them back in a Custom slot.

New: Stars Below Chart Timeframe (off by default)

Normally a timeframe lower than your chart is skipped. Turn this on and those timeframes still get scanned, but only blocks that earn a star survive — everything else is thrown away, so a 5m timeframe can’t bury a 1h chart.

Starred blocks are no longer hidden inside higher-timeframe blocks

Hide Blocks Inside Higher-TF Blocks was suppressing stars whenever a bigger block happened to swallow them. A star is the reason to look at a block, so it stays visible now.

Cleaner tag alignment

Star and BRK marks moved to the left of the timeframe tag — ★ 15m, BRK 1h, ★ BRK 30m — so every tag lines up on the same vertical edge. Multi-week and multi-month tags also read correctly now (3M instead of 1M).
Release Notes
Bugs. Added 2D back with default
Release Notes
Update: Structure engine, star and breaker fixes, cleaner labels, new filters and alerts

STRUCTURE
- The structure engine now matches Structure's Standard mode. A pullback needs two consecutive pullback-colour candles, and the second must close beyond the first one's wick. BOS and ChoCh need a close. Staircase breaks are off.
- A sweep of the protected swing now flips the trend. A later close through that level counts as the ChoCh.
- A swept swing stays the break level until a close takes it out or a new pullback confirms.
- The candle that makes the new extreme can complete the pullback pair itself.
- When a ChoCh candle also trades past the old extreme, that wick is handled first.
- At every ChoCh, the pullback since the new extreme is replayed, so it still counts.

BREAKERS
- Fixed: breakers were tested on the chart's candles instead of the block's own timeframe. A 30m block on a 1h chart could flip on a 1h gap that never existed on the 30m chart. A block now only flips when, on its own timeframe, a candle closes beyond it and the candles either side leave a clean gap covering it.

STARS
- Fixed: breakers were getting a star whenever they hadn't been pre-mitigated, even when the original block never broke structure. A breaker now keeps the star verdict of the block it flipped from. No BOS or ChoCh means no star.
- New: Show Stars Only. Hides everything without the star mark: plain blocks, pre-mitigated blocks, unstarred breakers, mitigated blocks that were never starred, and live previews. Their entry lines and price-scale tags are hidden too.
- Stars Below Chart Timeframe is now on by default. Lower timeframes are still scanned, but only their starred blocks are kept, so a 5m star can show on a 1h chart. Turn it off to go back to chart-timeframe-and-up only.

LABELS
- Fixed: when two timeframes drew the same zone, their tags printed on top of each other and couldn't be read. Matching zones now stack their tags: the first in the centre of the box, the next at the top, the next at the bottom. Placement updates automatically as blocks are hidden, revealed, flipped or removed.

NEW BLOCK FILTERS (Block Logic, all off by default)
- Max Block Size (x ATR): drops blocks whose candle is larger than this multiple of ATR(14) on the block's own timeframe, so only quiet bases are kept.
- Min Displacement (impulse ÷ block): the impulse candle's range must be at least this multiple of the block candle's range. Applies on top of the clean gap rule.
- Max Fill %: a block is mitigated once price has filled more than this % of it, measured from the entry edge. Works with Close or Wick mitigation.

ALERTS
- New Block Alerts: Off, Stars Only or All Blocks.
- Breaker Flip Alerts.
- To use them, create an alert on OBIM with "Any alert() function call".

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.