MFI Divergence Indicator

Logic & Design
We started with the structure of a popular RSI-Divergence template—swing pivots on left/right lookbacks, high/low swing comparisons, hidden vs. regular patterns, and clean plot/alert calls.
We replaced the RSI oscillator with MFI, folding volume into each reading so divergences spot true institutional flow shifts rather than just price momentum.
The script detects four core patterns:
Regular Bullish (price ↓↓ + MFI ↗↗)
Hidden Bullish (price ↗ higher low + MFI ↘ lower low)
Regular Bearish (price ↑↑ + MFI ↘↘)
Hidden Bearish (price ↘ lower high + MFI ↗ higher high)
A single “Any MFI Divergence” alert fires on any of the above, so you only ever need one alert in TradingView.
AI-Assisted Code
This indicator was generated and optimized by an AI assistant—ensuring modern Pine-v6 compatibility, clean input validation, and ready-to-publish formatting. Feel free to inspect, tweak, and extend!
Yalnızca davetli komut dosyası
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact lirim_p directly.
TradingView, yazarına tam olarak güvenmediğiniz ve nasıl çalıştığını anlamadığınız sürece bir komut dosyası için ödeme yapmanızı veya kullanmanızı ÖNERMEZ. Ayrıca topluluk komut dosyaları bölümümüzde ücretsiz, açık kaynaklı alternatifler bulabilirsiniz.
Yazarın talimatları
Uyarı: Erişim talebinde bulunmadan önce lütfen yalnızca davetli komut dosyaları kılavuzumuzu okuyun.
Feragatname
Yalnızca davetli komut dosyası
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact lirim_p directly.
TradingView, yazarına tam olarak güvenmediğiniz ve nasıl çalıştığını anlamadığınız sürece bir komut dosyası için ödeme yapmanızı veya kullanmanızı ÖNERMEZ. Ayrıca topluluk komut dosyaları bölümümüzde ücretsiz, açık kaynaklı alternatifler bulabilirsiniz.
Yazarın talimatları
Uyarı: Erişim talebinde bulunmadan önce lütfen yalnızca davetli komut dosyaları kılavuzumuzu okuyun.