Strategies we backtested Money Flow Index 20/80

Tested by BacktestingMax

Money Flow Index (MFI) 20/80 strategy backtest

Does the Money Flow Index 20/80 strategy make money?

No, not on most markets. The Money Flow Index (MFI) goes from 0 to 100. It is close to the share of the last 14 candles' volume (the amount traded) that came in candles in which price rose. The 20/80 strategy buys when MFI rises back above 20, and sells short (sells first, to make money if price falls) when MFI falls back below 80. It closes a buy when MFI reaches 80 or falls back below 50, and a short when MFI reaches 20 or rises back above 50. We ran 27 backtests from 2020 to 2025, after trading costs: 9 markets, each on 15-minute, 1-hour and 4-hour charts. Only 3 of the 27 made money, and only 1 of them, EUR/USD on 4-hour charts, passed all four of our checks. All 9 tests on 15-minute charts lost money. Even before trading costs, the average trade lost a little on all three charts. The volume helped only on 1-hour charts, where MFI without volume lost about twice as much per trade. But with the levels 30 and 70, RSI, a similar indicator without volume, did about as well as MFI. Three common changes, such as a trend filter, did not clearly help either.

27 backtests 2020–2025 Trading costs included Tested 16 November 2026

Where it worked 27 backtests
Made money
3
of 27 tests, with the standard rules
Made money in both periods
2
2020–2023 and again 2024–2025
Best backtest
+15%
Dow Jones, 1-hour chart: account growth 2020–2025
With a 200 EMA trend filter
1
tests made money in both periods, compared with 2 with the standard rules

Made money in both periods

  • EUR/USD, 4-hour
  • Dow Jones, 1-hour

Lost money on every market

  • 15-minute charts

The results

Results on every market

Each box shows one backtest of the Money Flow Index 20/80 with the standard rules, from 2020 to 2025, after trading costs: the % result, and a small chart of the account balance. The solid line is the account balance and the dashed line is the starting balance. Green results made money; red results lost money. Under each result: whether it made money in both 2020–2023 and 2024–2025, or passed all four of our checks (see "How a test passes" further down).

Market 15-minute 1-hour 4-hour
EUR/USD −96% Lost money. Account down 90% by Apr 2023 −28% Lost money +6% Passed all four checks
GBP/USD −99% Lost money. Account down 90% by Apr 2023 −63% Lost money −4% Lost money
USD/JPY −96% Lost money. Account down 90% by Apr 2024 −81% Lost money −19% Lost money
Gold −97% Lost money. Account down 90% by Aug 2022 −72% Lost money −17% Lost money
Silver −98% Lost money. Account down 90% by Oct 2021 −69% Lost money −24% Lost money
S&P 500 −94% Lost money. Account down 90% by Aug 2024 −47% Lost money −5% Lost money
Nasdaq 100 −66% Lost money −24% Lost money +8% Made money overall, lost in one period
Dow Jones −55% Lost money +15% Made money in both periods −9% Lost money
DAX −74% Lost money −65% Lost money −3% Lost money
All the numbers, test by test
Market Chart Trades Win rate Profit factor Result Max drawdown 2020–2023 2024–2025 Monte Carlo drawdown Trading costs
EUR/USD 15-minute 2,989 36% 0.75 −96.3% −97.0% −94.2% −36.2% −97.4% $5,699
EUR/USD 1-hour 943 38.4% 0.95 −27.5% −51.6% +24.8% −41.9% −57.3% $4,351
EUR/USD 4-hour 184 40.8% 1.06 +6.1% −28.2% +0.1% +5.9% −22.1% $361
GBP/USD 15-minute 2,872 33.6% 0.79 −99.0% −99.1% −94.9% −80.0% −99.2% $7,508
GBP/USD 1-hour 879 35% 0.83 −62.6% −64.8% −31.9% −45.0% −72.0% $2,885
GBP/USD 4-hour 178 36.5% 0.96 −4.4% −19.2% +5.7% −9.6% −25.7% $382
USD/JPY 15-minute 3,084 36.3% 0.81 −96.0% −96.1% −87.2% −68.6% −97.4% $8,485
USD/JPY 1-hour 870 32% 0.68 −80.9% −80.9% −70.1% −36.2% −84.3% $1,654
USD/JPY 4-hour 187 33.7% 0.80 −19.0% −28.2% −11.0% −9.0% −32.4% $280
Gold 15-minute 2,133 34.5% 0.68 −96.5% −96.7% −94.9% −30.9% −97.2% $4,625
Gold 1-hour 791 34.3% 0.66 −71.5% −72.3% −62.8% −23.5% −76.4% $1,370
Gold 4-hour 206 33.5% 0.84 −16.8% −30.3% −16.2% −0.7% −31.9% $343
Silver 15-minute 1,491 32.2% 0.58 −97.7% −97.9% −97.6% −6.5% −98.0% $9,269
Silver 1-hour 927 35.1% 0.76 −68.5% −68.5% −63.0% −14.9% −75.5% $5,254
Silver 4-hour 206 34.5% 0.75 −23.9% −38.2% −25.9% +2.7% −35.5% $788
S&P 500 15-minute 3,749 36.5% 0.81 −94.3% −96.1% −87.4% −54.6% −96.5% $5,196
S&P 500 1-hour 1,389 37.2% 0.91 −47.1% −60.8% −10.0% −41.2% −68.4% $2,788
S&P 500 4-hour 283 33.6% 0.96 −5.4% −23.1% −10.0% +5.1% −34.4% $313
Nasdaq 100 15-minute 2,362 35% 0.90 −65.7% −76.9% −59.9% −14.3% −85.3% $5,792
Nasdaq 100 1-hour 853 34.3% 0.95 −23.7% −38.2% +10.0% −30.6% −56.6% $1,659
Nasdaq 100 4-hour 235 38.3% 1.07 +8.4% −18.7% −4.4% +13.5% −25.7% $227
Dow Jones 15-minute 3,349 37.2% 0.94 −55.1% −84.1% −63.9% +24.3% −81.4% $6,755
Dow Jones 1-hour 1,697 40.1% 1.02 +15.3% −40.8% +14.1% +1.0% −52.7% $2,937
Dow Jones 4-hour 295 36.3% 0.94 −9.0% −15.6% −6.9% −2.2% −31.1% $202
DAX 15-minute 3,989 36.9% 0.94 −73.6% −77.0% −48.1% −49.0% −88.8% $7,673
DAX 1-hour 1,456 39.1% 0.87 −64.7% −65.1% −50.2% −29.0% −75.2% $1,458
DAX 4-hour 281 33.8% 0.98 −2.8% −22.5% −21.7% +24.2% −29.6% $166

