UAlgo

Money Flow Index Divergences [UAlgo]

🔶 Description:

This script aims providing traders with comprehensive insights into market dynamics. The indicator offers a multi-faceted approach to technical analysis, encompassing various features to enhance trading decision-making:

🔶Key Features:

Money Flow Index Oscillator Settings: Users can customize the length of the MFI oscillator and the confluence bar length to suit their trading preferences.

Gradient Color Visualization: The indicator utilizes gradient colors to visually represent the MFI oscillator, with colors shifting based on MFI values for enhanced clarity.

Confluence Area Calculation: A confluence area is calculated based on the specified length, providing additional context for MFI movements (Aims to provide longer-term information).

Divergence Detection: The script identifies bullish and bearish divergences by comparing price action with MFI oscillator movements, aiding traders in spotting potential trend reversals.

Customizable Sensitivity: Traders can adjust the sensitivity settings for divergence detection according to their trading strategies.


🔶Calculations:

MFI Calculation:

The script starts by calculating the Money Flow Index (MFI) using the ta.mfi() function, which takes the typical price (hlc3) and a length parameter (default set to 14). The MFI is normalized to a range between 0 and 1 for color gradient calculations.

Another MFI is calculated with a longer length (lengthConfluence, default set to 50) for confluence analysis. Similar to the MFI calculation, the highest and lowest MFI values within the confluence length are determined. The MFI values within the confluence length are normalized. The normalized MFI values are used to calculate the gradient color for the confluence area.

Gradient Color Calculations:

Two sets of RGB color values (redRGB, greenRGB, blueRGB) and (redRGB2, greenRGB2, blueRGB2) are defined to create a gradient color scheme for the MFI plot. The MFI value is normalized between the highest and lowest MFI values within the specified length. The normalized MFI value is then used to calculate the red, green, and blue components of the gradient color.

Plotting Confluence Area:

Two horizontal lines (upperArea and lowerArea) are plotted to highlight the confluence area.
The area between these lines is filled with the gradient color representing MFI confluence.
Divergence Calculations:

Bullish and bearish divergences are identified based on specific conditions related to the MFI and price action.

Bullish divergence occurs when the MFI makes a lower low while price makes a higher low.

Bearish divergence occurs when the MFI makes a higher high while price makes a lower high.

The sensitivity (Pivot calculation length) of divergence detection can be adjusted.

Overall, this script provides a comprehensive analysis of the Money Flow Index, including plotting the MFI with a gradient color scheme, identifying confluence areas, and detecting bullish and bearish divergences to aid traders in making informed decisions.

🔶Disclaimer:

-This script is provided for informational and educational purposes only and should not be considered financial advice.

-Trading involves risk, and users should conduct their own research and analysis before making any investment decisions.

-The author of this script and UAlgo are not liable for any losses incurred as a result of using this indicator.

-Users are encouraged to exercise caution and practice risk management when trading in the financial markets.

Join Our Journey ! -> ualgo.trade

Join Our Discord For Updates: discord.com/invite/kyQkKxUQkW

All scripts & Content Provided by UAlgo Are For Informational & Educational Purposes Only.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?