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
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน