Order blocks
All indicators

LibraryMarket structure

Indicator

Order blocks

The last opposite coloured candle before the move that broke structure, the zone where the move started and price often reacts when it comes back.

Market structureOn the price4 inputsOB

How it is calculated

Swings and breaks as in structure. When a swing high breaks (BoS or CHoCH), take the lowest low between the swing and the break (the later on a tie); the last bearish candle at or before it is the bullish block, from its high to its low or, with Zone body, its body. Bearish blocks mirror this. A block ends on a close through its far side: a bullish one below its bottom.

Reference: ICT market structure, from public descriptions (#546)

How to read it

A block shows on the bar of the break that made it, never earlier, though its candle lies further back. The lines show the nearest active bullish block (the highest) and bearish one (the lowest); new and broken are 1 on the bar of the event. At most max_zones blocks per side are kept.

In a strategy

Buy the return to the block: with ob = ctx.ind("order_block", length=3, zone="body") a long limit at ob.bull_top and the stop below ob.bull_bottom, while the trend is up.

Inputs

InputTypeDefaultRange or choices
Swing bars each sidelengthWhole number3min 1, max 50
Break onbreak_onChoice"close"Close, Wick
ZonezoneChoice"wick"Full candle, Body only
Zones kept per sidemax_zonesWhole number20min 1, max 500

What it draws

LineDrawn as
Bullish topSteps
Bullish bottomSteps
Bearish topSteps
Bearish bottomSteps

Used in

No strategy template reads it yet.

OrionQuant