OPEN-SOURCE SCRIPT
SPX Sector AD + Iceberg TICK

This indicator is a "Market Internals" engine designed to reveal the true strength of S&P 500 moves. By looking under the hood of the index, it helps traders distinguish between broad market participation and rallies driven solely by heavyweights (the "Magnificent 7").
It combines three powerful concepts into a single pane: Sector Breadth, Buying Aggression (TICK), and Trend Following.
1. The Core: Weighted vs. Unweighted Divergence
Weighted Histogram (The Generals): Represents the S&P 500 performance based on sector market cap (e.g., Tech/XLK has a ~33% impact, while Utilities/XLU has ~2%). When these bars are strong, the mega-caps are moving.
Unweighted Line (The Soldiers): Represents the average performance of all 11 sectors equally. When this line rises, there is broad market participation.
The Edge: Spot divergences. If the Weighted Bars are rising but the Unweighted Line is falling, the rally is narrow and potentially fragile (a "General's Rally").
2. The Iceberg: Cumulative TICK
A scaled cumulative TICK line is plotted in the background (the "Iceberg").
This visualizes the raw buying vs. selling aggression on the NYSE throughout the session.
Green Iceberg: Persistent buying pressure / accumulation.
Red Iceberg: Persistent selling pressure / distribution.
3. The Signal: Breadth Trend
Instead of generating signals on price, this script applies ATR Trailing Stop logic directly to the Weighted AD Line.
Buy Signal (B): Triggers when the internal sector strength breaks above its own volatility band.
Sell Signal (S): Triggers when sector momentum breaks down.
This often provides an earlier warning of trend changes than price action alone.
How to Use
Bullish Confirmation: Price is rising + Green Histogram + Green Iceberg + Unweighted Line rising.
Bearish Divergence: Price makes a new High, but the Breadth Bot prints a lower High or a Sell signal.
Rotation: If the Histogram is flat but the Unweighted Line is ripping higher, capital is rotating from Mega Caps into the broader market.
Settings:
Includes customizable weights for all 11 SPDR Sectors.
Adjustable "Visual Divisor" for the TICK to fit it perfectly behind your sector data.
Customizable ATR settings for the Breadth signals.
It combines three powerful concepts into a single pane: Sector Breadth, Buying Aggression (TICK), and Trend Following.
1. The Core: Weighted vs. Unweighted Divergence
Weighted Histogram (The Generals): Represents the S&P 500 performance based on sector market cap (e.g., Tech/XLK has a ~33% impact, while Utilities/XLU has ~2%). When these bars are strong, the mega-caps are moving.
Unweighted Line (The Soldiers): Represents the average performance of all 11 sectors equally. When this line rises, there is broad market participation.
The Edge: Spot divergences. If the Weighted Bars are rising but the Unweighted Line is falling, the rally is narrow and potentially fragile (a "General's Rally").
2. The Iceberg: Cumulative TICK
A scaled cumulative TICK line is plotted in the background (the "Iceberg").
This visualizes the raw buying vs. selling aggression on the NYSE throughout the session.
Green Iceberg: Persistent buying pressure / accumulation.
Red Iceberg: Persistent selling pressure / distribution.
3. The Signal: Breadth Trend
Instead of generating signals on price, this script applies ATR Trailing Stop logic directly to the Weighted AD Line.
Buy Signal (B): Triggers when the internal sector strength breaks above its own volatility band.
Sell Signal (S): Triggers when sector momentum breaks down.
This often provides an earlier warning of trend changes than price action alone.
How to Use
Bullish Confirmation: Price is rising + Green Histogram + Green Iceberg + Unweighted Line rising.
Bearish Divergence: Price makes a new High, but the Breadth Bot prints a lower High or a Sell signal.
Rotation: If the Histogram is flat but the Unweighted Line is ripping higher, capital is rotating from Mega Caps into the broader market.
Settings:
Includes customizable weights for all 11 SPDR Sectors.
Adjustable "Visual Divisor" for the TICK to fit it perfectly behind your sector data.
Customizable ATR settings for the Breadth signals.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.