Profit factor is the money won divided by the money lost. Above 1 means the test made money. Max drawdown is the biggest fall from the highest balance. 2020–2023 and 2024–2025 show the result in each period on its own. Monte Carlo drawdown: we shuffled the trades into a random order 1,000 times; in 95% of those runs, the worst drawdown was this number or less. Result is the change in the account, with the risk of each trade set to 1% of the account at that time.

The account balance

The best test and the middle test

Best test Dow Jones, 1-hour chart +15.3% from 2020 to 2025
Middle test (median): half of the 27 did better, half did worse Dow Jones, 15-minute chart −55.1% from 2020 to 2025

What we found

What the 27 backtests show

  1. With the standard rules, 3 of the 27 tests made money from 2020 to 2025, after trading costs. On 15-minute charts, all 9 tests lost money, and 6 of them lost more than 90% of the account. On 1-hour charts, the Dow Jones made the most of all 27 tests, 15.3%, and made money in both periods. But at its lowest point, that account was 40.8% below its highest balance. The other 8 tests on 1-hour charts lost from 23.7% (the Nasdaq 100) to 80.9% (USD/JPY). On 4-hour charts, EUR/USD made 6.1% and passed all four of our checks, but barely: it made only 0.1% in 2020–2023, and 5.9% in 2024–2025. Overnight fees are not included, and most 4-hour trades were open overnight (see 'Overnight fees'). The Nasdaq 100 made 8.4% on 4-hour charts: it lost 4.4% in 2020–2023 and made 13.5% in 2024–2025. The other 7 tests on 4-hour charts lost from 2.8% (the DAX, see 'DAX data') to 23.9% (silver). With 27 tests, a few good results can come from luck alone.

  2. MFI with volume went below 20 or above 80 much more often than MFI without volume. To see what the volume does, we also ran the 27 tests with MFI calculated without volume: every candle's volume counted as 1. On 1-hour charts, MFI with volume was below 20 or above 80 on 8.4% to 17.7% of the candles, depending on the market. Without volume, MFI was below 20 or above 80 on only 2.3% to 3.3% of the candles. So in the 27 tests, the standard rules made 37,878 trades, almost 3 times the 12,985 trades of MFI without volume. Volume is uneven. It changes with the time of day: on every market, it was highest around the US stock market open. In a typical 14-candle MFI on a 1-hour chart, the busiest candle had 14% to 19% of the volume. With equal volume, each candle would have 7%. So a few candles with a lot of volume can push MFI below 20 or above 80, even when most of the other candles moved the other way. The volume changes how often the strategy trades, and the next finding shows what that did to the results.

  3. Per trade, the volume helped only on 1-hour charts. On this page, R is the money a trade risks: 1% of the account when the trade opens. A trade that hits its stop-loss loses about 1R, and −0.065R per trade means that the average trade lost 6.5% of the amount it risked. On 1-hour charts, the average MFI trade lost 0.065R after trading costs, and the average trade of MFI without volume lost 0.138R. We also compared MFI 20/80 with RSI 30/70, because both made about as many trades: 37,878 and 40,502 in the 27 tests. Both used the same exits and stop-loss. On 1-hour charts, the average RSI 30/70 trade lost 0.083R, a little more than MFI, but a gap this small can come from luck. On 15-minute charts, all four indicators in the table below lost 0.077R to 0.088R per trade. On 4-hour charts, MFI lost 0.028R per trade and RSI 30/70 lost 0.027R. MFI without volume made 0.000R per trade there, the best of the four, but with fewer than 100 trades on each market.

  4. With the standard rules, about half of the trades hit the stop-loss, and more than half of these within 5 candles of opening. Another 33% to 40% closed when MFI crossed 50 against the trade. Of the trades that closed at 50, 6 or 7 in 10 made money, but only +0.36R to +0.58R on average. Only 12.5% to 17.4% of the trades reached the other level (80 for a buy, 20 for a short), and they made +1.77R to +2.05R on average. Without the exit at 50, about 3 trades in 4 hit the stop-loss, and the trades that reached the other level made +2.18R to +2.71R. On 1-hour and 4-hour charts, the average trade then lost more: 0.073R instead of 0.065R, and 0.052R instead of 0.028R. On 15-minute charts, it lost a little less: 0.078R instead of 0.084R. So the exit at 50 gave a smaller average loss on 1-hour and 4-hour charts, and made little difference on 15-minute charts (see 'How the trades ended' below).

  5. The 200 EMA trend filter helped on stock indices on 1-hour and 4-hour charts, but not on currency pairs. An EMA (exponential moving average) is an average of past closing prices that gives more weight to the newest ones, here over 200 candles. With the filter, the rules buy only when price is above the 200 EMA, and sell short only when it is below. On the 4 stock indices, the average 4-hour trade made +0.128R after costs with the filter, against 0.000R without it. There, the filter left only 93 short trades, instead of 604. On the indices' 1-hour charts, the average trade lost 0.009R with the filter, against 0.025R without it. On gold and silver, the filter helped only on 1-hour charts: the average trade lost 0.013R with it, against 0.133R without it. On the 3 currency pairs, it made the average trade worse on all three charts. With the filter, every 4-hour test made fewer than 100 trades in 6 years, so the 4-hour gain is based on only 326 trades. Counting only tests with at least 100 trades, 1 test made money in both periods with the filter, against 2 with the standard rules.

