OPEN-SOURCE SCRIPT
Smart Price Divergence (MACD Filter) + EMA

Smart MACD Price Divergence + EMA
This indicator automatically spots price divergences filtered by MACD momentum and trend direction with an adjustable EMA:
🔹 Detects regular bullish & bearish divergences
🔹 Filters signals using a simple EMA trend filter
🔹 Clear triangle labels on the chart
🔹 Ready-to-use alerts for your strategy
Use it to catch potential reversal points when the trend may be losing strength.
How it works
Bearish Divergence: Price makes a higher high above the EMA while MACD makes a lower high → possible reversal down.
Bullish Divergence: Price makes a lower low below the EMA while MACD makes a higher low → possible reversal up.
EMA filter: Helps identify when the market is overextended relative to its trend.
The indicator uses standard MACD settings (fast, slow, and signal lengths) which can be adjusted to fit your asset and timeframe. The EMA length is also fully customizable.
Signal colors
🔻 Red triangle — Bearish Price Divergence (potential short)
🔺 Green triangle — Bullish Price Divergence (potential long)
This script works on any timeframe and market — crypto, forex, indices, or stocks. Signals do not repaint once confirmed.
⚠️ Disclaimer: This script is for educational purposes only and does not constitute financial advice. Always test any strategy thoroughly and trade at your own risk.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.