OPEN-SOURCE SCRIPT

ETF vs Top 10 VWAP Deviation

477
This indicator plots two lines in a separate pane: the ETF's own % deviation
from its session VWAP, and the equal-weighted average VWAP deviation of its
top 10 holdings. The gap between them reveals intraday divergence — moments
when the ETF is leading or lagging the basket of stocks that drive it most.

Supports SPY and QQQ. Holdings are hardcoded as of March 2026 (updated
quarterly on rebalances). To avoid double-weighting Alphabet, GOOG is
replaced by LLY (SPY) and NFLX (QQQ) as the 10th component.

VWAP is calculated manually per symbol as cumulative(HLC3 × Volume) /
cumulative(Volume), resetting each session — matching standard session VWAP.

━━━ BASKET MODE ━━━

- % from VWAP — (price − VWAP) / VWAP × 100. Zero = price at VWAP.
Positive = above, negative = below. Directly comparable across symbols.


━━━ VISUALS ━━━

- Blue line = ETF | Orange line = Top 10 basket

- Graduated OB/OS bands at ±0.25, ±0.50, ±0.75, ±1.00
(yellow → orange → red, deepening with distance from zero)

━━━ USAGE NOTES ━━━

- Designed for intraday only. A runtime error is thrown
on weekly/monthly charts by design.
- Works best on SPY or QQQ charts directly. Running it on another symbol will
still calculate correctly but the ETF line will reflect that symbol's price.
- Holdings require manual updates on significant index rebalances (quarterly).

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.