Money Flow Divergence Zones [AlgoAlpha]🟠 OVERVIEW
This script identifies key price levels where volume and momentum show significant disagreement, visualizing these areas as Money Flow Liquidity Zones. By tracking the Money Flow Index (MFI) and its relationship to price action, the tool detects regular divergences that often precede market reversals. When a divergence is confirmed, the script projects a horizontal zone onto the chart based on the recent price extreme. These zones act as "liquidity pockets" that remain active until price successfully mitigates them through a wick or body cross, providing a clear map of potential support and resistance derived from volume-weighted momentum.
🟠 CONCEPTS
The core logic relies on the interaction between a smoothed MFI and pivot-based price extremes. While price might make a lower low, the MFI—calculated from $hlc3$ and volume—might make a higher low, signaling that selling pressure is exhausting despite the price drop. This script uses these divergences to set the initial context for a zone. The zones are then refined using a "Body vs Wick" logic, where the zone's depth is defined by the distance between the absolute high/low and the candle body. The MFI smoothing via a Hull Moving Average (HMA) ensures that the momentum signals are responsive yet filtered for high-frequency noise.
🟠 FEATURES
Dynamic Liquidity Zones : Automatically draws and extends support/resistance zones based on MFI divergence.
Divergence Engine : Detects regular bullish and bearish divergences with adjustable pivot lookbacks.
Visual Momentum Oscillator : Features a color-coded, smoothed MFI with a gradient midline to show volume strength.
Touch Signals : Small triangles appear when price interacts with an active zone while momentum aligns.
🟠 USAGE
Setup : Add the script to your chart. It is effective on most timeframes, but for intraday trading, the default 14-period MFI works well on 5m to 15m charts. Adjust the "Pivot Lookback" to fine-tune how sensitive the divergence detection is to local peaks.
Read the chart : Green zones represent bullish liquidity (potential support), while red zones represent bearish liquidity (potential resistance). Look for "▲" or "▼" symbols on the bars; these indicate price is currently touching a zone and might be ready for a reversal. The oscillator at the bottom confirms the trend: green for rising money flow and red for falling.
Settings that matter : The Sweep Type is critical—switching to "wick" will make zones disappear more easily (conservative), while "body" keeps zones active until a candle closes through them (aggressive). The Max Zone Age prevents old, irrelevant levels from cluttering your chart by removing them after a set number of bars.
Pine Script®指标






















