1. Valmy
  2. Learn
  3. Indicator catalog
  4. T25

What changes when an indicator is weighted by volume? VWMA and the money flow index

Intermediate 14 min read

Short answerWeighting an indicator by volume makes bars with heavy trading count for more and quiet bars for less. A volume-weighted moving average (VWMA) therefore sits closer to the prices where most shares or coins changed hands than a simple moving average (SMA) of the same length; with equal volume on every bar, the two are identical. In this lesson's five-day example, the day with the highest close carries 40% of the volume, so VWMA is 20.68 while the SMA is 20.48. The money flow index (MFI) applies the same weighting to an RSI-style oscillator scaled from 0 to 100. The cost: sensitivity to single huge bars and to the quality of volume data.

With these indicators you can tell whether a rally was driven by a few heavy days or a new high came on thin buying; in MFI, a rise on thin volume counts for less than a rise on heavy volume. Before acting on a reading, look for one unusual day in the window: a single heavy bar can pull VWMA toward its price for as many bars as the window is long.

Valmy noteValmy's v1 strategy language includes the simple moving average and no other indicator, so VWMA and the money flow index are taught here for reading charts (as of 26 November 2026).

Volume-weighted moving average (VWMA): a moving average that counts heavy bars more#

The volume-weighted moving average (VWMA) measures the average closing price of the last n bars with each close weighted by that bar's volume: VWMA = Σ(close × volume) ÷ Σ volume over the n bars. Its inputs are the close and the volume. It is quoted in price units, like the SMA it is usually compared with. This lesson uses n = 20 bars. The TA-Lib library's VWMA function defaults to 30 bars and computes the same ratio, written as SMA(close × volume) ÷ SMA(volume), so check the length on any chart before comparing values. No single creator is credited. The simple moving average (SMA) is the special case in which every bar gets the same weight, so a VWMA differs from the SMA of the same length only when volume differs from bar to bar.

The difference between the two lines carries the information. VWMA above SMA means the heavier-volume bars in the window traded at higher prices than the lighter ones. VWMA below SMA means the heavy volume traded lower. The lesson What does a moving average actually measure? covers the SMA itself.

Calculating VWMA step by step#

VWMA over n bars equals the sum of close × volume for those bars divided by the sum of their volume. The example uses a 5-bar window to keep the arithmetic short (synthetic data). Volume is in shares.

Day Close Volume Close × volume SMA(5) VWMA(5)
1 20.00 1,000 20,000
2 20.40 1,500 30,600
3 20.20 1,000 20,200
4 21.00 4,000 84,000
5 20.80 2,500 52,000 20.48 20.68
6 20.60 1,000 20,600 20.60 20.74
  1. On day 5 the products add up to 20,000 + 30,600 + 20,200 + 84,000 + 52,000 = 206,800, and the volumes to 10,000 shares. VWMA = 206,800 ÷ 10,000 = 20.68.
  2. The SMA ignores volume: (20.00 + 20.40 + 20.20 + 21.00 + 20.80) ÷ 5 = 102.40 ÷ 5 = 20.48.
  3. On day 6 the window drops day 1 and adds day 6: 206,800 − 20,000 + 20,600 = 207,400, still over 10,000 shares, so VWMA = 20.74. The SMA is 103.00 ÷ 5 = 20.60.

VWMA is 0.20 above the SMA on day 5 because day 4, at the highest close of 21.00, carried 4,000 of the 10,000 shares, or 40% of the weight, instead of the 20% each day gets in the SMA.

Reading VWMA on a chart#

Traders read VWMA against the SMA of the same length: the gap shows where the heavy trading happened. In a rally where up days trade heavily, VWMA rises above the SMA. In a pullback on light volume, the light bars barely count, so VWMA stays anchored near the prices where the heavy volume traded. In a sell-off on heavy volume, VWMA falls below the SMA faster. Figure 1 was designed with all three phases.

