INVITE-ONLY SCRIPT

MFI Divergence Indicator

41
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!

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.