OPEN-SOURCE SCRIPT

CandelaCharts - Breadth Divergence

1 266
📝 Overview

The CandelaCharts - Breadth Divergence indicator identifies structural divergences between the primary chart's price action and a secondary breadth or macroeconomic symbol (such as VALUG (Value Line Geometric Index), AADD (Advance-Decline Issues), or US10Y (Treasury Yields)).

Because you can plug any custom ticker into the indicator, it functions perfectly as an inter-market or macro divergence tool. By analyzing pivot highs and lows, it detects when the underlying market breadth or macro environment fails to confirm the price movement, signaling potential market reversals.

  • Bearish Divergence: Occurs when the main chart makes a Higher High while the breadth/macro symbol makes a Lower High.
  • Bullish Divergence: Occurs when the main chart makes a Lower Low while the breadth/macro symbol makes a Higher Low.


📦 Features

  • Automated Divergence Detection: Accurately maps regular bullish and bearish divergences using customizable pivot points.
  • Customizable Breadth Symbol: Set any symbol to act as the breadth index to measure internal market strength.
  • Visual Clarity: Highlights divergence zones with clean lines connecting the pivots and shaded background boxes for easy identification.
  • Flexible Lookbacks: Complete control over pivot lookback lengths to adapt the sensitivity to any timeframe or volatility condition.


📈 Supported Assets & Timeframes

This indicator is universally compatible with any asset class (Equities, Crypto, Forex, Commodities, Indices) and any timeframe. To adapt the indicator to a different market, you only need to change a single input: the Breadth Symbol. For example:
  • S&P 500 (SPY, ES1!): Set the Breadth Symbol to AADD (Advance-Decline), VVOLD (Up/Down Volume), RSP (Equal Weight), or VALUG (Value Line).
  • Nasdaq 100 (QQQ, NQ1!): Set the Breadth Symbol to AADDQ (Nasdaq Advance-Decline), VVOLDQ, QQQE (Equal Weight), or VXN (Nasdaq Volatility).
  • Forex / Currencies (e.g. EURUSD, GBPUSD): Set the Breadth Symbol to DXY (US Dollar Index) or US10Y (US 10-Year Treasury Yield).
  • Crypto (BTCUSD): Set the Breadth Symbol to TOTAL3 (Altcoin Market Cap) or BTC.D (Bitcoin Dominance).


⚙️ Settings

  • Breadth Symbol: The ticker used to compare against the main chart (Default: VALUG - Value Line Geometric Index).
  • Pivot Left / Right: The number of bars required to the left and right to confirm a pivot high or low.
  • Bullish / Bearish Colors: Customize the color of the divergence lines and background boxes. The backgrounds automatically apply a 90% opacity to the chosen colors.


⚡️ Showcase

  • S&P 500 (ES1!) vs. VALUG: Show a bullish divergence where ES makes a lower low but the Value Line Geometric Index makes a higher low.
    cuplikan
  • Nasdaq 100 (NQ1!) vs. AADDQ: Highlight a scenario where the cap-weighted NQ pushes higher but the Nasdaq Advance-Decline diverges, signaling weakness in the broader tech sector.
    cuplikan
  • Ethereum (ETHUSD) vs. TOTAL3: Show a bearish divergence where Ethereum makes a higher high, but the broader Altcoin market cap fails to follow suit.
    cuplikan
  • Euro (EURUSD) vs. DXY: Display an inverse divergence setup using the US Dollar Index.
    cuplikan


🚨 Alerts

This indicator features built-in alerts using the `alert()` function. You can create an alert on the indicator to be notified whenever a Bullish or Bearish Breadth Divergence is detected.

⚠️ Disclaimer

Trading involves significant risk, and many participants may incur losses. The content on this site is not intended as financial advice and should not be interpreted as such. Decisions to buy, sell, hold, or trade securities, commodities, or other financial instruments carry inherent risks and are best made with guidance from qualified financial professionals. Past performance is not indicative of future results.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.