{"slug":"anchored-vwap-explained","qid":"weight_of_the_newest_bar","label":"How much the newest session can move an anchored VWAP (AAPL)","post_title":"Anchored VWAP Explained: Formula and Uses","post_url":"/blog/anchored-vwap-explained#q-weight_of_the_newest_bar","columns":["bars_since_anchor","newest_bar_weight_pct"],"rows":[{"bars_since_anchor":10,"newest_bar_weight_pct":30.09},{"bars_since_anchor":20,"newest_bar_weight_pct":8.09},{"bars_since_anchor":30,"newest_bar_weight_pct":4.44},{"bars_since_anchor":40,"newest_bar_weight_pct":2.3},{"bars_since_anchor":50,"newest_bar_weight_pct":1.65},{"bars_since_anchor":60,"newest_bar_weight_pct":1.62},{"bars_since_anchor":70,"newest_bar_weight_pct":1.28},{"bars_since_anchor":80,"newest_bar_weight_pct":1.24},{"bars_since_anchor":90,"newest_bar_weight_pct":1.35},{"bars_since_anchor":100,"newest_bar_weight_pct":0.99},{"bars_since_anchor":110,"newest_bar_weight_pct":1.15},{"bars_since_anchor":120,"newest_bar_weight_pct":0.99},{"bars_since_anchor":130,"newest_bar_weight_pct":2.14}],"shape":"ranking","sql":"WITH running AS (\n    SELECT\n        row_number() OVER (ORDER BY date) AS n,\n        toFloat64(volume)\n      / sum(toFloat64(volume)) OVER (ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS weight\n    FROM global_markets.stocks_daily_aggs\n    WHERE ticker = 'AAPL'\n      AND date >= '2026-01-02'\n      AND date <= '2026-06-30'\n)\nSELECT\n    intDiv(n - 1, 10) * 10 + 10 AS bars_since_anchor,\n    round(100 * avg(weight), 2) AS newest_bar_weight_pct\nFROM running\nGROUP BY bars_since_anchor\nORDER BY bars_since_anchor","computed_at":"2026-08-07T15:34:21.833089+00:00","elapsed":0.002251527}