{"slug":"what-is-a-liquidity-sweep","qid":"base_rate","label":"How often a session pokes through the prior day's high or low and closes back inside, 2021 to 2025","post_title":"What Is a Liquidity Sweep in Trading?","post_url":"/blog/what-is-a-liquidity-sweep#q-base_rate","columns":["ticker","session_count","high_sweep_count","high_sweep_pct","low_sweep_count","low_sweep_pct"],"rows":[{"ticker":"AAPL","session_count":1255,"high_sweep_count":271,"high_sweep_pct":21.6,"low_sweep_count":258,"low_sweep_pct":20.6},{"ticker":"JPM","session_count":1255,"high_sweep_count":282,"high_sweep_pct":22.5,"low_sweep_count":259,"low_sweep_pct":20.6},{"ticker":"KO","session_count":1255,"high_sweep_count":288,"high_sweep_pct":22.9,"low_sweep_count":302,"low_sweep_pct":24.1},{"ticker":"MSFT","session_count":1255,"high_sweep_count":266,"high_sweep_pct":21.2,"low_sweep_count":267,"low_sweep_pct":21.3},{"ticker":"NVDA","session_count":1255,"high_sweep_count":251,"high_sweep_pct":20,"low_sweep_count":256,"low_sweep_pct":20.4},{"ticker":"QQQ","session_count":1255,"high_sweep_count":246,"high_sweep_pct":19.6,"low_sweep_count":248,"low_sweep_pct":19.8},{"ticker":"SPY","session_count":1255,"high_sweep_count":269,"high_sweep_pct":21.4,"low_sweep_count":236,"low_sweep_pct":18.8}],"shape":"table","sql":"SELECT\n    ticker,\n    count()                                                               AS session_count,\n    countIf(hi > prior_hi AND cl < prior_hi)                              AS high_sweep_count,\n    round(100.0 * countIf(hi > prior_hi AND cl < prior_hi) / count(), 1)  AS high_sweep_pct,\n    countIf(lo < prior_lo AND cl > prior_lo)                              AS low_sweep_count,\n    round(100.0 * countIf(lo < prior_lo AND cl > prior_lo) / count(), 1)  AS low_sweep_pct\nFROM\n(\n    SELECT\n        ticker,\n        date,\n        hi,\n        lo,\n        cl,\n        lagInFrame(hi) OVER (PARTITION BY ticker ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS prior_hi,\n        lagInFrame(lo) OVER (PARTITION BY ticker ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS prior_lo\n    FROM\n    (\n        SELECT\n            ticker,\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 IN ('SPY', 'QQQ', 'AAPL', 'MSFT', 'NVDA', 'JPM', 'KO')\n          AND date >= '2020-12-31'\n          AND date <  '2026-01-01'\n        GROUP BY ticker, date\n    )\n)\nWHERE date >= '2021-01-01'\n  AND prior_hi > 0\nGROUP BY ticker\nORDER BY ticker","computed_at":"2026-09-19T15:04:28.938668+00:00","elapsed":0.004424428}