Systemicalpha

Money Flow Index

systemic:core-mfiIndicatorsfunction1 cr

Inputs

NameTypeDescription
WindowintegerThe number of periods used to calculate positive and negative money flow sums.
Price HighfloatarrayThe highest traded price for each period in the input series.
Price LowfloatarrayThe lowest traded price for each period in the input series.
Price ClosefloatarrayThe final traded price for each period in the input series.
VolumefloatarrayThe trading volume for each period—the total quantity of the asset exchanged.

Outputs

NameTypeDescription
MfifloatarrayThe Money Flow Index value for each period—a bounded oscillator ranging from 0 to 100.

The Problem RSI Couldn't Solve

In the 1980s, J. Welles Wilder's RSI had become the go-to momentum oscillator. Traders everywhere used it. But two technical analysts—Gene Quong and Avrum Soudack—noticed something troubling.

Consider two price movements:

  1. Stock rises 5% on 50% below-average volume
  2. Stock rises 5% on 200% above-average volume

RSI shows identical readings for both. But any experienced trader knows these are completely different situations. The first might be a weak drift; the second signals institutional conviction.

Quong and Soudack's insight: Volume is the missing variable.

In the late 1980s, they created the Money Flow Index—essentially RSI with volume baked in. Instead of tracking just price momentum, MFI tracks where the money is actually flowing.

💡 MFI answers the question RSI can't: "Is real money backing this move?"


Why This Matters

Traditional momentum oscillators measure speed. MFI measures conviction.

ScenarioPrice ChangeVolumeRSI SaysMFI Says
Weak rally+3%Low"Momentum up""Weak—no conviction"
Strong rally+3%High"Momentum up""Strong—money flowing in"
Distribution+1%Very high"Slight momentum""Smart money selling"

This volume context makes MFI particularly valuable for:

  • Spotting divergences between price and money flow
  • Confirming breakouts with real buying pressure
  • Identifying distribution (smart money exiting) before price drops

Mathematical Foundation

Step 1: Typical Price

TP=High+Low+Close3\text{TP} = \frac{\text{High} + \text{Low} + \text{Close}}{3}

The Typical Price represents the average price for each period.

Step 2: Raw Money Flow

Raw Money Flow=TP×Volume\text{Raw Money Flow} = \text{TP} \times \text{Volume}

This quantifies the dollar value traded during the period.

Step 3: Classify Money Flow

ConditionClassification
TP > Previous TPPositive Money Flow
TP < Previous TPNegative Money Flow
TP = Previous TPNeutral (typically excluded)

Step 4: Money Flow Ratio

MFR=∑Positive Money Flow∑Negative Money Flow\text{MFR} = \frac{\sum \text{Positive Money Flow}}{\sum \text{Negative Money Flow}}

Summed over the lookback window (typically 14 periods).

Step 5: Money Flow Index

MFI=100−1001+MFR\text{MFI} = 100 - \frac{100}{1 + \text{MFR}}

This normalizes the ratio to a 0-100 scale, where:

  • Higher values indicate more buying pressure
  • Lower values indicate more selling pressure

Visual Calculation Flow

flowchart TB
    subgraph INPUT["📥 OHLCV Data"]
        H["High"]
        L["Low"]
        C["Close"]
        V["Volume"]
    end
    
    subgraph CALC1["🧮 Typical Price"]
        TP["TP = (H + L + C) / 3"]
    end
    
    subgraph CALC2["💰 Raw Money Flow"]
        RMF["RMF = TP × Volume"]
    end
    
    subgraph CLASS["📊 Classify"]
        POS["Positive Flow<br/>(TP rising)"]
        NEG["Negative Flow<br/>(TP falling)"]
    end
    
    subgraph RATIO["📈 Money Flow Ratio"]
        MFR["Sum Positive / Sum Negative"]
    end
    
    subgraph OUTPUT["🎯 MFI Output"]
        MFI["100 - 100/(1 + MFR)"]
    end
    
    H --> TP
    L --> TP
    C --> TP
    TP --> RMF
    V --> RMF
    RMF --> POS
    RMF --> NEG
    POS --> MFR
    NEG --> MFR
    MFR --> MFI
    
    style OUTPUT fill:#d5f5e3,stroke:#27ae60

Interpreting MFI

Standard Thresholds

MFI LevelInterpretation
> 80Overbought — potential selling pressure ahead
50Neutral — balanced buying/selling
< 20Oversold — potential buying pressure ahead

MFI vs Price Divergence

Divergence TypePriceMFISignal
BullishLower lowsHigher lowsSmart money accumulating
BearishHigher highsLower highsSmart money distributing

Divergences are particularly powerful with MFI because they suggest that volume-backed conviction doesn't match price direction.


Trading Strategies

Strategy 1: Overbought/Oversold

The classic mean-reversion approach.

ConditionAction
MFI crosses below 20 from abovePotential buy signal
MFI crosses above 80 from belowPotential sell signal

Best in: Range-bound markets. Avoid in: Strong trends.

Strategy 2: Failure Swings

More reliable than simple threshold crosses.

Bullish Failure Swing:

  1. MFI falls below 20
  2. MFI rallies above 20
  3. MFI pulls back but stays above 20
  4. MFI breaks above prior high → Buy

Bearish Failure Swing:

  1. MFI rises above 80
  2. MFI falls below 80
  3. MFI bounces but stays below 80
  4. MFI breaks below prior low → Sell

Strategy 3: Volume Confirmation

Use MFI to confirm price breakouts.

ScenarioMFI BehaviorInterpretation
Price breaks resistanceMFI rising toward 80Strong breakout — volume confirms
Price breaks resistanceMFI falling or flatWeak breakout — lack of conviction