Volume or no volume

With volume, MFI made about 3 times as many trades as without it, and lost less per trade on 1-hour charts

We ran the 27 tests four ways, with the same exits, stop-loss and trade sizes. MFI 20/80 with volume is the standard rules. MFI 20/80 without volume counts every candle's volume as 1. RSI 20/80 and RSI 30/70 use RSI over the last 14 candles instead of MFI, with the levels 20 and 80, or 30 and 70. Each row adds up the trades of the 9 markets on one chart, from 2020 to 2025.

Chart Indicator Trades R per trade before costs R per trade after costs Tests that made money
15-minute MFI 20/80 with volume 26,018 −0.011R −0.084R 0 of 9
15-minute MFI 20/80 without volume 9,735 −0.011R −0.088R 0 of 9
15-minute RSI 20/80 5,740 −0.026R −0.086R 0 of 9
15-minute RSI 30/70 29,459 −0.013R −0.077R 0 of 9
1-hour MFI 20/80 with volume 9,805 −0.030R −0.065R 1 of 9
1-hour MFI 20/80 without volume 2,545 −0.102R −0.138R 0 of 9
1-hour RSI 20/80 1,719 −0.077R −0.108R 2 of 9
1-hour RSI 30/70 8,739 −0.050R −0.083R 0 of 9
4-hour MFI 20/80 with volume 2,055 −0.012R −0.028R 2 of 9
4-hour MFI 20/80 without volume 705 +0.017R 0.000R 4 of 9 (all 9 tests had fewer than 100 trades)
4-hour RSI 20/80 410 −0.043R −0.058R 3 of 9 (all 9 tests had fewer than 100 trades)
4-hour RSI 30/70 2,304 −0.011R −0.027R 3 of 9

R per trade is the average result of a trade, in R. 'Before costs' is the result the trades would have had without trading costs. On 4-hour charts, MFI without volume made 0.000R per trade (no profit and no loss), the best of the four. But it made only 705 trades in all, and fewer than 100 on each market, too few to judge any single market.

How the trades ended

About half of the trades hit the stop-loss, and without the exit at 50, about 3 in 4 did

Each row adds up the trades of the 9 markets on one chart, from 2020 to 2025. For each way a trade could end, the table shows the share of the trades that ended that way, and in brackets their average result after trading costs.

Chart Rules Hit the stop-loss MFI crossed 50 against the trade MFI reached the other level R per trade after costs
15-minute Standard rules 48.0% (−1.02R) 39.5% (+0.38R) 12.5% (+2.03R) −0.084R
15-minute No exit at 50 74.2% (−1.02R) — 25.8% (+2.62R) −0.078R
1-hour Standard rules 49.5% (−0.99R) 33.1% (+0.36R) 17.4% (+1.77R) −0.065R
1-hour No exit at 50 71.2% (−0.98R) — 28.7% (+2.18R) −0.073R
4-hour Standard rules 53.1% (−0.94R) 33.2% (+0.58R) 13.6% (+2.05R) −0.028R
4-hour No exit at 50 75.6% (−0.94R) — 24.2% (+2.71R) −0.052R

A few trades were still open at the end of 2025 and closed there: 1 with the standard rules and 7 without the exit at 50. A trade that hits its stop-loss can lose a little more or less than 1R. It opens at the next candle's open, not at the price its size was set for, and its size is rounded down to a size the market allows. Of the trades that closed when MFI crossed 50, 60% made money on 15-minute and 1-hour charts, and 67% on 4-hour charts.

The 200 EMA trend filter

The trend filter helped on stock indices (1-hour and 4-hour charts) and on gold and silver (1-hour charts), but never on currency pairs

Each row adds up the trades of one group of markets on one chart, from 2020 to 2025. The groups are the 3 currency pairs, gold and silver, and the 4 stock indices: the S&P 500, the Nasdaq 100, the Dow Jones and the DAX. R per trade is after trading costs.

