VALYNOX
VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Indicators and signals

Money flow index: formula, 80/20 levels and an ES futures test

The money flow index is RSI with volume in it: it sums typical price × volume on up bars and down bars over 14 bars and scales the ratio from 0 to 100. It only tells you something RSI cannot when volume is lopsided, so test the MFI rule against the same RSI rule with identical costs before trusting it on futures.

By · Published · updated · Editorial policy

Contents
  1. How is the money flow index calculated?
  2. What is the difference between MFI and RSI?
  3. How do you use the 80 and 20 levels?
  4. Is MFI accurate on futures? A reversion test on ES
  5. Is futures volume good enough for MFI across contracts?
  6. Frequently asked questions
  7. References

How is the money flow index calculated?

The money flow index is a 0-to-100 oscillator that weighs each bar's price change by its volume. It sums typical price × volume on up bars and on down bars over 14 bars and turns the ratio into one reading. Above 80 means heavy buying, below 20 heavy selling. Before trusting it on futures, test it against RSI after costs.

The money flow index (MFI) is an oscillator that measures buying and selling pressure by combining how far price moved with how much volume moved it. Think of two people pushing a door: price change tells you which way the door moved, volume tells you how hard they pushed. RSI records only the movement. MFI records movement times effort. The calculation runs in four steps, and only the second step uses volume.

  1. Typical price. Typical price is the average of a bar's high, low and close: (high + low + close) ÷ 3. Use real bars for this step. Smoothed bars such as Heikin Ashi candles replace the high, low and close with averaged values, so the typical price would no longer be a price anyone traded at.
  2. Raw money flow. Raw money flow is typical price multiplied by the bar's volume. This is the step RSI does not have.
  3. Positive and negative flow. If a bar's typical price is higher than the previous bar's, its raw money flow counts as positive flow. If lower, it counts as negative flow. Sum each side over the last 14 bars.
  4. Scale to 0–100. Divide the positive sum by the negative sum to get the money flow ratio, then apply the formula below.

MFI = 100 − 100 ÷ (1 + positive flow ÷ negative flow)

Here positive flow is the 14-bar sum of raw money flow on up bars, negative flow is the 14-bar sum on down bars, and their quotient is the money flow ratio. When the two sums are equal, the ratio is 1 and MFI reads 50. When buying flow is much larger, MFI moves toward 100; when selling flow dominates, toward 0.

Hypothetical example

A bar has a high of 5,010, a low of 4,990 and a close of 5,004. Its typical price is 5,001.33. Over the last 14 bars, in simplified units, the up bars add to a positive flow of 600 and the down bars to a negative flow of 200. The money flow ratio is 600 ÷ 200 = 3.0, so MFI = 100 − 100 ÷ (1 + 3.0) = 75. If the same 14 bars had the same price changes but the up bars came on half the volume, the positive flow would be 300, the ratio 1.5 and MFI 60. Same prices, different reading.

MFI in four steps with hypothetical numbers: typical price is high plus low plus close divided by three, raw flow is typical price times volume, the 14-bar positive sum is three times the negative sum, and a ratio of 3.0 gives an MFI of 75; step two, the volume step, is the only part RSI does not have Volume enters at one step Hypothetical numbers, 14 bars 1 Typical price (H+L+C) ÷ 3 2 Raw flow Price × volume Not in RSI 3 14-bar sums Up = 3 × down 4 MFI Ratio 3.0 → 75 Step 2 is all that RSI lacks. So: trust MFI only with real volume.
MFI in four steps. The second box, where volume enters, is the only part RSI lacks.

What is the difference between MFI and RSI?

RSI weighs every bar by its price change alone, while MFI weighs each bar by price change times volume, so the two lines agree in direction most of the time and separate only when volume is lopsided. That separation is the one case where MFI can tell you something RSI cannot. On a stretch of bars where volume is roughly even, MFI is RSI drawn with a different pen, and a strategy built on it will fire at nearly the same bars.