Synthetic daily candlestick chart over 96 days with a blue 20-day VWMA and an orange dashed 20-day SMA, a panel showing VWMA minus SMA in percent, and volume bars. In a heavy-volume rally VWMA rises 1.7 percent above SMA on day 38 (A). In a light-volume pullback VWMA is 1.4 percent below SMA on day 48 (B). In a heavy-volume sell-off VWMA falls 3.1 percent below SMA on day 72 (C).
Figure 1. Synthetic data with designed volume. Notice that the gap panel turns negative during the quiet pullback, before the sell-off begins.
  • A, day 38. During a rally from day 27 to day 46, up days traded about 2.2 million shares on average. The heavy days were the recent, higher-priced ones, so VWMA (42.99) sits 1.7% above the SMA (42.29).
  • B, day 48. Price has stopped rising and trades quietly near 48, with about 538,000 shares a day in the pullback from day 47 to day 61. The SMA keeps climbing toward those prices (45.92), but VWMA (45.29) is 1.4% below it, because 83% of the volume in its 20-day window still comes from the heavy rally days 29 to 42, when price was lower. One reading: the new highs drew little trading, so the average price at which most shares changed hands is still well below. A competing reading: quiet consolidation after a strong move is normal and not bearish by itself.
  • C, day 72. A sell-off starts on day 62 with a 4.0% drop on 4.44 million shares, and down days stay heavy. VWMA (44.19) falls 3.1% below the SMA (45.58), tracking the heavy selling more closely than the SMA does.

Neither line is a signal on its own. The gap tells you where volume concentrated in the window. It does not tell you what happens next.

When VWMA misleads#

VWMA misleads when one bar's volume is so large that it dominates the window. The line then reflects that single bar for exactly n bars and jumps when the bar drops out, even if nothing happens in the market that day. Figure 2 was designed to show this with a 20-day VWMA.

Synthetic daily candlestick chart over 71 days in a sideways range with a 20-day VWMA and a 20-day SMA. On day 31 price falls 3.0 percent to 47.94 on 7.5 million shares, 13.2 times the prior average (A). For the next 20 days VWMA stays below SMA, near 48.7, while price recovers to around 49. On day 51 the heavy day leaves the window and VWMA jumps 1.0 percent, from 48.74 to 49.21, although price fell that day (B).
Figure 2. Synthetic data, designed to show a failure. The shaded days are the 20 windows that contain the heavy day.
  • A, day 31. Price falls 3.0%, from 49.42 to 47.94, on 7,500,000 shares, 13.2 times the average of the previous 20 days. That one day holds 42% of the volume in the 20-day window. VWMA drops to 48.87 while the SMA is still 49.48.
  • The next 19 days. Price recovers to trade around 49 to 50, but the heavy day keeps pulling VWMA toward 47.94. VWMA stays below the SMA on every day from day 31 to day 50, and on day 50 it is 48.74 against an SMA of 49.19.
  • B, day 51. The heavy day leaves the window, and VWMA jumps 1.0% in one day, from 48.74 to 49.21, although the close fell from 49.12 to 48.87. A trader watching VWMA alone could read a jump that has nothing to do with that day's trading.

The same effect can appear on real charts after any unusually heavy day, such as an earnings release, an index rebalance, an options expiry or, on a crypto pair, a cascade of forced liquidations. Check the volume bars before reading a sudden move in VWMA. A large bar entering the window and the same bar leaving it are both events you can see coming.

Money flow index (MFI): RSI weighted by volume#

The money flow index (MFI) measures the balance of buying and selling pressure over the last n bars, using price and volume, on a scale from 0 to 100. Its inputs are the high, low, close and volume. For each bar it computes the typical price, (high + low + close) ÷ 3, and the raw money flow, typical price × volume. The flow counts as positive when the typical price rose from the previous bar and as negative when it fell. Over n bars, MFI = 100 − 100 ÷ (1 + positive flow ÷ negative flow), which is the same as 100 × positive flow ÷ (positive + negative flow). The default is 14 bars. Gene Quong and Avrum Soudack introduced it in "Volume-weighted RSI: money flow", Technical Analysis of Stocks & Commodities, March 1989. Common reference levels are 80 (overbought) and 20 (oversold); StockCharts reports that Quong and Soudack treated 90 and 10 as the truly extreme readings.

