INVITE-ONLY SCRIPT
MFI Divergence Indicator

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!
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!
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。