RSI is an oscillator introduced by Wilder (1978) that compares the average size of up closes with the average size of down closes over 14 bars and scales the result from 0 to 100. Three mechanical differences follow from the definitions:

PropertyRSIMFI
Input per barClose-to-close price changeChange in typical price × volume
Typical length14 bars14 bars
Usual levels70 and 3080 and 20
Needs a volume columnNoYes
How bars are combinedSmoothed averages of gains and lossesPlain 14-bar sums of positive and negative flow

The practical consequence is the shape of the line. Because MFI uses plain sums, a single high-volume bar enters the sum at full weight and leaves it exactly 14 bars later, so MFI jumps and then drops back more sharply than RSI. The wider 80/20 levels exist partly because of this jumpier behaviour. The second consequence is divergence: when price rises on thin volume and falls on heavy volume, RSI can sit near 50 while MFI slides toward 30. That picture is the whole case for MFI, and it is also the thing to test rather than assume. The broader question of which technical analysis indicators can be tested at all starts with whether their inputs, here volume, are trustworthy on your data.

Illustration: an up move on low volume and an equal down move on high volume leave RSI at 50 while MFI falls to 30, because only MFI weighs each move by its volume Volume splits MFI from RSI Equal moves up and down, illustrative Volume Up Low Down High Reading RSI 50 MFI 30 Only uneven volume moves them apart. So: test whether MFI beats RSI.
Same price path, different volume: RSI stays near 50 while MFI falls. This is the only situation where MFI adds information.

How do you use the 80 and 20 levels?

The 80 and 20 levels mark heavy buying and heavy selling pressure, and a testable rule fires on the re-cross back inside the band, with the entry on the next bar's open and the exit written before the first run. A reading above 80 says that over the last 14 bars, volume-weighted buying was at least four times volume-weighted selling. It does not say price must turn. In a strong trend MFI can stay above 80 for many bars, so a rule that sells on the first touch sells into the trend.

A rule you can backtest has every part fixed in advance. The version below is the common reversion form:

  1. Short setup: MFI closes above 80, then later closes back below 80. The signal bar is the one that closes back below. No signal on the first touch.
  2. Long setup: MFI closes below 20, then later closes back above 20. Mirror image.
  3. Entry: market order at the open of the bar after the signal bar. Deciding on a close and filling on that same close uses a price you could not have traded.
  4. Exit: one of three, chosen before the test: MFI crosses back through 50, a fixed number of bars, or the opposite signal. Write down which one. Adding a stop or target later is a second strategy, not a refinement.
  5. Costs: commission and slippage on every trade from the first run, as described in trading costs in backtests. A rule that fires often on daily bars and holds a few days has an average trade small enough that costs decide the sign.
An MFI line closes above 80, stays there for two more bars, then closes back below 80: the first close above gives no signal, the close back below is the signal, and the entry fills at the next bar's open; the long setup mirrors this at 20 Signal on the re-cross MFI near 80, one dot per bar 80 No signal Signal Next open Wait for the close back below 80. So: mirror it at 20 for longs.
The tradeable 80/20 rule fires on the re-cross back inside the band and fills on the next bar's open, never on the first touch.

Is MFI accurate on futures? A reversion test on ES

An oscillator reversion rule can look strong on ES daily bars, but the result below comes from a plain RSI stand-in picked after the fact out of 1,024 candidates, so it sets a bar the MFI version has to clear rather than proving that MFI predicts turns. Accuracy for an indicator is not a percentage of correct calls. It is the average trade after costs of a fully written rule, compared with the simplest rule that does the same job without the extra input. For MFI, that simpler rule is RSI.

The run below tested ES daily bars from 2019-01-02 to 2025-06-30, long and short, one contract, with $20 commission and $25 slippage per trade. The search tried 1,024 candidates and kept one for its return against its drawdown. The kept candidate uses an RSI rule as its only entry and exit, no stop or target, no filters. It is a stand-in built from standard indicators, not an MFI rule, because the point is to measure what price-only reversion already does on this market before volume weighting is added on top.

