{"slug":"is-the-stock-market-open-today","qid":"year_closures","label":"This calendar year's closures: already passed (counted from the tape) plus still ahead (from the calendar)","post_title":"Is the Stock Market Open Today?","post_url":"/blog/is-the-stock-market-open-today#q-year_closures","columns":["category","already_passed","still_ahead","total","calendar_year"],"rows":[{"category":"full closure","already_passed":7,"still_ahead":3,"total":10,"calendar_year":"2026"},{"category":"early close (1:00 pm)","already_passed":2,"still_ahead":2,"total":4,"calendar_year":"2026"}],"shape":"table","sql":"WITH day_bars AS (\n    SELECT cal.day AS day, ifNull(t.bars, 0) AS bars\n    FROM (SELECT makeDate(toYear(today()), 1, 1) + arrayJoin(range(370)) AS day) AS cal\n    LEFT JOIN (\n        SELECT toDate(toTimeZone(window_start, 'America/New_York')) AS d, count() AS bars\n        FROM global_markets.delayed_stocks_minute_aggs\n        WHERE ticker = 'SPY'\n          AND window_start >= toDateTime(makeDate(toYear(today()), 1, 1), 'America/New_York')\n          AND (toHour(toTimeZone(window_start, 'America/New_York')) * 60 + toMinute(toTimeZone(window_start, 'America/New_York'))) BETWEEN 570 AND 959\n        GROUP BY d\n    ) AS t ON t.d = cal.day\n    WHERE toDayOfWeek(cal.day) BETWEEN 1 AND 5\n      AND cal.day <= today() - 4\n),\npast AS (\n    SELECT countIf(bars = 0) AS past_full, countIf(bars BETWEEN 120 AND 330) AS past_early\n    FROM day_bars\n),\nahead AS (\n    SELECT countDistinctIf(date, status = 'closed') AS ahead_full,\n           countDistinctIf(date, status = 'early-close') AS ahead_early\n    FROM global_markets.stocks_market_holidays\n    WHERE date > today() - 4 AND toYear(date) = toYear(today())\n)\nSELECT category, already_passed, still_ahead, already_passed + still_ahead AS total, toString(toYear(today())) AS calendar_year\nFROM (\n    SELECT 'full closure' AS category, past.past_full AS already_passed, ahead.ahead_full AS still_ahead, 1 AS ord FROM past, ahead\n    UNION ALL\n    SELECT 'early close (1:00 pm)' AS category, past.past_early AS already_passed, ahead.ahead_early AS still_ahead, 2 AS ord FROM past, ahead\n)\nORDER BY ord","computed_at":"2026-08-25T13:00:02.524241+00:00","elapsed":0.834389921}