{"slug":"what-is-a-liquidity-sweep","qid":"by_year","label":"SPY: share of sessions that swept the prior day's high or low, by year","post_title":"What Is a Liquidity Sweep in Trading?","post_url":"/blog/what-is-a-liquidity-sweep#q-by_year","columns":["year","high_sweep_pct","low_sweep_pct"],"rows":[{"year":2021,"high_sweep_pct":24.6,"low_sweep_pct":16.3},{"year":2022,"high_sweep_pct":17.1,"low_sweep_pct":20.3},{"year":2023,"high_sweep_pct":19.2,"low_sweep_pct":21.6},{"year":2024,"high_sweep_pct":23.4,"low_sweep_pct":17.1},{"year":2025,"high_sweep_pct":22.8,"low_sweep_pct":18.8}],"shape":"ranking","sql":"SELECT\n    toYear(date)                                                          AS year,\n    round(100.0 * countIf(hi > prior_hi AND cl < prior_hi) / count(), 1)  AS high_sweep_pct,\n    round(100.0 * countIf(lo < prior_lo AND cl > prior_lo) / count(), 1)  AS low_sweep_pct\nFROM\n(\n    SELECT\n        date,\n        hi,\n        lo,\n        cl,\n        lagInFrame(hi) OVER (ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS prior_hi,\n        lagInFrame(lo) OVER (ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS prior_lo\n    FROM\n    (\n        SELECT\n            date,\n            argMax(high,  _ingest_time) AS hi,\n            argMax(low,   _ingest_time) AS lo,\n            argMax(close, _ingest_time) AS cl\n        FROM global_markets.stocks_daily_aggs\n        WHERE ticker = 'SPY'\n          AND date >= '2020-12-31'\n          AND date <  '2026-01-01'\n        GROUP BY date\n    )\n)\nWHERE date >= '2021-01-01'\n  AND prior_hi > 0\nGROUP BY year\nORDER BY year","computed_at":"2026-09-19T15:04:29.036321+00:00","elapsed":0.003370116}