Price and volume

Money Flow Indicator: MFI on TradingView

The Money Flow Index (MFI) is a money flow indicator that weighs typical price by volume and expresses the balance on a 0 to 100 scale. It needs usable volume from your chart feed. A high reading describes the lookback window; it does not tell you when price will reverse.

View the Pine Script example

How MFI is calculated

Typical price is (high + low + close) / 3. Multiply it by volume for raw money flow. Classify that amount as positive when typical price rises from the previous bar, negative when it falls, and neither when unchanged. Sum each side over N bars.

Ratio = positive flow sum / negative flow sum

MFI = 100 - 100 / (1 + Ratio)

With positive flow and no negative flow, the limiting value is 100; with negative flow only, it is 0. If neither side has flow, there is no meaningful ratio. Do not silently turn unavailable data into a neutral 50. See the official MFI calculation.

A calculation you can check

Illustrative three-bar example, not historical prices: the preceding typical price is 100. Subsequent typical prices are 102, 101, and 103, each with volume of 10 units. Positive flow is 1,020 + 1,030 = 2,050; negative flow is 1,010. The ratio is about 2.03 and MFI is about 66.99. If the middle bar instead has volume of 30, its negative flow becomes 3,030 and MFI falls to about 40.35, despite identical prices.

MFI vs RSI vs Chaikin Money Flow

Calculation differences between MFI, RSI, and CMF
IndicatorWhat assigns direction?Volume and scale
MFIChange in typical price between barsWeights typical price by volume; 0 to 100
RSIGains and losses in the chosen price source, usually closeNo volume input; Wilder-smoothed gains/losses; 0 to 100
CMFClose relative to the same bar's high-low rangeVolume-weighted close location; -1 to +1

CMF sums volume multiplied by (2 × close - high - low) / (high - low), then divides by summed volume. Its multiplier does not measure the gap from the prior bar. A gap down that closes near the new bar's high can therefore contribute positively to CMF while contributing negatively to MFI. The indicators answer different questions; agreement does not establish an edge. Sources: RSI and CMF.

Two reasons an MFI reading can mislead

Overbought is a condition, not a countdown

The conventional upper and lower reference levels are 80 and 20. Consider a hypothetical window in which every typical price rises and every bar has positive volume. Negative flow remains zero while price keeps advancing. Selling because MFI first reaches the upper band would oppose that continuing move. Even a later drop below 80 can be followed by another rally.

For a testable rule, distinguish touching a level from crossing it, specify whether the bar must close, and define a separate price condition and exit. For example, a research candidate could require MFI to recover above 20 and price to close above the previous bar's high. That is an illustrative specification, not a tested trading recommendation.

Missing volume is not weak buying pressure

TradingView documents symbols and timeframes without trade volume, including some forex, CFD, index, and crypto feeds. Other feeds provide tick volume, which counts price updates. Inspect the exact provider and interval. Tick volume does not measure units traded, and another feed can produce a different MFI. An empty Volume pane is a reason to stop interpreting MFI, not a reason to lower its thresholds. See TradingView's volume availability notes.

Read a money flow index chart in TradingView

Add Money Flow Index from TradingView's Indicators search, or paste the example below into Pine Editor and select Add to chart. Compare the same symbol, timeframe, HLC3 source, and length. The line belongs in a separate pane because its scale differs from price.

This example retains the built-in calculation and adds a conservative availability check: it hides the line if any bar in the window has missing or zero volume. It also waits for enough history. A legitimate zero-volume bar triggers the same check; change that policy only after inspecting your feed. The status message cannot certify the quality or type of supplied volume.

Pine Script v6
//@version=6
indicator("MFI with volume availability check", overlay = false)

length = input.int(14, "MFI length", minval = 2)
hasVolume = not na(volume) and volume > 0
validWindow = ta.lowest(hasVolume ? 1.0 : 0.0, length) == 1.0 and bar_index >= length
rawMfi = ta.mfi(hlc3, length)
mfiValue = validWindow ? rawMfi : na

plot(mfiValue, "MFI", color = color.rgb(37, 99, 235), linewidth = 2, style = plot.style_linebr)
upperBand = hline(80, "Overbought")
hline(50, "Midline", color = color.new(color.gray, 50))
lowerBand = hline(20, "Oversold")
fill(upperBand, lowerBand, color = color.new(color.blue, 92))

var table status = table.new(position.top_right, 1, 1)
if barstate.islast
    table.cell(status, 0, 0, na(mfiValue) ? "MFI unavailable: check history and volume" : "MFI uses this feed's volume", text_color = color.white, bgcolor = color.new(color.black, 20))

The open bar's reading can move as price and volume update. Use completed bars when comparing signals and explicitly request bar-close evaluation for alerts. This sample plots MFI; it does not place orders or run a backtest. See TradingView's explanation of repainting.

Build an MFI rule with Pineify

Pineify's Visual Editor includes MFI with source and length inputs. Use the AI Coding Agent to draft a combination of MFI, price conditions, and explicit data checks, then inspect the generated script in TradingView.

Example request: Use MFI(14) on HLC3. Require usable volume across the lookback. Mark a completed bar only when MFI crosses above 20 and close exceeds the prior high. Show why data checks fail. Do not add orders or claim a win rate.

MFI questions

Is the Money Flow Index MFI indicator actual money entering a market?

No. MFI classifies price multiplied by volume using changes in typical price. It does not identify traders, measure fund subscriptions, or separate buyer-initiated from seller-initiated trades. Read it as an oscillator derived from the selected chart feed.

Is MFI better than RSI?

Neither has a universal advantage. RSI can be calculated from price without volume; MFI adds a volume dependency and uses a different calculation. Compare complete rules on the same symbol, period, costs, and unseen test data before drawing a performance conclusion.

What settings should I start with?

Use the built-in 14-bar length as a baseline. A 14-bar daily window and a 14-bar five-minute window cover different elapsed time. Treat alternative lengths and thresholds as test parameters, and keep a separate period for validation rather than selecting the best historical result.

Why is my money flow index chart blank?

Check the exact symbol, exchange or provider, timeframe, available history, and Volume pane. A feed may lack volume or an MFI calculation may be undefined. The example here also hides MFI whenever its window includes missing or zero volume; that is a deliberately stricter policy than simply plotting the built-in function.

Does MFI repaint while a candle is open?

The current reading can change as the open candle receives price and volume updates. Evaluate a rule at bar close if it requires completed values. This adds waiting time and does not protect against later data corrections or guarantee a successful signal.

Sources and related reading

Official documentation checked October 16, 2026.

Browse TradingView indicator guides, compare Chaikin Money Flow, or review RSI settings.

Educational content, not investment advice. Examples are illustrative and do not establish profitability. Trading involves loss risk; test complete rules with costs before relying on an indicator.