OPEN-SOURCE SCRIPT

RSI/MFI Divergence Finder [idahodev]

Mis à jour
Monitoring RSI (Relative Strength Index) and MFI (Money Flow Index) divergences on a stock or index chart offers several benefits to traders and analysts. Let's break down the advantages:

  • Comprehensive Market View: Combining both indicators provides a more complete picture of market conditions, as they measure different aspects of price movement. RSI focuses on recent gains/losses relative to price change, while MFI incorporates volume data to assess money flow in and out of a security.
  • Enhanced Signal Accuracy: When divergences occur simultaneously in both RSI and MFI, it may be considered a stronger signal than if only one indicator showed divergence. This can potentially lead to more reliable trading decisions.
  • Identification of False Breakouts: Divergences between these indicators and price action can help identify false breakouts or misleading price movements that are not supported by underlying market strength or volume.
  • More Nuanced Market Understanding: By examining divergent behavior between money flow (MFI) and momentum (RSI), traders gain a more detailed comprehension of the interplay between these factors in shaping market trends.
  • Early Warning Signs: These divergences can act as early warning signs for potential trend reversals or changes in market sentiment, allowing traders to adjust their strategies proactively.


It's important to note that RSI/MFI divergences should be used as part of a broader trading strategy rather than solely relying on them for buy/sell signals. They can serve as valuable tools for confirming trends, identifying potential turning points, or warning against overbought/oversold conditions.

When using these indicators together, traders must be cautious of false signals, especially in choppy markets or during periods of high volatility. It's crucial to combine this analysis with other technical and fundamental factors before making trading decisions.

In summary, monitoring RSI/MFI divergences may offer a way to gain insights into the underlying strengths and weaknesses of market movements.

This utility differs from other in that it allows for a choke/threshold/sensitivity setting to help weed out noisy signals. This needs to be carefully adjusted per chart.

It also allows for tuning of the MFI smoothing length (number of bars on the current chart) as well as how many previous bars it will take into consideration when calculating RSI and MFI divergences. It will signal when it sees alignment forming between RSI and MFI divergences in a direction. You will likely need to tune this script's settings every few days or at least anytime there is a change in overall market behavior or sustained volatility.

Ultimately, the goal with this script is to provide an additional level of confirmation of weakness or strength. It should be combined with other indicators such as exhaustion, pivots, supply/demand, trendline breaks or tests, and structure changes, to name a few complementary tools or strategies. It's not meant to be a standalone buy/sell signal indicator!

Here are some settings for futures that may help you get started:

ES (4m chart)
  • RSI Length: 26
  • MFI Length: 8
  • MFI Smoothing Length: 32
  • Divergence Sensitivity: 124
  • Left Bars for Pivot: 10
  • Right Bars for Pivot: 1


NQ (4m chart)
  • RSI Length: 14
  • MFI Length: 14
  • MFI Smoothing Length: 21
  • Divergence Sensitivity: 400
  • Left Bars for Pivot: 21
  • Right Bars for Pivot: 1


YM (4m chart)
  • RSI Length: 14
  • MFI Length: 14
  • MFI Smoothing Length: 21
  • Divergence Sensitivity: 810
  • Left Bars for Pivot: 33
  • Right Bars for Pivot: 1
Notes de version
  • Updated 11/19/2024 - Added RSI smoothing, plotting of RSI and MFI overlay
  • Released 10/18/2024


Monitoring RSI (Relative Strength Index) and MFI (Money Flow Index) divergences on a stock or index chart offers several benefits to traders and analysts. Let's break down the advantages:

  • Comprehensive Market View: Combining both indicators provides a more complete picture of market conditions, as they measure different aspects of price movement. RSI focuses on recent gains/losses relative to price change, while MFI incorporates volume data to assess money flow in and out of a security.
  • Enhanced Signal Accuracy: When divergences occur simultaneously in both RSI and MFI, it may be considered a stronger signal than if only one indicator showed divergence. This can potentially lead to more reliable trading decisions.
  • Identification of False Breakouts: Divergences between these indicators and price action can help identify false breakouts or misleading price movements that are not supported by underlying market strength or volume.
  • More Nuanced Market Understanding: By examining divergent behavior between money flow (MFI) and momentum (RSI), traders gain a more detailed comprehension of the interplay between these factors in shaping market trends.
  • Early Warning Signs: These divergences can act as early warning signs for potential trend reversals or changes in market sentiment, allowing traders to adjust their strategies proactively.


It's important to note that RSI/MFI divergences should be used as part of a broader trading strategy rather than solely relying on them for buy/sell signals. They can serve as valuable tools for confirming trends, identifying potential turning points, or warning against overbought/oversold conditions.

When using these indicators together, traders must be cautious of false signals, especially in choppy markets or during periods of high volatility. It's crucial to combine this analysis with other technical and fundamental factors before making trading decisions.

In summary, monitoring RSI/MFI divergences may offer a way to gain insights into the underlying strengths and weaknesses of market movements.

This utility differs from other in that it allows for a choke/threshold/sensitivity setting to help weed out noisy signals. This needs to be carefully adjusted per chart.

It also allows for tuning of the MFI smoothing length (number of bars on the current chart) as well as how many previous bars it will take into consideration when calculating RSI and MFI divergences. It will signal when it sees alignment forming between RSI and MFI divergences in a direction. You will likely need to tune this script's settings every few days or at least anytime there is a change in overall market behavior or sustained volatility.

Ultimately, the goal with this script is to provide an additional level of confirmation of weakness or strength. It should be combined with other indicators such as exhaustion, pivots, supply/demand, trendline breaks or tests, and structure changes, to name a few complementary tools or strategies. It's not meant to be a standalone buy/sell signal indicator!

Here are some settings for futures that may help you get started:

ES (4m chart)
RSI Length: 26
MFI Length: 8
MFI Smoothing Length: 32
Divergence Sensitivity: 124
Left Bars for Pivot: 10
Right Bars for Pivot: 1
NQ (4m chart)
  • RSI Length: 14
  • RSI Smoothing Length: Adjust as needed
  • MFI Length: 14
  • MFI Smoothing Length: 21
  • Divergence Sensitivity: 400
  • Left Bars for Pivot: 21
  • Right Bars for Pivot: 1


YM (4m chart)
  • RSI Length: 14
  • RSI Smoothing Length: Adjust as needed
  • MFI Length: 14
  • MFI Smoothing Length: 21
  • Divergence Sensitivity: 810
  • Left Bars for Pivot: 33
  • Right Bars for Pivot: 1
Notes de version
v3
Add experimental confidence indicator that makes signals more transparent when the divergence is weaker and more opaque when the divergence is stronger.

Requires tuning per chart and likely any time there is a significant shift in market behavior.
mfi_divergenceMoving Averagesrsi_divergenceSupport and ResistanceTrend Analysis

Script open-source

Dans le plus pur esprit TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par nos Règles. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?

Clause de non-responsabilité