OPEN-SOURCE SCRIPT

ETF vs Top 10 VWAP Deviation

476
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).

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.