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).
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.