Liquidity sweeps
Equal highs and lows, and wicks that run past them or past a swing point and close back.
Liquidity from confirmed swing pivots (swing params as swing). Equal highs: a new swing high within max(floor_pct % × close, eq_k × ATR) of one of the last eq_pivots highs, at least min_sep candles apart, with no higher swing high between them; the level is the higher of the two (equal lows mirror it). sweep_high = a wick above an equal-highs level or the last swing high by more than sweep_k ATRs, closing back below it; any wick past a level by that much takes the level. Levels expire max_age_bars after they are made. last_sweep_high_level / last_sweep_low_level = the high / low of the last candle that made sweep_high / sweep_low, from that candle until the next sweep of the same side, at most max_age_bars candles.
Liquidity sweeps is a structure detector: it marks price structure on the chart and counts against the plan's detector limit.
Settings
| Setting | Default | Range | What it does |
|---|---|---|---|
| atr_period | 14 | 1 to 500 | ATR length (Wilder) for every buffer. |
| swing_k | 2 | 0.1 to 20 | Swing reversal in ATRs: a pivot is confirmed when a close moves this far back. |
| swing_min_pct | 0.1 | 0 to 10 | Smallest swing reversal, % of the close. |
| eq_k | 0.1 | 0 to 5 | Equal highs/lows: largest difference in ATRs. |
| eq_pivots | 5 | 1 to 20 | Earlier swing points compared with a new one. |
| min_sep | 5 | 1 to 500 | Equal highs/lows: fewest candles between the two points. |
| sweep_k | 0.05 | 0 to 5 | A sweep's wick must pass the level by this many ATRs. |
| floor_pct | 0.02 | 0 to 10 | Smallest buffer of this detector, % of the close (each buffer is the larger of this and its ATR multiple). |
| max_age_bars | 200 | 10 to 2000 | Candles after its birth until a zone or level expires. |
What it gives
| Output | What it is |
|---|---|
| High sweep | True when a wick runs above a high level and the close falls back below it. |
| Low sweep | True when a wick runs below a low level and the close comes back above it. |
| Equal highs level | The active equal-highs level. |
| Equal lows level | The active equal-lows level. |
| Last high sweep level | High of the last candle that swept a high level (its wick); a short's stop above the sweep. |
| Last low sweep level | Low of the last candle that swept a low level (its wick); a long's stop below the sweep. |
What it reads
It reads the whole candle (open, high, low, close and volume).
Warm-up
With its default settings, Liquidity sweeps needs 441 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.
Test it
Copy this sentence into the Algonney chat to backtest it:
Backtest a strategy on BTC that uses Liquidity sweeps with its default settings