All indicators

MFI Divergence Indicator

Dec 20, 2021

Static chart image
Volume BasedSignalsOscillatorsDivergencesPivot Based (Retrospective)

The MFI Divergence Indicator tool identifies potential trend reversals and continuation patterns by detecting regular and hidden divergences between price action and the Money Flow Index (MFI).

Usage

The MFI Divergence Indicator is primarily used to spot momentum shifts that may not be immediately visible on a price chart. Because the MFI incorporates volume data, it can offer higher precision than the RSI in identifying significant buying or selling pressure.

  • Regular Bullish Divergence: Occurs when price makes a lower low while MFI makes a higher low. This suggests waning bearish momentum and a potential upward reversal.
  • Regular Bearish Divergence: Occurs when price makes a higher high while MFI makes a lower high, indicating weakening bullish momentum.
  • Hidden Bullish Divergence: Occurs when price makes a higher low while MFI makes a lower low, often signaling a continuation of an existing uptrend.
  • Hidden Bearish Divergence: Occurs when price makes a lower high while MFI makes a higher high, often signaling a continuation of an existing downtrend.

Users can also toggle the display of the RSI to compare how the MFI behaves relative to price strength alone. When MFI and RSI are closely aligned (within a 20-point difference), the MFI line changes color to highlight the correlation.

Details

Divergences are calculated based on pivot points, which are defined by a specific number of bars to the left and right. Since a pivot point requires "right strength" (future bars) to be confirmed, these signals are naturally lagging. For example, with a default "Pivot Lookback Right" of 5, a divergence label will appear on the chart 5 bars after the actual peak or trough has occurred.

The indicator evaluates the range between the current pivot and the previous one to ensure the divergence falls within the user-defined "Lookback Range" settings.

Settings

  • MFI Period: Sets the number of bars used to calculate the Money Flow Index.
  • MFI Source: Determines the price source (e.g., Close) used for the MFI calculation.
  • Plot Bullish / Hidden Bullish / Bearish / Hidden Bearish: Toggles the visibility of specific divergence types on the chart.
  • Pivot Lookback Right: The number of bars to the right of a high or low required to confirm a pivot point.
  • Pivot Lookback Left: The number of bars to the left of a high or low required to confirm a pivot point.
  • Max of Lookback Range: The maximum number of bars allowed between two pivots to qualify for a divergence.
  • Min of Lookback Range: The minimum number of bars allowed between two pivots to qualify for a divergence.
  • Show RSI: When enabled, displays a light blue RSI line using the same period settings as the MFI for comparison.

FAQ

How do I use the MFI Divergence Indicator?

You can use it to identify exhaustion in the current trend (Regular Divergence) or to find entries in the direction of the prevailing trend (Hidden Divergence). It is best used in conjunction with other technical analysis tools.

Why do the signals appear several bars late?

The signals rely on pivot points, which require a certain number of bars to the right (Pivot Lookback Right) to confirm that a local high or low has been formed.

How can I access this indicator?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.