{"slug":"does-the-pdt-rule-apply-to-crypto-and-futures","qid":"five_day_window","label":"Calendar days spanned by each rolling five-session window","post_title":"Does the PDT Rule Apply to Crypto and Futures?","post_url":"/blog/does-the-pdt-rule-apply-to-crypto-and-futures#q-five_day_window","columns":["session_date","calendar_days_spanned","longest_span_days"],"rows":[{"session_date":"2026-06-12","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-06-15","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-06-16","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-06-17","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-06-18","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-06-22","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-06-23","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-06-24","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-06-25","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-06-26","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-06-29","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-06-30","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-01","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-02","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-06","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-07-07","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-07-08","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-07-09","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-07-10","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-07-13","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-14","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-15","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-16","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-17","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-07-20","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-21","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-22","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-23","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-24","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-07-27","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-28","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-29","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-30","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-07-31","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-08-03","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-04","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-05","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-06","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-07","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-08-10","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-11","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-12","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-13","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-14","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-08-17","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-18","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-19","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-20","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-21","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-08-24","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-25","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-26","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-27","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-08-28","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-08-31","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-01","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-02","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-03","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-04","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-09-08","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-09-09","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-09-10","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-09-11","calendar_days_spanned":8,"longest_span_days":8},{"session_date":"2026-09-14","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-15","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-16","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-17","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-18","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-09-21","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-22","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-23","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-24","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-25","calendar_days_spanned":5,"longest_span_days":8},{"session_date":"2026-09-28","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-29","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-09-30","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-10-01","calendar_days_spanned":7,"longest_span_days":8},{"session_date":"2026-10-02","calendar_days_spanned":5,"longest_span_days":8}],"shape":"series","sql":"WITH\n    sessions AS\n    (\n        SELECT DISTINCT toDate(toTimeZone(window_start, 'America/New_York')) AS d\n        FROM global_markets.delayed_stocks_minute_aggs\n        WHERE ticker = 'SPY'\n          AND window_start >= today() - 120\n          AND window_start <  today() - 2\n          AND (toHour(toTimeZone(window_start, 'America/New_York')) * 60\n               + toMinute(toTimeZone(window_start, 'America/New_York'))) >= 570\n          AND (toHour(toTimeZone(window_start, 'America/New_York')) * 60\n               + toMinute(toTimeZone(window_start, 'America/New_York'))) < 960\n    ),\n    spans AS\n    (\n        SELECT\n            d,\n            dateDiff('day', min(d) OVER (ORDER BY d ASC ROWS BETWEEN 4 PRECEDING AND CURRENT ROW), d) + 1 AS span_days,\n            count()   OVER (ORDER BY d ASC ROWS BETWEEN 4 PRECEDING AND CURRENT ROW)                    AS sessions_in_window\n        FROM sessions\n    )\nSELECT\n    toString(d)                              AS session_date,\n    toUInt16(span_days)                      AS calendar_days_spanned,\n    toUInt16(max(span_days) OVER ())         AS longest_span_days\nFROM spans\nWHERE sessions_in_window = 5\nORDER BY d ASC","computed_at":"2026-10-05T15:48:07.688059+00:00","elapsed":0.119436004}