Source: AlphaPrime product engine (CPU), run 2026-10-31. ES daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $25 slippage per trade.

NumberResult
Net profit (closed trades)$89,155
Max drawdown$68,387.5
Trades56
Win rate58.93%
Profit factor1.693
Average trade$1,592.05
Time in market92.09%
The MFI 80 and 20 rule as four events in order: for a short, MFI closes above 80 to arm, closes back below 80 to signal, the trade fills at the next open, and it exits when MFI crosses below 50; the long path mirrors it through 20. Arm, signal, fill on next open MFI 80 / 20 as a cross back Arm Signal Fill Exit Short > 80 < 80 Open < 50 Long < 20 > 20 Open > 50 Trade the cross back, not the touch. So: fill and exit on the next open.
Follow the equity line against the drawdown band and note where the out-of-sample stretch begins. The curve belongs to the kept RSI stand-in, not to an MFI rule. ES · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest
Read net profit, max drawdown and the trade count as one set. A small trade count means each number can move a long way if a few trades change.
Read net profit, max drawdown and the trade count as one set. A small trade count means each number can move a long way if a few trades change. ES · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest

Three things in the box matter more than the net profit. First, 56 trades in six and a half years is a small sample, so the average trade of $1,592.05 carries wide uncertainty. Second, time in market of 92.09% means the rule was almost always holding a position, long or short, so part of what it captured is the direction ES travelled over those years, not turns called by the oscillator. Third, the max drawdown of $68,387.5 is close to the net profit in size. A reader should not conclude that this rule earned that money or that they can expect it; it is the best-looking member of a family of 1,024, chosen after seeing all the results, and Bailey et al. (2014) show that the best of many trials is inflated for that reason alone. Harvey and Liu (2015) make the same point and argue for discounting any result by the number of tests behind it.

Illustration: over a thousand candidates ranked by return against drawdown form a bell-shaped spread; the typical candidate sits in the middle, and the one kept is a single run at the far right, chosen after seeing all results Best of over a thousand tries Ranked by return vs drawdown, illustrative Over a thousand tried The one kept Typical Picked after seeing every result. So: expect less than its numbers.
The kept candidate is the rightmost of 1,024 dots. Its result is an upper bound for the family, not what a typical candidate did.

The real judgement of MFI comes from a paired run that this result only sets up:

  1. Write the MFI 80/20 re-cross rule and the RSI 70/30 re-cross rule in full, same length of 14 bars, same exit.
  2. Run both on the same ES bars, the same session definition, the same period and the same in-sample and out-of-sample split.
  3. Charge the same commission and slippage and fill both on the next bar's open. AlphaPrime (Valynox) applies fees, slippage and next-bar execution inside every evaluation of its backtesting, which is what makes the MFI line and the RSI line of this comparison read on one scale.
  4. Compare average trade after costs first, then trade count, then max drawdown. Decide with a margin written before the run: for example, MFI must improve the out-of-sample average trade after costs by a stated amount with a similar number of trades.

If the two averages are close, the volume weighting added nothing on this market and bar size, and the simpler rule wins by default. If MFI is clearly better, the next question is whether the improvement survives the volume problems in the next section.

Is futures volume good enough for MFI across contracts?

MFI is only as good as the volume column under it, and futures volume breaks in three specific places: roll weeks on a continuous contract, thin night sessions, and micro contracts that share their market with the full-size contract. Each break distorts MFI in a different way, and none of them shows up in a price-only filter. The choppiness index, explained in choppiness index as a trend-or-range filter, never sees the volume column. An anchored VWAP, tested in eVWAP anchored VWAP rules on ES, uses volume only as a weight inside a running average, so a single odd bar barely moves it. A 14-bar sum ratio reacts to that same bar at full weight.

