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
| Input | Type | Default | Range or choices |
|---|---|---|---|
Swing bars each sidelength | Whole number | 3 | min 1, max 50 |
Zones kept per sidemax_zones | Whole number | 20 | min 1, max 500 |
What it draws
| Line | Drawn as |
|---|---|
| Swept high | Steps |
| Swept low | Steps |
Used in
No strategy template reads it yet.