Displacement
All indicators

LibraryMarket structure

Indicator

Displacement

Displacement: a candle with a body far larger than usual that leaves a fair value gap behind, the footprint of large orders moving price in one go.

Market structureOn the price3 inputsDisp

How it is calculated

A bullish candle whose body (close minus open) is more than min_body times the ATR (Wilder, atr_length) at that candle, and which is the middle candle of a bullish gap as in fvg (the next candle's low above the high before it, at least min_size ATRs). Bearish mirrors this. up and down are 1 on the bar after the candle, which completes the gap; high, low and body_atr hold the last one's.

Reference: ICT liquidity concepts, from public descriptions (#546)

How to read it

The flag comes one bar after the large candle, because only the next candle shows whether it left a gap; it is never set earlier. high and low frame the candle that displaced price, a reference for entries on the retrace.

In a strategy

Trade with the displacement: when d = ctx.ind("displacement", min_body=1.5) has d.up of 1, look for longs on a pullback toward d.low.

Inputs

InputTypeDefaultRange or choices
ATR lengthatr_lengthWhole number14min 1, max 500
Minimum size (ATR)min_sizeNumber0.25min 0, max 10
Minimum body (ATR)min_bodyNumber1min 0, max 10

What it draws

LineDrawn as
Candle highSteps
Candle lowSteps

Used in

No strategy template reads it yet.

OrionQuant