All free tools

Volume indicator

Money Flow Index (MFI) Calculator

Compute the Money Flow Index from the positive and negative money flow over your lookback period. What sets it apart, folding volume into a momentum reading, is the idea worth grasping.

Money Flow Index
62.65
Between 20 and 80, the neutral zone.
Money flow ratio
1.677
Positive flow divided by negative flow.

What the Money Flow Index is

The Money Flow Index, developed by Gene Quong and Avrum Soudack, is a momentum oscillator bounded between 0 and 100 that, unlike RSI, incorporates volume. The idea is to weight price movement by how much trading activity accompanied it, so a move on heavy volume counts for more than the same move on light volume. It is sometimes called a volume-weighted RSI.

The calculation starts with the typical price of each bar, the average of the high, low, and close. Multiplying the typical price by the bar's volume gives the raw money flow. Money flow is classed as positive on bars where the typical price rose from the prior bar and negative where it fell. Over the lookback, by default 14, you sum the positive and negative money flow separately. The money flow ratio is positive divided by negative, and MFI is 100 − 100 / (1 + ratio), the same bounded transformation used by RSI.

Why the Money Flow Index is used

MFI is used to study momentum with an added volume dimension. Traders traditionally treat readings above 80 as overbought and below 20 as oversold, thresholds a little wider than RSI's because volume can push the oscillator to extremes. Divergences between MFI and price are also commonly watched, on the reasoning that volume may reveal conviction that price alone does not.

These conventions and the 14-period default are starting points that many adjust. As always, how you interpret the reading is your own decision.

What are TradingView and Pine Script?

TradingView is one of the most widely used charting and market-analysis platforms, where traders and analysts study price movement across stocks, crypto, forex, and futures on interactive charts. Pine Script is TradingView's own lightweight programming language, created so anyone can build custom tools that run directly on those charts.

People use Pine Script to build four main kinds of tools. Indicators calculate and plot values on the chart, exactly like the calculation above, but recomputed automatically on every bar. Strategies add explicit entry and exit rules and can be backtested against historical data in TradingView's Strategy Tester to see how they would have behaved. Screeners scan many symbols at once for conditions you define. Alerts notify you the moment a condition you specified occurs, so you do not have to watch the screen.

The value is precision and automation. Instead of eyeballing a chart, you describe exactly what you want measured, visualized, or notified about, and TradingView runs it consistently across any market and timeframe. That is why traders, analysts, and developers write Pine Script: it turns a manual charting idea into a repeatable tool. These tools are for tracking, visualizing, and testing market ideas; they do not tell you what to trade, and that decision always remains yours.

Writing that code by hand means learning Pine Script's syntax, its type system, and the exact names of hundreds of built-in functions. It is a real programming language, and small mistakes stop a script from compiling in the Pine Editor.

Turn this into Pine Script

This tool returns one MFI reading. On a chart it recalculates every bar in its own pane with the overbought and oversold guides. Pine Script gives you the whole calculation through ta.mfi(hlc3, 14), but building the zones, coloring, and any divergence or alert logic around it is where the real work lives.

Pine Script v6
//@version=6
indicator("Money Flow Index", overlay=false)

mfiValue = ta.mfi(hlc3, 14)

plot(mfiValue, "MFI", color=color.teal)
hline(80, "Overbought")
hline(20, "Oversold")

PineScripter is an AI built specifically for Pine Script. You describe what you want in plain English and it writes TradingView-ready v5 or v6 code. Because it is specialized on the Pine Script language and its exact function signatures, it tends to produce code that compiles far more reliably than general-purpose models like ChatGPT, which often invent functions that do not exist in Pine Script.

Related free calculators

From the blog

PineScripter is an AI developer tool that helps you write Pine Script code. It is not a financial advisor and will never offer financial, investment, or trading advice. Everything on this page, including the calculator and the explanations, is provided purely for educational and informational purposes. Any decision about how to interpret an indicator or trade a market is entirely your own. See our full disclaimer for more.