Chart Markets Without the filter: trades Without the filter: R per trade With the filter: trades With the filter: R per trade
15-minute Currency pairs 8,945 −0.115R 2,563 −0.150R
15-minute Gold and silver 3,624 −0.190R 1,566 −0.205R
15-minute Stock indices 13,449 −0.035R 4,173 −0.036R
1-hour Currency pairs 2,692 −0.101R 745 −0.118R
1-hour Gold and silver 1,718 −0.133R 447 −0.013R
1-hour Stock indices 5,395 −0.025R 1,671 −0.009R
4-hour Currency pairs 549 −0.027R 121 −0.055R
4-hour Gold and silver 412 −0.104R 101 −0.137R
4-hour Stock indices 1,094 0.000R 326 +0.128R

With the filter, every 4-hour test made fewer than 100 trades in 6 years. Without the filter, the 4-hour index charts made 490 buy trades, which made +0.116R each, and 604 short trades, which lost 0.093R each. With the filter, they made 233 buy trades, which made +0.140R each, and 93 short trades, which made +0.097R each.

The strategy

What the Money Flow Index 20/80 is

The Money Flow Index (MFI) is an indicator from 0 to 100, like RSI, but it also uses volume. RSI (Relative Strength Index) compares the size of the recent rises and falls in price. MFI starts from each candle's typical price: the average of its high, low and close. A candle's money flow is its typical price times its volume. The money flow counts as positive when the typical price is higher than on the candle before, and as negative when it is lower. MFI adds up the positive money flow of the last 14 candles, and, separately, the negative money flow. Then it shows the positive total as a share of both totals together, from 0 to 100. Prices change little over 14 candles, so MFI is very close to the share of the volume that was traded in candles with a higher typical price. Most trading platforms mark the levels 80 and 20 on MFI. Traders call MFI above 80 overbought (price has risen a lot) and below 20 oversold (price has fallen a lot), and some use 90 and 10 instead. A common way to trade MFI is the one we tested. Buy when MFI crosses back above 20, and sell short when it crosses back below 80. The idea is that after MFI goes below 20 or above 80, price may turn. Gene Quong and Avrum Soudack published MFI in 1989, and it is often called a volume-weighted RSI.