MFI has the same shape as the relative strength index (RSI), which the lesson What does RSI measure, and why do "overbought" signals fail? explains. The differences are in what goes into the sums. RSI uses close-to-close price changes and ignores volume. MFI uses typical price × volume, so a small rise on heavy volume can outweigh a large rise on light volume.

Calculating MFI step by step#

MFI over n bars divides the positive raw money flow by the total raw money flow and multiplies by 100. The example uses a 5-bar window to keep it short (synthetic data). The default is 14.

Bar High Low Close Volume Typical price Direction Raw money flow
1 10.30 9.90 10.10 1,000 10.10 (start)
2 10.40 10.20 10.30 1,200 10.30 up +12,360
3 10.40 10.00 10.20 800 10.20 down −8,160
4 10.70 10.20 10.60 1,500 10.50 up +15,750
5 10.60 10.30 10.30 700 10.40 down −7,280
6 10.80 10.40 10.60 1,600 10.60 up +16,960
  1. Bar 2's typical price is (10.40 + 10.20 + 10.30) ÷ 3 = 10.30, higher than bar 1's 10.10, so its flow, 10.30 × 1,200 = 12,360, is positive.
  2. Bar 3's typical price of 10.20 is lower, so 10.20 × 800 = 8,160 is negative flow.
  3. Over bars 2 to 6, positive flow = 12,360 + 15,750 + 16,960 = 45,070 and negative flow = 8,160 + 7,280 = 15,440.
  4. The money flow ratio is 45,070 ÷ 15,440 ≈ 2.92, so MFI = 100 − 100 ÷ (1 + 2.92) ≈ 74.5. The share form gives the same answer: 100 × 45,070 ÷ 60,510 ≈ 74.5.

On the same closes, a 5-bar RSI is 69.2: the gains add up to 0.20 + 0.40 + 0.30 = 0.90 and the losses to 0.10 + 0.30 = 0.40. MFI is higher because the up bars carried more volume (4,300 shares) than the down bars (1,500 shares).

This lesson follows the definition used by StockCharts and by the TA-Lib library: flows are summed over the last n bars without smoothing, and a bar whose typical price is unchanged adds no flow. RSI, by contrast, uses Wilder's smoothing, so even with the same inputs the two would not match exactly. Two edge cases differ between implementations. When there is no negative flow, MFI is 100. When there is no flow at all, TA-Lib returns 0, while some other code returns 100. TA-Lib also treats typical prices that differ only by a rounding error as unchanged.

Reading MFI on a chart#

Traders read MFI like RSI: readings above 80 show that most of the recent money flow came on rising bars, readings below 20 that most came on falling bars, and a divergence, in which price makes a new high but MFI does not, shows that the latest rise drew less volume-weighted buying. Comparing MFI with RSI on the same chart shows what volume adds. Figure 3 was designed so that the second rally runs on heavy volume on down days.

Synthetic daily candlestick chart over 81 days with the 14-day money flow index in blue and the 14-day RSI as an orange dashed line below. On day 31 price closes at 69.35 with MFI at 94.7 and RSI at 90.9 (A). On day 61 price makes a higher close of 74.51 while MFI falls to 54.4 and RSI only to 74.2 (B). Price then drops to 65.81 by day 81 (C).
Figure 3. Synthetic data, designed to show a divergence. Notice how much further the blue MFI line falls than the RSI between A and B.
  • A, day 31. After a steady rally on heavy up-day volume, price closes at 69.35. MFI reads 94.7 and RSI 90.9: both are high, and both agree.
  • B, day 61. Price makes a higher close of 74.51, 7.4% above A. RSI has eased to 74.2, about 17 points lower. MFI has fallen to 54.4, about 40 points lower, because in the second rally, from day 42 to day 59, down days traded 19.1 million shares and up days only 8.6 million. Price rose, but the volume-weighted flow did not.
  • C, day 81. Price falls to 65.81, 11.7% below B.

The data were built so that this divergence worked. A lower MFI peak is one piece of evidence that a rally is losing participation. It is not a reliable timing signal, and price can keep rising while MFI drifts lower.

