{"slug":"learn-quant-trading-open-source-book","qid":"vol_by_ticker","label":"Twelve months of daily moves: annualized volatility and worst session, eight names","post_title":"Learn Quant Trading From an Open Source Book","post_url":"/blog/learn-quant-trading-open-source-book#q-vol_by_ticker","columns":["ticker","annualized_vol_pct","worst_day_pct"],"rows":[{"ticker":"COIN","annualized_vol_pct":68,"worst_day_pct":13.34},{"ticker":"TSLA","annualized_vol_pct":46.6,"worst_day_pct":14.63},{"ticker":"NVDA","annualized_vol_pct":36.5,"worst_day_pct":6.22},{"ticker":"MSFT","annualized_vol_pct":31.5,"worst_day_pct":10.02},{"ticker":"AAPL","annualized_vol_pct":25.8,"worst_day_pct":7.44},{"ticker":"KO","annualized_vol_pct":18.8,"worst_day_pct":3.96},{"ticker":"JNJ","annualized_vol_pct":18.4,"worst_day_pct":3.65},{"ticker":"SPY","annualized_vol_pct":12.7,"worst_day_pct":2.69}],"shape":"ranking","sql":"WITH daily AS (\n    SELECT ticker,\n           toDate(toTimeZone(window_start, 'America/New_York')) AS session,\n           argMax(close, window_start) AS session_close\n    FROM global_markets.delayed_stocks_minute_aggs\n    WHERE ticker IN ('SPY', 'KO', 'JNJ', 'MSFT', 'AAPL', 'NVDA', 'TSLA', 'COIN')\n      AND toDate(toTimeZone(window_start, 'America/New_York')) >= toDate('2025-08-01')\n      AND toDate(toTimeZone(window_start, 'America/New_York')) <= toDate('2026-07-31')\n      AND (toHour(toTimeZone(window_start, 'America/New_York')) * 60\n           + toMinute(toTimeZone(window_start, 'America/New_York'))) BETWEEN 570 AND 959\n    GROUP BY ticker, session\n),\nrets AS (\n    SELECT ticker,\n           toFloat64(session_close) AS close_px,\n           toFloat64(lagInFrame(session_close) OVER (PARTITION BY ticker ORDER BY session)) AS prev_close\n    FROM daily\n)\nSELECT ticker,\n       round(stddevSamp(close_px / prev_close - 1) * sqrt(252) * 100, 1) AS annualized_vol_pct,\n       round(abs(min(close_px / prev_close - 1)) * 100, 2) AS worst_day_pct\nFROM rets\nWHERE prev_close > 0\nGROUP BY ticker\nORDER BY annualized_vol_pct DESC","computed_at":"2026-08-02T08:19:52.413421+00:00","elapsed":0.00351628}