MFI
14 candles, levels 20 and 80 (the usual settings). The strategy calculates MFI itself, from each candle's high, low, close and volume. The volume of a 15-minute, 1-hour or 4-hour candle is the total volume of its 1-minute candles. No trade opens in the first 200 candles of a test. This way, the standard rules and the three changes we tested all start on the same candle: one change uses the 200 EMA, which needs 200 candles.
Price data
CFD prices: the prices a broker quotes for a CFD (contract for difference). A CFD is a contract that pays the change in a market's price, without owning the market itself. Most brokers outside the US offer CFDs for trading these markets. The strategy skips two kinds of candle, and these candles don't count for MFI or the ATR. First, on some Fridays, the data has a few minutes of prices after the weekly close at 17:00 New York time, which make a tiny extra candle. Second, some candles show no price change at all (the high equals the low), for example on market holidays. In every test, these were less than 1% of the candles.
Volume
MFI uses the volume that comes with our price data. This volume comes from one data source, not from an exchange: forex has no central exchange, and our prices are CFD prices. So it is not the amount traded on the whole market. On forex and CFD charts, most trading platforms also show volume from one source, often tick volume (the number of price changes). If your platform's volume is different, your MFI and its signals can be different from ours.
Volume checks
Before the test, we checked the volume on all 9 markets from 2020 to 2025. MFI could be calculated on every candle: there were never 14 candles in a row with no volume. The DAX had the most candles with no volume: 0.62% of its 15-minute candles and 0.18% of its 1-hour candles. On every 4-hour chart, 0.03% or fewer of the candles had no volume. On every market, the busiest hour of the day was the candle that starts at 9:00 or 10:00 New York time, around the US stock market open. On EUR/USD, a typical candle at 10:00 New York time had 15 times the volume of a candle at 17:00. The volume also changed between years. A typical DAX day had about a tenth as much volume in 2024 as in 2020, and a typical Nasdaq 100 day had about a ninth as much. This matters little for MFI, because MFI compares only the volume of the last 14 candles.
Stop-loss
1.5 × ATR(14) away from the close of the candle that gave the signal. ATR (average true range) is an indicator of how far price moves in an average candle, here over the last 14 candles. The stop-loss does not move.
Exit
A buy trade closes at the next candle's open after MFI reaches 80, or after MFI falls from 50 or more to below 50. A short trade closes after MFI reaches 20, or after MFI rises from 50 or less to above 50. So a buy closes at 50 only after MFI has closed at 50 or more. Until then, a buy waits for MFI to reach 80, or for the stop-loss.
Take-profit
There is no take-profit. A trade closes on an MFI exit or at the stop-loss.
Risk per trade
1% of the account, which started at $10,000. The trade size is set at the close of the signal candle, and rounded down to a size the market allows. The trade opens at the next candle's open. So a loss at the stop-loss was usually close to 1% of the account, but not exactly. It was bigger when price jumped past the stop-loss. With the standard rules, 69 out of 26,018 trades on 15-minute charts lost more than 1.5% of the account. On 1-hour charts, 19 out of 9,805 trades did, and on 4-hour charts, none. Of these 88 trades, 38 were open over a weekend. The biggest loss on one trade, 10.6% of the account, was a DAX trade on the 15-minute chart on 23 October 2020. Its stop-loss was hit by a wrong price (see 'DAX data'). The next, 7.9%, was a Nasdaq 100 trade on the 15-minute chart on 17 February 2020, a US holiday. Our data has no prices for 5 hours that afternoon, and price was below the stop-loss when trading started again. Margin is the money a broker holds while a trade is open. In the test, it was 1/30 of the trade's value on currency pairs, and 1/20 on gold, silver and the indices. On 15-minute charts, 51 trades were made smaller than the 1% size because the account did not have enough margin, so they risked less than 1%.
Trading costs
Every trade pays the spread: the gap between the buy price and the sell price. These rules use only market orders (orders that fill at the next available price) and stop-losses. So a trade pays half the spread when it opens and half when it closes. There is no commission and no extra slippage. When price jumps past a stop-loss, the trade closes at the first price after the jump (see 'Risk per trade'). The spread is 0.8 pips on EUR/USD, 1.2 on GBP/USD and 0.9 on USD/JPY (a pip is 0.0001 on EUR/USD and GBP/USD, and 0.01 on USD/JPY). It is $0.30 an ounce on gold and $0.020 an ounce on silver. On the indices, it is 0.4 points on the S&P 500, 1.5 on the Nasdaq 100, 2.0 on the Dow Jones and 1.0 on the DAX. For silver, the Nasdaq 100, the Dow Jones and the DAX, we used spreads wider than the BacktestingMax engine's default ones, to match a typical retail broker. With the standard rules, trading costs took 0.073R from the average trade on 15-minute charts, 0.035R on 1-hour charts and 0.016R on 4-hour charts. R is explained above, in finding 3 under 'What the 27 backtests show'.
Smallest trade size
Each market has a smallest trade: 1,000 units of a currency pair, 1 ounce of gold, 50 ounces of silver or 0.1 of an index contract. When the trade that risks 1% would be smaller than that, the backtest skips the signal. With the standard rules, the 15-minute backtests skipped 2,804 out of 28,822 signals: 1,890 on silver, 742 on gold, 155 on GBP/USD and 17 on the indices. All but 9 of these 2,804 came while the account was below $1,000, more than 90% down. The 1-hour backtests skipped 34 signals on gold, silver and the DAX, all from April 2025, after these accounts had lost more than half. The 4-hour backtests skipped 7 signals, 5 of them on the Dow Jones in March 2020. Price moved so much then that even the smallest trade would have risked more than 1%.
DAX data
Our DAX data has some wrong prices, and the results on this page include them. They come at times with no trading, mostly between 22:00 and 23:00 German time, and they have no volume. They are typically about 1.2% away from the last real price, and at most 3.7%. From 2020 to 2025, they appear on 40 days. With no volume, they add nothing to MFI's money flow. But a wrong price can change a candle's high, low or close, and so whether the candle counts as moving up or down. It can also hit a stop-loss. So we ran the DAX tests again without the wrong prices. With the standard rules, the DAX 4-hour test lost 2.8% with the wrong prices (the result on this page) and 7.9% without them. The 15-minute and 1-hour results changed by less than 1% of the account. The biggest loss on one trade on this page, 10.6% of the account, came from a wrong price. No result changed from a loss to a profit. Only one changed from a profit to a loss: without the exit at 50, the DAX 4-hour test made 7.6% with the wrong prices and lost 5.6% without them. That test lost money in 2020–2023 and made money in 2024–2025 either way. So in every version, the number of tests that made money in each period stayed the same.
Wrong prices on other markets
We checked the other 8 markets for the same problem: minutes with no volume, at a price more than 0.75% away from the last price with volume. From 2020 to 2025, it happened on one day, on silver: on 1 June 2023, 7 of these minutes were up to 1.5% away. Without these 7 minutes, the silver results with the standard rules did not change.
Daily charts
9 extra backtests, separate from the 27: the same markets and rules on daily charts, from 2020 to 2025. They made only 15 to 25 trades on each market, 184 in all, too few to judge any single market. 6 of the 9 made money, and the best, USD/JPY, made 8.8%. Together, the 184 trades made +9.7R after trading costs: the sum of all 184 trade results, about +0.05R per trade. Half of the daily trades lasted 14 days or more, so overnight fees would change these results. The daily results are not in 'Results on every market'.
Overnight fees
Overnight fees are not included. Brokers charge a fee (a swap), or sometimes pay one, for each night a trade stays open past 17:00 New York time. With the standard rules, 76.9% of the 4-hour trades were open at 17:00 New York time at least once, so most 4-hour trades would pay or receive this fee. The same was true for 31.9% of the 1-hour trades and 10.2% of the 15-minute trades. Half of the trades lasted 2 hours or less on 15-minute charts, 6 hours or less on 1-hour charts and 36 hours or less on 4-hour charts.

The rules we tested

  1. Calculate MFI over the last 14 candles. Each candle's typical price is (high + low + close) ÷ 3, and its money flow is the typical price × the candle's volume. The money flow is positive when the typical price is higher than on the candle before, and negative when it is lower. MFI = 100 × positive money flow ÷ (positive + negative money flow), each added up over the 14 candles.
  2. Buy when MFI crosses back above 20: MFI was below 20 at the close of the candle before, and it is 20 or more at the close of this candle. The trade opens at the next candle's open.
  3. Sell short when MFI crosses back below 80: above 80 at the close of the candle before, and 80 or less at the close of this candle.
  4. Close a buy trade when MFI reaches 80, or when it crosses 50 against the trade: 50 or more at the close of the candle before, and below 50 now. Close a short trade when MFI reaches 20, or when it goes from 50 or less to above 50. The trade closes at the next candle's open.
  5. Put the stop-loss 1.5 × ATR(14) away from the close of the candle that gave the signal. ATR(14) is how far price moves in an average candle, over the last 14 candles. The stop-loss does not move.
  6. Set the trade size so that, if the stop-loss is hit, the trade loses about 1% of the account. Only one trade is open at a time: the rules ignore signals while a trade is open.

