INVITE-ONLY SCRIPT

MFI Divergence Indicator

44
An AI-powered adaptation of the classic RSI divergence layout, now using Money Flow Index logic to catch volume-weighted trend exhaustion and continuations.

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!

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.