OPEN-SOURCE SCRIPT

SPX Sector AD + Iceberg TICK

47
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.

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.