The method

How we tested it

The test

Markets
EUR/USD, GBP/USD, USD/JPY, Gold, Silver, S&P 500, Nasdaq 100, Dow Jones and DAX
Charts
15-minute, 1-hour and 4-hour candles
Dates
January 2020 to December 2025
Account
$10,000, risking 1% of the account on each trade
Trading costs
Included. Every trade pays that market's normal trading cost: the spread, which is the gap between the buy price and the sell price.

How a test passes

We call a test passed only if it meets all four checks. A strategy can make money in one backtest and still fail one of these checks.

  • At least 100 trades. With fewer trades, a good result could be luck.
  • It made money from 2020 to 2023 and again from 2024 to 2025. This shows whether the strategy kept working in the newer years, not only in the older ones.
  • A profit factor (the money won divided by the money lost) of at least 1.2 from 2024 to 2025, after trading costs.
  • In 95% of 1,000 random shuffles of the trades, the account must not fall more than 30% from its highest point.

Improvements

Can the Money Flow Index 20/80 be improved?

We tested three changes that traders make to the MFI 20/80 strategy: a trend filter, the levels 10 and 90, and no exit at 50. We tested each change on its own, on the same 27 tests. If we pick a change using the same years we judge it on, it will almost always look good, because we chose it for those years. So we picked the change that made money in the most tests in 2020–2023. Then we checked it on 2024–2025, the years we did not use to pick it.

Version Made money 2020–2023years used to pick the best version Made money 2024–2025years not used to pick it Made money in both periods Passed all four checks
Standard rules The rules under 'The rules we tested', with nothing changed. 5 of 27middle test −31.9% 7 of 27middle test −14.9% 2 1
With a 200 EMA trend filterBest on 2020–2023 Only buy when the signal candle closes above the 200 EMA, and only sell short when it closes below. An EMA (exponential moving average) is an average of past closing prices that gives more weight to the newest ones, here over 200 candles. Everything else stays the same. 5 of 27middle test −8.9% 12 of 27middle test −1.0% 1 0
Levels 10 and 90 instead of 20 and 80 Buy when MFI crosses back above 10, and sell short when it crosses back below 90. A buy closes when MFI reaches 90, and a short when MFI reaches 10. The exit at 50 and the stop-loss stay the same. 4 of 27middle test −25.1% 7 of 27middle test −5.7% 2 1
No exit at 50 No exit when MFI crosses 50 against the trade. A trade stays open until MFI reaches the other level (80 for a buy, 20 for a short) or the stop-loss is hit. 4 of 27middle test −34.3% 6 of 27middle test −21.5% 1 1

Can the strategy be improved? Not clearly. Of the three changes, the 200 EMA trend filter made money in the most tests in 2020–2023: 5 of the 27. So we picked it. The standard rules also made money in 5 tests in those years. In 2024–2025, the filter made money in 12 of the 27 tests, against 7 with the standard rules. But 8 of these 12 were 4-hour tests, and with the filter, every 4-hour test made fewer than 100 trades in 6 years. With at least 100 trades, only the Dow Jones 1-hour test made money in both periods with the filter: +44.6% from 2020 to 2025, against +15.3% with the standard rules. It did not pass all four checks, because its profit factor in 2024–2025 was 1.13, below 1.2. The other two changes did not clearly help either. With the levels 10 and 90, the Nasdaq 100 1-hour test made 24.3% and passed all four checks. But the average trade lost more than with the standard rules on every chart, before and after trading costs. Without the exit at 50, the Nasdaq 100 4-hour test made 45.1% and passed all four checks. But across all 9 markets, the average trade on 1-hour and 4-hour charts lost more without the exit at 50.

Questions

Questions traders ask

Does the Money Flow Index 20/80 strategy work?

Not on most markets in our test. The Money Flow Index (MFI) is an indicator from 0 to 100 that uses volume. It is close to the share of the last 14 candles' volume that was traded in candles in which price rose. The standard rules buy when MFI rises back above 20, and sell short when it falls back below 80. They close a buy when MFI reaches 80 or falls back below 50, and a short when MFI reaches 20 or rises back above 50. From 2020 to 2025, after trading costs, they made money in 3 of the 27 tests on 9 markets. These were EUR/USD and the Nasdaq 100 on 4-hour charts, and the Dow Jones on 1-hour charts. All 9 tests on 15-minute charts lost money. Before trading costs, the average trade lost a little on 15-minute, 1-hour and 4-hour charts, so the costs made small losses bigger.

Is MFI better than RSI?

Not clearly, in our test. RSI (Relative Strength Index) is an indicator from 0 to 100 that compares the size of the recent rises and falls in price, and it uses no volume. We ran the same rules with RSI(14) instead of MFI, with the same exits and stop-loss. MFI 20/80 made about as many trades as RSI 30/70, 37,878 against 40,502 in the 27 tests, so RSI 30/70 is the fair comparison. On 1-hour charts, after trading costs, the average MFI trade lost 6.5% of the amount it risked (−0.065R), and the average RSI 30/70 trade lost 8.3% (−0.083R). A gap this small can come from luck. On 15-minute and 4-hour charts, they did about the same. With MFI, 1 of the 9 tests on 1-hour charts made money, and 2 of the 9 on 4-hour charts. With RSI 30/70, 0 of the 9 on 1-hour charts and 3 of the 9 on 4-hour charts made money.

