PROTECTED SOURCE SCRIPT

Divergence Detector

50
๐Ÿ“ˆ Divergence Detector โ€“ Pine Script Indicator

๐ŸŽฏ Purpose

Detects bullish/bearish divergences between price and:

  • ๐Ÿ“Š WaveTrend
  • ๐Ÿ“ˆ RSI (Relative Strength Index)
  • ๐Ÿ“‰ Stochastic Oscillator


Divergences signal potential trend reversals.

โœจ Features & Advantages

โœ… Multi-Indicator Analysis โ€“ checks 3 oscillators simultaneously.
โœ… Customizable Filters โ€“ min. divergence length & distance between signals.
โœ… Clean Visuals โ€“ colored lines + labels for clarity.
โœ… Alerts โ€“ get notified when divergences appear.

โš™๏ธ Settings

๐Ÿ”น General

  • Pivot Lookback (15) โ€“ pivot detection depth.
  • Max Bars to Look Back (50) โ€“ limits divergence search range.
  • Min Divergence Length (6) โ€“ avoids noise.
  • Min Distance Between Signals (10) โ€“ prevents signal overcrowding.


๐Ÿ”น Indicators

WaveTrend:

  • Channel Length (9)
  • Average Length (12)
  • MA Length (3)


RSI: Length (14)

Stochastic:

  • Length (14)
  • K Smoothing (3)


๐Ÿ”น Colors & Style

  • Bullish (๐ŸŸข Green)
  • Bearish (๐Ÿ”ด Red)
  • Line Width (2)
  • Show Labels (ON/OFF)


๐Ÿ“– How to Use?

1. Bullish Divergence ๐ŸŸข:

  • Price โ†’ Lower Lows | Oscillator โ†’ Higher Lows = Potential UP reversal.


2. Bearish Divergence ๐Ÿ”ด:

  • Price โ†’ Higher Highs | Oscillator โ†’ Lower Highs = Potential DOWN reversal.


3. Alerts โ€“ enable in TradingView.

โš ๏ธ Limitations

โŒ False signals โ€“ not every divergence leads to a reversal.
โŒ Lagging โ€“ pivot-based detection delays signals.
โŒ Chart clutter โ€“ too many lines if unchecked.

๐Ÿ’ก Pro Tips

โœ” Combine with support/resistance levels.
โœ” Avoid using alone on low timeframes (M1-M15).
โœ” Adjust settings for your trading style (e.g., increase Min Divergence Length for daily charts).

โค๏ธ Support This Project

If you find this indicator helpful and want to support future developments, donations are appreciated at:

USDT (TRC20): THFFLEZSpTqapYF6oj9rmuTCQVUXvuz7VS

Your generosity helps maintain and improve free indicators for the trading community!

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.