OPEN-SOURCE SCRIPT

RSI/MFI Divergence Finder [idahodev]

업데이트됨
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
릴리즈 노트
  • 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
릴리즈 노트
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

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항