Skip to content
StatePath
Tool Atlasmarket.order_block

Tool

Order Block (SMC)

market.order_block

MarketSmc

Inputs

pivotsEvent list

The swing pivots (from a zigzag or structure tool) that mark the highs and lows. The detector uses them to find the structure break that an order block sits in front of.

Outputs

Bundle (untagged)

A bundle of order-block zones, each with its top price, bottom price, direction (demand or supply), and whether price has mitigated it yet. Feed it into interpretor.smc_zone to react when price returns to a block.

An order block is the last opposing candle right before an impulsive move — the footprint of where big players loaded up. A bullish order block is the last down-candle before a strong rally (a demand zone); a bearish one is the last up-candle before a sharp drop (a supply zone). This tool finds those zones and tracks when price returns to them.

Order Block (SMC) overview diagramob.bullish

How it works

Working from the swing pivots you feed in, it locates the candle that broke structure, then steps back to the last candle of the opposite colour before that break and measures the displacement of the move that followed. If the move clears min_displacement, the origin candle becomes a zone whose height is set by zone_span (full wick range or just the body); mitigation_method then governs how price must re-enter the zone to count it as tapped.

Modes

Direction options

Bullish (demand)bullish

Keeps the last down-candle before an impulsive rally and treats it as a demand zone price may revisit to find buyers.

Bullish (demand) diagramob.bullish

When to use: Long entries that want to buy a retrace into fresh demand.

Bearish (supply)bearish

Keeps the last up-candle before an impulsive drop and treats it as a supply zone price may rally back into to find sellers.

Bearish (supply) diagramob.bearish

When to use: Short entries that want to sell a retrace into fresh supply.

Both sidesboth

Tracks bullish demand and bearish supply order blocks together, mapping both buy- and sell-side zones.

Both sides diagramob.bullishob.bearish

When to use: Two-sided playbooks, or when you chart all order blocks before picking a bias.

Zone span options

Full wick spanwick

Draws the zone from the origin candle's high to its low, so the whole wick range is treated as the order block.

Full wick span diagramob.wick_span

When to use: When you want the most generous zone and don't want price to slip past a body edge unnoticed.

Body onlybody

Draws the zone from the origin candle's open to its close, a tighter block that ignores the wicks.

Body only diagramob.body_span

When to use: When you prefer a precise zone and tighter risk, accepting that a wick may overshoot it.

Mitigation method options

Wick touchwick

Counts the order block as tapped the instant any wick reaches into it, the most sensitive rule.

Wick touch diagramob.wick_touch

When to use: When the first light touch of the zone should already mark it mitigated.

Close insideclose

Waits for a bar to close inside the zone before counting it as tapped, ignoring wicks that pierce and reject.

Close inside diagramob.close_inside

When to use: When you want a committed re-entry into the block, not a fleeting spike.

Midpoint (50%)average

Counts the block as tapped once price reaches its halfway line, a balanced rule between a wick touch and a full close.

Midpoint (50%) diagramob.midpoint

When to use: Popular for partial entries that engage the block at its 50% level.

Configuration

directionenum

Which order blocks to keep: bullish (demand, last down-candle before a rally), bearish (supply, last up-candle before a drop), or both.

Choices:bullishbearishboth
min_displacementscalar

How far, in price, the impulsive move after the origin candle must travel for the block to qualify. Larger demands a stronger break and yields fewer, higher-quality blocks.

zone_spanenum

How tall the order-block zone is drawn: wick uses the origin candle's full high-to-low range, body uses just its open-to-close range.

Choices:wickbody
mitigation_methodenum

How price must re-enter an order block before it is marked tapped: wick (any touch), close (a bar closes inside), or average (price reaches the 50% midpoint).

Choices:wickcloseaverage
origin_lookbackscalar

How many bars back from the structure break to search for the last opposing candle. Larger tolerates a slower run-up before the impulse; smaller keeps the origin tight to the break.

max_zonesscalar

Caps how many of the most recent unmitigated order blocks are kept and emitted. Smaller keeps only the freshest zones; larger retains a deeper stack.

Connects to

Reads from
Feeds into

Examples

  • In bullish direction with zone_span 'body' and mitigation_method 'close', mark a demand block and arm a long when a bar closes back inside it.
  • Wire the swing output of market.zigzag into the pivots input, then feed the blocks to interpretor.smc_zone for entry signals.

Common mistakes

  • Leaving min_displacement at 0, which tags weak candles as order blocks and produces zones that never hold.
  • Forgetting to supply real swing pivots — without a structure break to anchor on, no order block can be located.

See also