When MFI misleads: "overbought" in a trend#

MFI misleads when a reading above 80 is treated as a reason to sell. In a strong trend with steady buying, MFI can stay above 80 for weeks, because most of the money flow in every 14-bar window keeps coming on rising bars. Figure 4 was designed as a strong uptrend.

Synthetic daily candlestick chart over 81 days with the 14-day money flow index below. MFI first reaches 85.9 on day 31 with the close at 22.60 (A). MFI then stays at 80 or above for 32 consecutive days, shaded, while price climbs. On day 63 MFI drops to 77.8 with the close at 29.69 (B), 31.4 percent above the day-32 open of 22.60.
Figure 4. Synthetic data, designed to show a failure. The shaded days are those with MFI at 80 or above.
  • A, day 31. MFI first reaches 80, at 85.9, with the close at 22.60. A trader who treats this as "overbought" and sells can act only after the close, so the earliest fill is the next day's open, which was also 22.60.
  • The next 32 days. MFI stays at 80 or above every day from day 31 to day 62 and reaches 100.0 on one day, while price keeps rising.
  • B, day 63. MFI finally drops below 80, to 77.8. The close is 29.69, 31.4% above the exit price of 22.60. The highest close in the data, 31.73, comes on day 76.

Selling at the first overbought reading gave up most of the trend. Shorting it would have lost money. A reading above 80 says that recent money flow has been one-sided. In a trend, that is what you would expect to see.

Volume-weighted indicators on stock and crypto charts#

VWMA and the money flow index are only as good as the volume they divide by, and the volume behind a stock chart differs from the volume behind a crypto chart. On a crypto chart, volume usually comes from one exchange and may include reported volume that does not reflect real trading, a problem the lesson Is volume confirming the move? On-balance volume and relative volume discusses. A market without reliable volume, such as an index level that is calculated rather than traded, has no VWMA or MFI at all.

The bars themselves also differ. On a 24-hour crypto market, each daily bar starts at a time the platform chooses, often 00:00 UTC, so daily MFI and VWMA values can differ between platforms that cut the day differently. Stock charts end each daily bar at the session close, but news between sessions can make the next day's typical price open far from the previous one, and MFI counts that whole day's flow as positive or negative according to the gap. Units matter less here: VWMA and MFI are ratios, so shares, coins or contracts all work, as long as the same volume field is used throughout.

Check your understanding: VWMA and MFI#

Question.

  1. Three daily closes are 30.00, 31.00 and 29.00, with volumes of 1,000, 1,000 and 8,000 shares. What are the 3-day SMA and the 3-day VWMA, and what does the gap tell you?
  2. Over the last 14 bars, positive raw money flow is 60,000 and negative raw money flow is 15,000. What is MFI? What would it be if negative flow doubled to 30,000 while positive flow stayed the same?
  3. A stock's MFI has been above 80 for ten straight days during a rally. A friend says it is overbought and must fall. What would you check before agreeing?
Show the answers

Answer.

  1. SMA = (30.00 + 31.00 + 29.00) ÷ 3 = 30.00. VWMA = (30.00 × 1,000 + 31.00 × 1,000 + 29.00 × 8,000) ÷ 10,000 = 293,000 ÷ 10,000 = 29.30. VWMA is 0.70 below the SMA because 80% of the volume traded on the day that closed at 29.00, the lowest close. The heavy trading happened at the lowest price in the window, and for the next three days that one bar will keep pulling VWMA down.
  2. The ratio is 60,000 ÷ 15,000 = 4, so MFI = 100 − 100 ÷ (1 + 4) = 80.0. With negative flow at 30,000, the ratio is 2 and MFI = 100 − 100 ÷ 3 ≈ 66.7. Doubling the volume on falling bars lowers MFI by about 13 points without any change in the rising bars.
  3. Check whether the readings above 80 come from steady buying across many bars or from one or two heavy days, look at the trend of price and volume, and compare with RSI. In a strong trend, MFI can stay above 80 for weeks, as Figure 4 showed for 32 days. A high MFI describes recent flow. It does not say when the trend ends, and a decision to sell needs an exit plan you set in advance.