A continuous contract is a price series stitched from successive expiries so that a backtest can run across years. Around a roll, trading migrates from the expiring contract to the next one over several days. A series that switches on a single date shows volume fading on the old contract before the switch and jumping on the new one after it. MFI reads that fade and jump as selling pressure followed by buying pressure that never happened. How the roll is handled is covered in futures backtesting with contract specs and rollover; for MFI the extra step is to check the volume column, not only the price gap, across the roll week.

Contract and sessionVolume patternEffect on MFI
ES, day sessionSteady, deepReliable; the reading reflects real pressure
ES, night sessionThin for long stretchesSpikes on small trades; false 80/20 crossings
MES (micro)Shares its market with the full-size ESUnderstates pressure when the flow is in the other contract
Continuous contract, roll weekSplit between two expiriesFalse swings around the roll date
TAIEX futures, day vs nightDay deeper, night thinnerDay readings usable; night readings spike on small trades
Effect of futures volume on MFI: ES day session is reliable, ES night session spikes on small trades, MES understates pressure, a continuous contract in a roll week shows false swings as volume dips then jumps, and TAIEX futures at night spike on small trades Where volume misleads MFI Effect on MFI by contract and session ES day Reliable ES night Spikes MES micro Understates Roll week False swings TAIEX night Spikes Only deep day volume reads true. So: check volume at every roll.
Each volume weakness distorts MFI in its own way. The roll-week strip shows the dip and jump that MFI reads as a pressure swing.

Three checks fix most of this before the backtest runs. Build MFI on the session you will trade, day-only or full-session, and keep the same choice for the RSI comparison. Build it on the contract whose volume you are using, so an MES strategy that uses ES volume is labelled as such. And look at the volume bars on each side of the last few roll dates in your series: if the column dips and jumps there, either roll on volume rather than on a fixed date or exclude the signal bars inside the roll week from the test.

One practical step follows from this. Open your ES or TAIEX futures bar data, find the most recent roll date, and compare the volume on the five bars before it with the five bars after it. If the two averages differ by more than the day-to-day variation around them, run the paired MFI-versus-RSI test from the previous section once with the roll weeks included and once with them removed, and keep whichever answer is worse.

Frequently asked questions

Can I use the money flow index on a chart without real volume?

No. MFI multiplies every bar's typical price by its volume, so a data feed with missing, tick-count or estimated volume produces an indicator that measures the feed's quirks rather than buying and selling pressure. If the volume column is missing or unreliable, use RSI, which needs only prices, and treat any MFI reading as undefined.

What length should MFI use?

The usual length is 14 bars, the same as RSI, and it is the right starting point for a first test. Shorter lengths make the line jumpier and produce more 80/20 crossings; longer lengths smooth it and produce fewer. Rather than searching for the best length, test a few neighbouring values and keep the rule only if the results for 12, 14 and 16 look alike.

Does MFI divergence predict a reversal?

MFI divergence is a price making a new high while MFI makes a lower high, or the mirror image at lows. It is a picture, not a rule, until you write down how far apart the two highs must be and what happens next. Written as a rule and tested against the plain 80/20 re-cross with the same costs and exit, divergence adds trades that are rarer and harder to define consistently, so compare average trade after costs on both before preferring it.

Is MFI better for daily bars or intraday bars?

MFI needs a volume column that reflects real participation on every bar, which daily bars on a liquid day session provide more consistently than intraday bars across night sessions. Intraday MFI works on deep sessions but spikes on thin ones, and a 14-bar window on 5-minute bars covers only about an hour of trading. Test the bar size you intend to trade and check the volume pattern of that session before reading the 80 and 20 levels.

References

  • Wilder, J. W. (1978). New Concepts in Technical Trading Systems. Trend Research.
  • Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.
  • Harvey, C. R., & Liu, Y. (2015). Backtesting. The Journal of Portfolio Management, 42(1), 13–28.