OPEN-SOURCE SCRIPT
Advance-Decline Line

Advance-Decline Line — Market Breadth Indicator
The NYSE Advance-Decline Line measures the internal health of the broad market by tracking how many stocks are actually participating in any given move — not just the mega-caps driving the index.
Every session the NYSE reports how many stocks closed up (advances) vs. down (declines). This indicator plots the raw daily difference as a histogram and applies two EMAs to identify the underlying breadth trend, cutting through daily noise to reveal the true market regime.
Why price alone isn't enough
The S&P 500 is market-cap weighted. Apple, Microsoft, and Nvidia can hold the index up while the other 490 stocks quietly deteriorate. The A/D Line weights every stock equally — exposing that divergence immediately. The classic example: the NYSE A/D Line peaked nearly two years before the Nasdaq crashed in 2000, giving attentive traders ample warning.
Background color — the regime signal
🟢 Green — Fast EMA > Slow EMA AND Slow EMA > 0. Broad market breadth is healthy. Favorable conditions for long positions.
🟠 Orange — Mixed signals. One condition is met but not both. Breadth is transitioning — proceed with caution.
🔴 Red — Fast EMA < Slow EMA AND Slow EMA < 0. Breadth is weak across most stocks. Historically, breakouts fail at a much higher rate in this regime.
Histogram bars
Each bar shows the raw daily breadth pulse — teal when more stocks advanced, red when more declined. Individual bars provide context; the background color reflects the dominant trend via the two EMAs.
Settings
Fast EMA (default 50)
Slow EMA (default 200) — moves slowly, only reverses during genuine regime shifts
Alerts
Breadth Turning Bullish — Fast EMA crossed above Slow EMA
Breadth Turning Bearish — Fast EMA crossed below Slow EMA
Slow EMA Above Zero — breadth trend fully positive
Slow EMA Below Zero — breadth trend fully negative
The NYSE Advance-Decline Line measures the internal health of the broad market by tracking how many stocks are actually participating in any given move — not just the mega-caps driving the index.
Every session the NYSE reports how many stocks closed up (advances) vs. down (declines). This indicator plots the raw daily difference as a histogram and applies two EMAs to identify the underlying breadth trend, cutting through daily noise to reveal the true market regime.
Why price alone isn't enough
The S&P 500 is market-cap weighted. Apple, Microsoft, and Nvidia can hold the index up while the other 490 stocks quietly deteriorate. The A/D Line weights every stock equally — exposing that divergence immediately. The classic example: the NYSE A/D Line peaked nearly two years before the Nasdaq crashed in 2000, giving attentive traders ample warning.
Background color — the regime signal
🟢 Green — Fast EMA > Slow EMA AND Slow EMA > 0. Broad market breadth is healthy. Favorable conditions for long positions.
🟠 Orange — Mixed signals. One condition is met but not both. Breadth is transitioning — proceed with caution.
🔴 Red — Fast EMA < Slow EMA AND Slow EMA < 0. Breadth is weak across most stocks. Historically, breakouts fail at a much higher rate in this regime.
Histogram bars
Each bar shows the raw daily breadth pulse — teal when more stocks advanced, red when more declined. Individual bars provide context; the background color reflects the dominant trend via the two EMAs.
Settings
Fast EMA (default 50)
Slow EMA (default 200) — moves slowly, only reverses during genuine regime shifts
Alerts
Breadth Turning Bullish — Fast EMA crossed above Slow EMA
Breadth Turning Bearish — Fast EMA crossed below Slow EMA
Slow EMA Above Zero — breadth trend fully positive
Slow EMA Below Zero — breadth trend fully negative
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.