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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。