IndicatorUses Volume?ScaleBest For
MFI✅ Yes0-100Volume-confirmed reversals
RSI❌ No0-100Pure price momentum
CMF✅ Yes-1 to +1Accumulation/distribution
OBV✅ YesUnboundedTrend confirmation
A/D Line✅ YesUnboundedLong-term accumulation

When to Choose MFI

  • You want overbought/oversold signals backed by volume
  • You suspect price moves aren't supported by real money flow
  • You want to confirm breakouts with volume conviction

Configuration

Window Parameter

WindowEffectUse Case
7More responsive, more signalsShort-term trading, volatile assets
14 (default)BalancedMost situations
21Smoother, fewer signalsSwing trading, less noise

Input Requirements

InputDescription
HighPeriod high price
LowPeriod low price
ClosePeriod closing price
VolumeTrading volume

Note: All four inputs must be the same length and from the same timeframe.


When MFI Excels

Ranging Markets

  • Overbought/oversold signals work beautifully
  • Mean reversion trades have volume confirmation
  • Failure swings provide clear reversal setups

Breakout Confirmation

  • High MFI during breakout = volume conviction
  • Low MFI during breakout = likely false breakout

Divergence Trading

  • Volume-backed divergences are more reliable than price-only
  • Reveals accumulation/distribution before price moves
  • "Smart money" patterns become visible

Multi-Asset Comparison

  • Same 0-100 scale across all assets
  • Easily compare buying pressure across portfolio

When MFI Struggles

Strong Trends

  • Stays overbought during powerful uptrends
  • Stays oversold during powerful downtrends
  • Overbought ≠ "sell" in a bull market

No Volume Data

  • Useless for forex spot (no centralized volume)
  • Crypto volume varies by exchange
  • Some indices lack meaningful volume

Choppy Markets

  • Generates many false signals
  • Whipsaws around thresholds
  • Requires additional filters

Lagging Nature

  • Based on historical data
  • Signals come after moves start
  • Not predictive—reactive

Summary

AspectDetail
Full NameMoney Flow Index
InventorsGene Quong & Avrum Soudack (late 1980s)
Core IdeaRSI + Volume = Money conviction
Formula100−1001+MFR100 - \frac{100}{1 + MFR} where MFR = Positive Flow ÷ Negative Flow
Range0 to 100
Overbought> 80
Oversold< 20
RequiresHigh, Low, Close, Volume
Default Period14
Best ForVolume-confirmed reversals, divergences
WeaknessFails in strong trends, needs volume data

Combining MFI with Other Modules

CombinationPurpose
MFI + RSICompare volume-weighted vs pure momentum
MFI + MACDVolume confirmation of momentum signals
MFI + Moving AveragesOnly trade MFI signals in trend direction
MFI + Price PatternsConfirm breakouts from chart patterns

Data Alignment in Systemic

MFI requires four simultaneous inputs (High, Low, Close, Volume) that must be properly aligned before calculation.

Multi-Input Alignment

When connecting data sources with different frequencies or lengths, Systemic automatically aligns them:

ScenarioBehavior
Different frequenciesLower-frequency data upsampled by repeating values
Different lengthsShorter series padded by extending final values
Mixed sourcesAll inputs aligned to longest/highest-frequency series

Example: If you connect daily High/Low/Close with hourly Volume:

  • Daily price data is upsampled to hourly resolution
  • Each daily value repeats for all 24 hourly periods
  • The MFI calculation uses the aligned, same-length series

Critical Alignment Note

⚠️ All four inputs should ideally come from the same data source at the same frequency. While Systemic will align mismatched inputs, mixing frequencies can produce misleading MFI values since Volume and Price from different timeframes may not represent the same market activity.

Window Parameter

The window parameter is a constant and does not participate in multi-input alignment.

Missing Data (Closed-Market Bars)

A bar missing any of High, Low, Close, or Volume (a weekend, holiday, or data gap) never fabricates a value: MFI emits null at that slot instead of a carried-forward or neutral reading. Typical-price direction and both money-flow sums run over the N most recently observed bars ("N-bar MFI" = N observed bars, weekends bridged — a Friday-to-Monday pair is treated as adjacent, not two calendar days), so a gap never dilutes the ratio or freezes it at a stale value. A window where every observed bar's typical price genuinely rises keeps its legitimate 100.0 reading (no negative flow exists to divide by) — this is never masked; only a window with no directional flow at all (a fully flat run, or too few observed bars for a complete window) has no determinable ratio and is null.


Indicator Profile

The following chart compares MFI's utility across stocks and cryptocurrency markets:

quadrantChart
    title MFI Indicator Profile
    x-axis Low Popularity --> High Popularity
    y-axis Low Reliability --> High Reliability
    quadrant-1 High potential  
    quadrant-2 Established leaders
    quadrant-3 Niche tools
    quadrant-4 Popular but risky
    MFI - Stocks: [0.65, 0.70]
    MFI - Crypto: [0.55, 0.60]

Dimension Ratings

DimensionStocksCryptoNotes
Popularity6.5/105.5/10Well-known among volume-focused traders. Less popular than RSI or MACD.
Reliability7.0/106.0/10Volume confirmation adds value. Crypto volume varies by exchange.
Complexity5.0/105.0/10Requires understanding of typical price and money flow concepts.
Versatility6.0/105.5/10Requires volume data—limited for forex. Works across timeframes.
Recent Interest5.5/106.0/10Steady classic indicator. Gaining interest in crypto for smart money detection.

Further Reading

Rendering diagrams...
© 2026 WanoLabs. All rights reservedAlpha build v0.1.5