{"slug":"reg-t-margin-vs-portfolio-margin","qid":"vol_by_year","label":"SPY realized volatility and worst session, by calendar year","post_title":"Reg T Margin vs Portfolio Margin Explained","post_url":"/blog/reg-t-margin-vs-portfolio-margin#q-vol_by_year","columns":["year","realized_vol_pct","worst_day_pct","days_over_2pct_count"],"rows":[{"year":2007,"realized_vol_pct":15.9,"worst_day_pct":-3.9,"days_over_2pct_count":14},{"year":2008,"realized_vol_pct":41.2,"worst_day_pct":-9.8,"days_over_2pct_count":70},{"year":2009,"realized_vol_pct":26.6,"worst_day_pct":-5.3,"days_over_2pct_count":50},{"year":2010,"realized_vol_pct":17.9,"worst_day_pct":-3.8,"days_over_2pct_count":22},{"year":2011,"realized_vol_pct":23,"worst_day_pct":-6.5,"days_over_2pct_count":33},{"year":2012,"realized_vol_pct":12.8,"worst_day_pct":-2.5,"days_over_2pct_count":7},{"year":2013,"realized_vol_pct":11.1,"worst_day_pct":-2.5,"days_over_2pct_count":4},{"year":2014,"realized_vol_pct":11.3,"worst_day_pct":-2.3,"days_over_2pct_count":4},{"year":2015,"realized_vol_pct":15.5,"worst_day_pct":-4.2,"days_over_2pct_count":11},{"year":2016,"realized_vol_pct":13.1,"worst_day_pct":-3.6,"days_over_2pct_count":10},{"year":2017,"realized_vol_pct":6.8,"worst_day_pct":-1.8,"days_over_2pct_count":0},{"year":2018,"realized_vol_pct":17.1,"worst_day_pct":-4.2,"days_over_2pct_count":19},{"year":2019,"realized_vol_pct":12.5,"worst_day_pct":-3,"days_over_2pct_count":7},{"year":2020,"realized_vol_pct":33.4,"worst_day_pct":-10.9,"days_over_2pct_count":42},{"year":2021,"realized_vol_pct":13.1,"worst_day_pct":-2.4,"days_over_2pct_count":8},{"year":2022,"realized_vol_pct":24.2,"worst_day_pct":-4.3,"days_over_2pct_count":46},{"year":2023,"realized_vol_pct":13.2,"worst_day_pct":-2,"days_over_2pct_count":2},{"year":2024,"realized_vol_pct":12.6,"worst_day_pct":-3,"days_over_2pct_count":7},{"year":2025,"realized_vol_pct":19.4,"worst_day_pct":-5.9,"days_over_2pct_count":14},{"year":2026,"realized_vol_pct":14.2,"worst_day_pct":-2.6,"days_over_2pct_count":4}],"shape":"ranking","sql":"SELECT\n    toYear(session_date)                       AS year,\n    round(stddevPop(daily_pct) * sqrt(252), 1) AS realized_vol_pct,\n    round(min(daily_pct), 1)                   AS worst_day_pct,\n    countIf(abs(daily_pct) >= 2)               AS days_over_2pct_count\nFROM\n(\n    SELECT\n        date AS session_date,\n        (toFloat64(close) / lagInFrame(toFloat64(close), 1) OVER (ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) - 1) * 100 AS daily_pct\n    FROM global_markets.stocks_daily_aggs\n    WHERE ticker = 'SPY'\n      AND date >= '2007-01-01'\n      AND date <  '2026-07-01'\n)\nWHERE isFinite(daily_pct)\nGROUP BY year\nORDER BY year","computed_at":"2026-08-09T15:41:49.694840+00:00","elapsed":0.002866713}