Should you use 20/80 or 10/90 on the Money Flow Index?

In our test, 20/80 did better. With the levels 10 and 90, MFI gave fewer trades: 10,607 in the 27 tests, against 37,878 with 20 and 80. But the average trade lost more on every chart, before and after trading costs. On 1-hour charts, it lost 8.0% of the amount it risked after costs, against 6.5% with 20 and 80. Waiting for a more extreme MFI did not give a better average trade. With 10 and 90, 2 tests still made money in both 2020–2023 and 2024–2025: the Nasdaq 100 on 1-hour charts and the Dow Jones on 4-hour charts. That is as many as with 20 and 80.

What is the best timeframe for the Money Flow Index?

In our test, 4-hour charts lost the least, but no timeframe made money on most markets. With the standard rules, 2 of the 9 tests on 4-hour charts made money, 1 of the 9 on 1-hour charts and none of the 9 on 15-minute charts. On each chart, we ranked the 9 tests by result. The middle one, with 4 better and 4 worse, lost 5.4% on 4-hour charts, 62.6% on 1-hour charts and 96.0% on 15-minute charts. On 15-minute charts, trading costs took 7.3% of the amount a trade risked, against 1.6% on 4-hour charts. We also ran daily charts: 6 of the 9 made money, but with only 15 to 25 trades on each market in 6 years, too few to judge.

Keep exploring

Related strategies we tested

Volume indicators OBV trend strategy backtest Made money in 17 of 30 tests, 10 of them in both periods. Best: DAX, 1-hour, +169%
The strategy code we ran

This is the exact code from the BacktestingMax strategy engine. Paste it into the strategy editor in the app to run it on any market.

