Gradient Money Flow Divergence Detector
Jul 25, 2023

The Gradient Money Flow Divergence Detector indicator provides a comprehensive look at market momentum and volume-weighted price movement by combining a color-graded Money Flow Index (MFI) with multi-timeframe divergence detection. This tool allows traders to identify potential trend reversals and strength shifts across four distinct lookback horizons—micro, sub-mid, mid, and macro—while visually tracking overbought and oversold conditions.
Usage
The tool is primarily used to identify market exhaustion and trend changes through price/oscillator discrepancies.
- Divergence Analysis: The script automatically identifies bullish and bearish divergences across four sensitivity levels. Bullish signals appear when price makes a lower low while the MFI makes a higher low; bearish signals appear when price makes a higher high while the MFI makes a lower high.
- Gradient Money Flow: The main line changes color based on the current MFI value relative to its recent range, providing a visual cue of the buying or selling pressure intensity.
- Threshold Monitoring: Use the 80 and 20 horizontal levels to identify overbought or oversold conditions. A move above 80 suggests a potential top, while a drop below 20 suggests a potential bottom.
- Confluence: When multiple divergence lookbacks (e.g., Micro and Macro) trigger simultaneously, it indicates a stronger potential for a trend reversal.
Details
The indicator calculates the standard Money Flow Index using price and volume data. Unlike standard oscillators, the gradient implementation normalizes the MFI value within its recent lookback period to determine the line's color, helping to distinguish between absolute values and relative momentum.
The divergence logic uses pivot points to identify peaks and troughs in both price and the MFI. By checking for these conditions across four different lookback settings (Micro, Sub-Mid, Mid, and Macro), the tool captures everything from short-term scalping opportunities to major structural shifts.
Settings
- Length: The period used to calculate the Money Flow Index.
- Micro Div Lookback: Pivot lookback for identifying very short-term divergences.
- Sub-Mid Div Lookback: Pivot lookback for identifying intermediate-short divergences.
- Mid Div Lookback: Pivot lookback for identifying medium-term divergences.
- Macro Div Lookback: Pivot lookback for identifying long-term structural divergences.
FAQ
How do I interpret the different colored divergence signals?
The colors are used to distinguish between bullish (green) and bearish (red) signals across the various lookback periods. These signals indicate when the price trend is losing momentum relative to volume flow.
Can I set alerts for these divergences?
Yes, the script includes alert conditions for both bullish and bearish divergences across any of the lookback periods, as well as crosses of the overbought (80) and oversold (20) levels.
How do I access this indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

