
Many trend tools only look at price. The Money Flow Index adds a second question: how much activity supported that price change? That question sits at the heart of the XHMaster Formula indicator's filtering, which is why understanding the Money Flow Index indicator formula makes you a better user of both. This guide breaks the calculation into its parts, works through a real example by hand, explains what the readings mean in forex, and shows how to combine the MFI with a colour-flip trend line.
What the Money Flow Index measures
The Money Flow Index, usually shortened to MFI, is an oscillator that moves between 0 and 100. It was introduced by Gene Quong and Avrum Soudack and is often described as a volume-weighted RSI. Where the RSI compares the size of up-closes with down-closes, the MFI compares the money flowing in on up-bars with the money flowing out on down-bars, where money flow is price multiplied by volume.
The result answers a practical question: is the recent movement backed by participation, or is price drifting on thin activity? Strong moves on high volume push the MFI towards the extremes. Moves on low volume barely shift it.
The Money Flow Index formula, step by step
The calculation has five stages. The standard lookback period is 14 bars.
Step 1: Typical price
For each bar, calculate the typical price:
Typical Price = (High + Low + Close) ÷ 3
Using the average of the three values reflects the whole bar rather than just the close.
Step 2: Raw money flow
Multiply the typical price by the bar's volume:
Raw Money Flow = Typical Price × Volume
Step 3: Classify each bar as positive or negative
Compare each bar's typical price with the previous bar's typical price:
- If it is higher, that bar's raw money flow counts as positive money flow.
- If it is lower, it counts as negative money flow.
- If it is unchanged, the bar is ignored.
Step 4: Money ratio
Add up the positive money flow over the lookback period and the negative money flow over the same period, then divide:
Money Ratio = Sum of Positive Money Flow ÷ Sum of Negative Money Flow
Step 5: Money Flow Index
Finally convert the ratio into a value between 0 and 100:
MFI = 100 − 100 ÷ (1 + Money Ratio)
If positive and negative flow are equal, the ratio is 1 and the MFI is 50. If positive flow dominates, the ratio rises above 1 and the MFI climbs towards 100. If negative flow dominates, it falls towards 0.
A worked example by hand
To keep the arithmetic readable, the example below uses a five-bar lookback on EURUSD with tick volume. The first row provides the starting typical price, and the next five rows are classified.
| High | Low | Close | Volume | Typical price | Raw money flow | Direction |
|---|---|---|---|---|---|---|
| 1.0870 | 1.0830 | 1.0850 | 1200 | 1.08500 | 1,302.0 | start |
| 1.0880 | 1.0840 | 1.0872 | 1500 | 1.08640 | 1,629.6 | + |
| 1.0875 | 1.0838 | 1.0845 | 1100 | 1.08527 | 1,193.8 | − |
| 1.0905 | 1.0850 | 1.0898 | 1800 | 1.08843 | 1,959.2 | + |
| 1.0902 | 1.0870 | 1.0874 | 1300 | 1.08820 | 1,414.7 | − |
| 1.0920 | 1.0872 | 1.0915 | 1700 | 1.09023 | 1,853.4 | + |
Now apply steps 4 and 5:
- Positive money flow = 1,629.6 + 1,959.2 + 1,853.4 = 5,442.2
- Negative money flow = 1,193.8 + 1,414.7 = 2,608.5
- Money ratio = 5,442.2 ÷ 2,608.5 = 2.086
- MFI = 100 − 100 ÷ (1 + 2.086) = 67.6
An MFI of 67.6 says buying pressure has clearly outweighed selling pressure over the window. Notice that the up-bars also carried the heavier volume. If the same price path had occurred with the high volume on the down-bars, the MFI would have been much lower, even though price ended in the same place. That sensitivity to volume is what makes the indicator useful.
Volume in forex: tick volume and why it still works
The spot forex market is decentralised, so there is no single exchange reporting total traded volume. MetaTrader and most charting platforms display tick volume: the number of price changes recorded by your broker in each bar. Tick volume is not the same as traded volume, but studies and long practical experience show that it tracks overall activity reasonably well. Busy periods produce more price updates; quiet periods produce fewer.
The practical consequences are:
- MFI readings from two different brokers will differ slightly because each has its own tick count.
- Absolute volume numbers mean little; the relative comparison between up-bars and down-bars is what matters.
- During thin holiday sessions, tick volume collapses and MFI readings become less reliable.
Interpreting MFI readings
| MFI value | Common reading | Practical meaning |
|---|---|---|
| Above 80 | Overbought | Strong buying; momentum may be stretched |
| 50 – 80 | Bullish pressure | Buyers in control, trend-following longs favoured |
| Around 50 | Balanced | No clear pressure; trend signals less reliable |
| 20 – 50 | Bearish pressure | Sellers in control, trend-following shorts favoured |
| Below 20 | Oversold | Strong selling; momentum may be stretched |
Two cautions apply. First, in a powerful trend the MFI can stay above 80 or below 20 for a long time; "overbought" does not mean "about to fall". Second, the thresholds are conventions, not laws. Some traders use 70 and 30 on lower timeframes or 90 and 10 on volatile instruments such as gold.
Divergence: the MFI's most valuable signal
A divergence occurs when price and the MFI disagree:
- Bearish divergence: price makes a higher high, but the MFI makes a lower high. The new price extreme was reached on weaker money flow.
- Bullish divergence: price makes a lower low, but the MFI makes a higher low. Selling pressure is fading even as price dips.
Divergences are early warnings, not entry signals. They often appear several bars before a trend indicator such as the XHMaster Formula line changes colour. Many traders use a divergence as a reason to tighten stops or take partial profit on an open trade, then wait for the colour flip to confirm a reversal before entering the other way.
How the MFI improves XHMaster Formula signals
A trend line that flips on smoothed price alone will flip whenever the smoothed curves cross, whether or not the move had participation. Adding an MFI condition creates a money-flow gate:
- A buy flip is accepted only if the MFI is above 50, or above a slightly stricter level such as 52.
- A sell flip is accepted only if the MFI is below 50, or below 48.
This is the logic used by the demo signal desk on our homepage. In quiet, directionless markets the MFI hovers around 50, and many of the crossovers that would otherwise produce whipsaws are blocked. In active trends the MFI sits comfortably on one side, and genuine flips pass through.
A simple confirmation table
| Trend line | MFI | Action |
|---|---|---|
| Flips green | Above 52 | Valid buy signal |
| Flips green | 48 – 52 | Wait; participation unclear |
| Flips green | Below 48 | Ignore; volume disagrees |
| Flips red | Below 48 | Valid sell signal |
| Flips red | 48 – 52 | Wait |
| Flips red | Above 52 | Ignore |
Adding the MFI to MetaTrader 4
MT4 includes the Money Flow Index as a standard indicator. Open Insert › Indicators › Volumes › Money Flow Index, set the period to 14 and click OK. It appears in a separate window below the chart. To add horizontal reference lines, open the indicator properties, go to the Levels tab and add levels at 20, 50 and 80.
If you plan to use the MFI inside an Expert Advisor, the built-in function iMFI(symbol, timeframe, period, shift) returns the value for any bar. Using shift = 1 reads the last closed bar, which avoids decisions based on an unfinished candle.
Choosing the lookback period
| Period | Behaviour | Suits |
|---|---|---|
| 7 – 10 | Fast, many extreme readings | Scalping, short-term timing |
| 14 | Standard balance of speed and stability | Most intraday and swing work |
| 20 – 30 | Slow, few extremes | Position trading, higher timeframes |
Shorter periods react quickly but produce more false extremes. Longer periods are steadier but late. Start with 14 and change it only if your journal shows a consistent reason to.
Common mistakes
- Selling every reading above 80. In trends, overbought can stay overbought.
- Comparing MFI values across brokers. Tick volume differs; compare readings on one feed.
- Ignoring session context. An MFI move during the Asian session on a European pair carries less weight than the same move during London.
- Using divergence as an entry on its own. Divergence warns; a confirmed price or trend signal should trigger the trade.
- Forgetting the live bar. The MFI on the current bar changes as volume accumulates; read closed bars for decisions.
MFI versus RSI at a glance
| Aspect | Money Flow Index | Relative Strength Index |
|---|---|---|
| Inputs | High, low, close, volume | Close only |
| Range | 0 – 100 | 0 – 100 |
| Common extremes | 80 / 20 | 70 / 30 |
| Strength | Detects moves lacking participation | Clean momentum reading |
| Weakness | Depends on volume quality | Blind to volume |
Neither is better in every case. Many traders keep the RSI for range-bound markets and the MFI for trend confirmation, which is exactly the role it plays alongside the XHMaster Formula indicator.
Building intuition: three scenarios
A breakout with conviction. Price breaks above a week-long range during the London open, and the MFI jumps from 51 to 74 within four bars. Both price and money flow agree. If the trend line flips green here, the signal has strong support.
A drift without participation. During a holiday session, price creeps higher for six hours, but tick volume is half its usual level and the MFI moves from 49 to 54. The trend line may turn green, but the gate is barely passed. Many traders would halve their position size or skip the trade.
An exhausted push. Price makes a new high after a long rally, but the MFI peaks at 71 while the previous high was accompanied by 86. That bearish divergence does not call a top on its own, but it is a reason to trail stops more tightly on existing longs and to treat the next red flip as a meaningful warning.
Calculating the MFI in a spreadsheet
If you want to verify your platform's readings, a spreadsheet is the quickest tool. Export price history from MT4 using the History Center (F2), open it in a spreadsheet and create columns for typical price, raw money flow, positive flow and negative flow. Typical price is the average of the high, low and close columns. Raw money flow multiplies that by the volume column. The positive-flow column uses an IF formula that returns the raw money flow when typical price is greater than the row above, and zero otherwise; the negative-flow column does the opposite. Finally, sum the last 14 rows of each flow column, divide positive by negative, and apply the MFI conversion.
Comparing your spreadsheet result with the MT4 indicator on the same closed bar is a useful exercise. Small differences usually come from rounding or from whether bars with unchanged typical price are handled identically. Large differences mean the volume data or the period setting does not match. Working through the calculation once makes every future reading far more intuitive.
Using MFI across timeframes
The MFI on a higher timeframe smooths out intraday noise and can act as a regime filter. Some traders require the H4 MFI to be above 50 before taking any long H1 signal, and below 50 before any short. Others use the daily MFI to spot broad accumulation or distribution phases. Keep the approach consistent: decide in advance which timeframe sets the bias and which provides the trigger, and record the readings of both in your journal so you can measure whether the extra filter helps.
Summary
The Money Flow Index indicator formula combines typical price and volume into a single pressure reading: calculate typical price, multiply by volume, separate positive and negative flow, take their ratio and convert it into a 0 – 100 scale. In forex it runs on tick volume, which is an imperfect but useful proxy. Read the MFI as a measure of participation, watch for divergences as early warnings, and use it as a gate that only lets XHMaster Formula signals through when money flow agrees. That combination removes many of the empty moves that cause trend traders the most frustration.