class MoneyFlowIndex2080(Strategy):
    """Money Flow Index 20/80: buy when MFI(14) climbs back above 20, sell short when it
    drops back below 80. Plus the changes traders try, one at a time.
    MFI (Gene Quong and Avrum Soudack, 1989), worked out on the candles the strategy uses:
      typical price = (high + low + close) / 3
      money flow    = typical price x the candle's volume (the total of its 1-minute volumes)
      A candle's money flow counts as positive when its typical price is higher than the
      candle before, as negative when it is lower, and as neither when it is the same.
      MFI = 100 - 100 / (1 + positive flow / negative flow), each added up over the last 14
      candles. With no negative flow MFI is 100, with no positive flow it is 0. When no candle
      in the 14 had any volume, MFI has no value: that candle gives no signal and no exit.
    Standard rules (all switches off):
      Buy at the next open when MFI crosses back above 20: below 20 on the candle before, and
      20 or more now. Sell short at the next open when MFI crosses back below 80.
      Exit at the next open when MFI reaches the other level (80 or more for a buy, 20 or less
      for a sell), or when MFI crosses 50 against the trade (from 50 or more to below 50 for a
      buy, from 50 or less to above 50 for a sell).
      Stop-loss: 1.5 x ATR(14) from the close of the signal candle. It does not move. ATR is
      Wilder's average true range, started with the simple average of the first 14.
      Size: 1% of the account lost at the stop. When that is less than the smallest trade size
      the market allows, the signal is skipped. One trade at a time. No trade in the first 200
      candles (the 200 EMA needs them), so every version starts trading on the same candle.
    Skipped candles: a candle that opens on a Friday at 17:00 New York time or later, or on a
    Saturday (on some markets, a few minutes of prices after the weekly close make a tiny extra
    candle), and a candle with no range (high = low, for example a market holiday). They don't
    count for MFI, RSI, the ATR or the EMA, and they give no signal and no exit. On a market
    that trades at the weekend, remove the Friday rule.
    The changes, one at a time:
      ema_filter = 1          only buy when the close is above the 200 EMA, and only sell short
                              when it is below (the EMA starts at the first close)
      lower = 10, upper = 90  the levels 10 and 90 instead of 20 and 80: for the entries and
                              for the exit at the other level (the exit at 50 stays)
      exit_mid = 0            no exit at 50: a trade stays open until MFI reaches the other
                              level or the stop-loss is hit
    The checks on the volume:
      use_volume = 0          every candle's volume counts as 1, so MFI weighs every candle the
                              same
      use_rsi = 1             RSI(14) of the close (Wilder's) instead of MFI, with the same
                              levels and exits
    """
    params = {"mfi_period": Param(type=int, default=14, min=2, max=200),
              "lower": Param(type=float, default=20.0, min=1.0, max=49.0),
              "upper": Param(type=float, default=80.0, min=51.0, max=99.0),
              "middle": Param(type=float, default=50.0, min=1.0, max=99.0),
              "atr_period": Param(type=int, default=14, min=2, max=100),
              "atr_mult": Param(type=float, default=1.5, min=0.5, max=10.0),
              "ema_filter": Param(type=int, default=0, min=0, max=1),
              "ema_len": Param(type=int, default=200, min=2, max=500),
              "use_volume": Param(type=int, default=1, min=0, max=1),
              "use_rsi": Param(type=int, default=0, min=0, max=1),
              "exit_mid": Param(type=int, default=1, min=0, max=1)}
    lookback = 5
    warmup = 200  # candles used before the first trade, the same for every version
    def init(self, ctx):
        self.ny = ctx.clock("America/New_York")
        self.used = 0            # candles used so far
        self.prev_close = None   # close of the previous candle used (ATR, RSI)
        self.prev_tp = None      # typical price of the previous candle used (MFI)
        self.flows = []          # (positive, negative) money flow of the last candles used
        self.first_trs = []      # the first true ranges, until the ATR can start
        self.atr = None
        self.ema = None
        self.first_moves = []    # the first (gain, loss) pairs, until the RSI can start
        self.avg_gain = None
        self.avg_loss = None
        self.osc = None          # MFI (or RSI) on the previous candle used
    def on_bar(self, ctx):
        p = ctx.params
        high, low, close = ctx.high[0], ctx.low[0], ctx.close[0]
        wd, hr = self.ny.weekday, self.ny.hour
        if (wd == 4 and hr >= 17) or wd == 5 or high <= low:
            return  # a tiny candle after the Friday close, or a candle with no range
        # ATR (Wilder's average of the true range) and RSI (Wilder's), both started with the
        # simple average of their first values.
        if self.prev_close is None:
            true_range, move = high - low, None
        else:
            true_range = max(high - low, abs(high - self.prev_close), abs(low - self.prev_close))
            move = close - self.prev_close
        self.prev_close = close
        if self.atr is None:
            self.first_trs.append(true_range)
            if len(self.first_trs) == p.atr_period:
                self.atr = sum(self.first_trs) / p.atr_period
        else:
            self.atr += (true_range - self.atr) / p.atr_period
        if move is not None:
            gain, loss = max(move, 0.0), max(-move, 0.0)
            if self.avg_gain is None:
                self.first_moves.append((gain, loss))
                if len(self.first_moves) == p.mfi_period:
                    self.avg_gain = sum(g for g, _ in self.first_moves) / p.mfi_period
                    self.avg_loss = sum(l for _, l in self.first_moves) / p.mfi_period
            else:
                self.avg_gain += (gain - self.avg_gain) / p.mfi_period
                self.avg_loss += (loss - self.avg_loss) / p.mfi_period
        # 200 EMA of the close (only the ema_filter version uses it).
        self.ema = close if self.ema is None else self.ema + (close - self.ema) * 2.0 / (p.ema_len + 1)
        # MFI over the last mfi_period candles used.
        typical = (high + low + close) / 3.0
        volume = ctx.volume[0]
        volume = 1.0 if p.use_volume == 0 else (volume if volume and volume > 0 else 0.0)
        if self.prev_tp is not None:
            flow = typical * volume
            self.flows.append((flow if typical > self.prev_tp else 0.0,
                               flow if typical < self.prev_tp else 0.0))
            del self.flows[:-p.mfi_period]
        self.prev_tp = typical
        osc = None
        if p.use_rsi == 1:
            if self.avg_gain is not None and (self.avg_gain > 0 or self.avg_loss > 0):
                osc = 100.0 if self.avg_loss == 0 else 100.0 - 100.0 / (1.0 + self.avg_gain / self.avg_loss)
        elif len(self.flows) == p.mfi_period:
            positive = sum(f[0] for f in self.flows)
            negative = sum(f[1] for f in self.flows)
            if negative > 0:
                osc = 100.0 - 100.0 / (1.0 + positive / negative)
            elif positive > 0:
                osc = 100.0
        before, self.osc = self.osc, osc
        self.used += 1
        if osc is None or before is None or self.atr is None:
            return
        pos = ctx.position
        if pos is not None:
            if pos.is_long:   # MFI reached 80, or crossed from 50 or more to below 50
                done = osc >= p.upper or (p.exit_mid == 1 and before >= p.middle > osc)
            else:             # MFI reached 20, or crossed from 50 or less to above 50
                done = osc <= p.lower or (p.exit_mid == 1 and before <= p.middle < osc)
            if done:
                ctx.close_position()
            return
        if self.used <= self.warmup:
            return
        go_long = before < p.lower <= osc      # MFI crosses back above 20
        go_short = before > p.upper >= osc     # MFI crosses back below 80
        if not ctx.gate("mfi_crosses_back", go_long or go_short):
            return
        if p.ema_filter == 1:
            trend_ok = close > self.ema if go_long else close < self.ema
            if not ctx.gate("ema_side", trend_ok):
                return
        entry = close
        distance = p.atr_mult * self.atr
        if distance <= 0:
            return
        stop = entry - distance if go_long else entry + distance
        size = ctx.size_by_risk_pct(0.01, stop=stop, entry=entry)
        if not ctx.gate("size_at_least_min", size > 0):
            return  # 1% of the account is less than the smallest trade size: skip the signal
        if go_long:
            ctx.buy(size=size, sl=stop, tag="mfi_long")
        else:
            ctx.sell(size=size, sl=stop, tag="mfi_short")

Your turn

Test the Money Flow Index 20/80 yourself

Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest the Money Flow Index 20/80 strategy on EUR/USD, 4-hour chart: buy when MFI(14) crosses back above 20, sell short when it crosses back below 80, close a buy when MFI reaches 80 or falls back below 50, close a short when MFI reaches 20 or rises back above 50, stop-loss 1.5 ATR(14), risk 1% per trade.

Try it free in BacktestingMax

Free account. No credit card needed.

See every strategy we tested Browse strategies shared by traders

Backtest on historical data with trading costs, run by BacktestingMax. Past results do not guarantee future results, and nothing here is financial advice. Updated 16 November 2026.