{"slug":"the-january-barometer","qid":"overlap_check","label":"overlap_check","post_title":"the-january-barometer","post_url":"/blog/the-january-barometer#q-overlap_check","columns":["cohort","years_in_sample","hit_full_year_pct","hit_feb_to_dec_pct"],"rows":[{"cohort":"All years","years_in_sample":22,"hit_full_year_pct":59.1,"hit_feb_to_dec_pct":54.5},{"cohort":"Up January","years_in_sample":12,"hit_full_year_pct":83.3,"hit_feb_to_dec_pct":83.3},{"cohort":"Down January","years_in_sample":10,"hit_full_year_pct":30,"hit_feb_to_dec_pct":20}],"shape":"ranking","sql":"WITH yearly AS\n(\n    SELECT\n        toYear(date)                              AS y,\n        argMax(close, date)                       AS dec_close,\n        argMaxIf(close, date, toMonth(date) = 1)   AS jan_close,\n        countIf(toMonth(date) = 1)                AS jan_sessions,\n        countIf(toMonth(date) = 12)               AS dec_sessions\n    FROM global_markets.stocks_daily_aggs\n    WHERE ticker = 'SPY'\n    GROUP BY y\n),\nscored AS\n(\n    SELECT\n        toFloat64(cur.jan_close) / toFloat64(prev.dec_close) - 1 AS jan_ret,\n        toFloat64(cur.dec_close) / toFloat64(prev.dec_close) - 1 AS year_ret,\n        toFloat64(cur.dec_close) / toFloat64(cur.jan_close) - 1  AS feb_to_dec_ret\n    FROM yearly AS cur\n    INNER JOIN yearly AS prev ON prev.y = cur.y - 1\n    WHERE cur.jan_sessions >= 15\n      AND cur.dec_sessions >= 15\n),\ntagged AS\n(\n    SELECT\n        arrayJoin(['All years', if(jan_ret > 0, 'Up January', 'Down January')]) AS cohort,\n        (jan_ret > 0) = (year_ret > 0)                                          AS matched_full_year,\n        (jan_ret > 0) = (feb_to_dec_ret > 0)                                    AS matched_feb_to_dec\n    FROM scored\n)\nSELECT\n    cohort,\n    count()                                 AS years_in_sample,\n    round(100 * avg(matched_full_year), 1)  AS hit_full_year_pct,\n    round(100 * avg(matched_feb_to_dec), 1) AS hit_feb_to_dec_pct\nFROM tagged\nGROUP BY cohort\nORDER BY multiIf(cohort = 'All years', 1, cohort = 'Up January', 2, 3)","computed_at":"2026-10-02T15:44:31.706220+00:00","elapsed":0.176704819}