Liquidity sweep
All indicators

LibraryMarket structure

Indicator

Liquidity sweep

Stop runs: bars that trade beyond a swing high or low still holding liquidity and close back inside, the stops taken and the move rejected.

Market structureOn the price2 inputsSweep

How it is calculated

Swings as in structure; each stays liquidity until a later high trades above it (a low below, for lows), at most max_zones per side. up is 1 when a high takes such a level and the close is at or below it, down when a low takes one and the close is at or above it. A bar first takes the levels known before it. The level lines hold the last swept price, the highest one when a bar sweeps several.

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

How to read it

A sweep up takes buy stops above a high and fails there, often before a move down; a sweep down the mirror. A swing counts once it is confirmed, length bars after its extreme, and a level taken by a close beyond it is gone without a sweep.

In a strategy

Fade the stop run: when s = ctx.ind("liquidity_sweep", length=3) has s.down of 1, go long with the stop below the bar's low and the target at the nearest buy side liquidity.

Inputs

InputTypeDefaultRange or choices
Swing bars each sidelengthWhole number3min 1, max 50
Zones kept per sidemax_zonesWhole number20min 1, max 500

What it draws

LineDrawn as
Swept highSteps
Swept lowSteps

Used in

No strategy template reads it yet.

OrionQuant