OPEN-SOURCE SCRIPT
ETF vs Top 10 VWAP Deviation

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).
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).
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.