The Money Flow Index is a volume weighted momentum oscillator that scores buying and selling pressure from 0 to 100 over a lookback window, 14 periods by default. It was developed by Gene Quong and Avrum Soudack, and the easiest way to understand it is as the Relative Strength Index with volume bolted on: same final equation, different raw ingredient. That single change is why MFI often turns before RSI does, and also why it produces more false alarms.
MFI is a single instrument tool, unlike breadth ratios that need an entire exchange. It works on any market with a reliable volume series: listed equities, futures and crypto. Spot forex has no centralized volume, so MFI there runs on tick counts from one broker’s feed and means less than traders assume.
The formula, one step at a time
There are four steps and none of them are hard. The care is all in step three, where the sign convention decides which bucket a bar goes into.
| Step | Calculation | Why it exists |
|---|---|---|
| 1 | Typical Price = (High + Low + Close) / 3 | One representative price per bar instead of the close alone |
| 2 | Raw Money Flow = Typical Price x Volume | Converts share count into dollar weight |
| 3 | Money Flow Ratio = 14 period positive flow / 14 period negative flow | A bar is positive if its typical price rose versus the prior bar |
| 4 | MFI = 100 minus (100 / (1 + Money Flow Ratio)) | Squashes an unbounded ratio into a 0 to 100 range |
The comparison in step three is on typical price, not on close. A bar can close red and still count as positive flow if its high and low both shifted up enough, which is one reason MFI sometimes disagrees with a chart that looks obviously bearish.
A worked example
A full 14 period calculation would need a wall of arithmetic, so here is a 5 period MFI on six bars. The mechanics are identical, only the window length changes. Bar 1 exists solely to give bar 2 something to compare against.
| Bar | High | Low | Close | Volume | Typical price | Direction | Raw money flow |
|---|---|---|---|---|---|---|---|
| 1 | 24.60 | 24.20 | 24.50 | 100,000 | 24.4333 | seed | not counted |
| 2 | 24.90 | 24.40 | 24.80 | 120,000 | 24.7000 | up | 2,964,000 positive |
| 3 | 25.10 | 24.70 | 24.75 | 90,000 | 24.8500 | up | 2,236,500 positive |
| 4 | 24.95 | 24.30 | 24.40 | 150,000 | 24.5500 | down | 3,682,500 negative |
| 5 | 24.70 | 24.20 | 24.65 | 110,000 | 24.5167 | down | 2,696,833 negative |
| 6 | 25.20 | 24.60 | 25.15 | 200,000 | 24.9833 | up | 4,996,667 positive |
Positive flow across bars 2 to 6 is 2,964,000 plus 2,236,500 plus 4,996,667, which is 10,197,167. Negative flow is 3,682,500 plus 2,696,833, which is 6,379,333. The money flow ratio is 10,197,167 divided by 6,379,333, or 1.5985. Feeding that into step four gives 100 minus 100 divided by 2.5985, so MFI is 61.5.
Bar 5 is the instructive one. It closed at 24.65, up from 24.40, so on a close only basis it looks green. Its typical price still fell, because the high and low both came in lower, so its 2.7 million of flow lands in the negative bucket. Anyone eyeballing closes would score that bar the wrong way.
import pandas as pd
def mfi(df, period=14):
tp = (df["high"] + df["low"] + df["close"]) / 3
rmf = tp * df["volume"]
up = rmf.where(tp > tp.shift(1), 0.0)
dn = rmf.where(tp < tp.shift(1), 0.0)
pos = up.rolling(period).sum()
neg = dn.rolling(period).sum()
return 100 - (100 / (1 + pos / neg))
df["mfi14"] = mfi(df)MFI compared with RSI
The two indicators share the final equation but differ in what they feed it, and the differences show up in real charts more often than you would expect.
| Aspect | Money Flow Index | Relative Strength Index |
|---|---|---|
| Input | Typical price times volume | Close to close price change only |
| Smoothing | Simple sum over the window | Wilder’s smoothing, closer to an EMA |
| Reaction speed | Faster, one heavy volume bar moves it a lot | Slower and steadier |
| Usable on spot forex | Poorly, volume is broker specific | Yes, price only |
| Typical failure mode | Whipsaws around earnings and index rebalances | Stays pinned in a strong trend |
The three signals people actually trade
Almost every MFI setup you will see published reduces to one of three ideas.
Threshold reversals. Enter when MFI crosses back down through 80 or back up through 20. This is the most common and the weakest, because in a strong trend MFI can sit above 80 for weeks. Treating that as a short signal is a reliable way to lose money slowly. Use thresholds as a filter on trades you were taking anyway.
Divergence. Price makes a higher high while MFI makes a lower high, or the mirror image at a low. The second push had less dollar volume behind it. Divergence is informative about participation but it is not a timing tool: it can persist for many bars, and it resolves without a reversal often enough that trading it naked is expensive.
Failure swings. A tighter variant of divergence that does not reference price at all. In a bullish failure swing, MFI drops below 20, rallies back above it, pulls back but holds above 20, then exceeds its prior swing high. The advantage is that the structure is defined entirely on the oscillator, so it is unambiguous and easy to code. The disadvantage is that it fires rarely.
Choosing the period
The 14 period default is inherited from Wilder’s RSI convention and there is nothing magic about it. Shortening it to 9 or 10 makes MFI reach the 80 and 20 bands far more often, which produces many more signals to filter. Lengthening it to 21 or 25 turns it into a participation gauge rather than a timing oscillator.
Whatever you choose, choose it once and leave it. Cycling through periods until one would have caught the last three swings is textbook curve fitting, and it is behind most of the disappointing results that follow a promising backtest.
What the evidence supports
There is no credible published research showing a specific MFI threshold rule produces excess returns after transaction costs, and any article quoting you a win rate for MFI without naming a dataset, a period and a cost assumption is making the number up.
The wider literature on technical rules is more nuanced than either side of the argument usually admits. Brock, Lakonishok and LeBaron reported significant results for simple moving average and breakout rules on the Dow in the Journal of Finance in 1992. Sullivan, Timmermann and White then re examined that same rule universe with a bootstrap designed to correct for data snooping, published in the Journal of Finance in 1999, and found the apparent edge did not carry into the following period. Bajgrowicz and Scaillet later applied a false discovery rate approach in the Journal of Financial Economics in 2012 and reached a similar conclusion once realistic costs were included. Park and Irwin’s survey counted 95 modern studies with 56 positive, 20 negative and 19 mixed, while cautioning about exactly the selection problems those bootstrap papers were built to detect.
Read together, that work says indicators can describe market state usefully, and that mechanical rules built on them rarely survive honest out of sample testing with costs. MFI is a good description tool. Treat any claim that it is a standalone trading system with suspicion, including your own backtest.
Common problems and fixes
| Problem | Cause | Fix |
|---|---|---|
| MFI stuck above 80 for weeks | Strong trend, positive flow dominates every window | Stop reading it as overbought. Switch to divergence or a trend filter. |
| Values differ between platforms | Different volume feeds, or close used instead of typical price | Recompute one bar by hand and compare against the four steps above. |
| Huge jump on one bar | Earnings gap or index rebalance volume | Flag known event dates and ignore MFI for a few bars afterward. |
| Indicator goes blank | Negative flow is zero, division by zero | Clamp the output to 100 when the negative sum is zero. |
| Useless on a forex pair | No centralized volume in spot FX | Use currency futures volume, or use RSI instead. |
Frequently asked questions
What is a good MFI setting for day trading?
Shorter windows of 9 or 10 periods on a 5 minute chart are common because the default 14 rarely reaches the bands intraday. Expect many more signals and a lower proportion of useful ones. Pick the setting before you test, not after, and keep it fixed across the whole sample.
Is MFI better than RSI?
Neither is better in general. MFI adds volume, so it reacts faster and can flag participation that price alone hides, at the cost of more noise and dependence on a clean volume feed. RSI is more stable and works where volume data is unreliable. Many traders run both and pay attention when they disagree.
Does MFI work on crypto?
The math works because exchange volume is published, but the volume itself is fragmented across venues and historically has included some inflated reporting. Use volume from the specific venue you trade on rather than an aggregated figure, and expect thresholds to behave differently than they do in equities.
What does an MFI divergence mean?
It means the most recent price extreme was made on less dollar volume than the previous one, so fewer committed participants pushed it there. That is information about the quality of a move. It is not a timing signal, and divergences frequently persist or resolve without any reversal at all.
Can MFI be used with candlestick patterns?
Yes, and that is one of its better uses. A reversal candle carries more weight when MFI confirms that flow was already deteriorating. If you want the pattern side of that, start with the basics of candlestick patterns and add MFI as the participation check.
The bottom line
MFI is RSI with a volume weight, and the weight is a genuine improvement when your volume data is good. The formula is four steps, it fits in ten lines of pandas, and it will tell you things about participation that a price only oscillator cannot. That is a real contribution to a chart.
Where it goes wrong is when people treat 80 and 20 as buy and sell buttons. Use it as a filter, respect trends, and pair it with structure from Keltner Channels or trend state from MACD rather than trading it alone. If you want the exchange wide version of the same flow question, the Arms Index answers it across every listed stock at once.
