Hold prices fixed and change only volume
This is a synthetic calculation, not market history or a backtest. Use length 4 and five bars numbered 0 through 4. Set high, low and close equal to the listed price on each bar, so typical price equals close. Bar 0 supplies the prior price; the four changes on bars 1 through 4 form the first RSI seed and the MFI window. Volumes are hypothetical units. Cases B and C assign five times as much volume to different directions; no price or timestamp changes.
- Length 4 keeps every term visible. TradingView documents a default length of 14 for both indicators; these four-bar values are not default chart readings.
- The equality of high, low and close removes the usual difference between RSI close and MFI typical price. It is an arithmetic control, not a claim that ordinary candles have zero range.
| Bar | High = low = close | Price change | A: equal volume | B: heavier up bars | C: heavier down bars |
|---|
| 0 | 100 | Prior reference | Not in window | Not in window | Not in window |
| 1 | 102 | +2 | 100 | 500 | 100 |
| 2 | 101 | −1 | 100 | 100 | 500 |
| 3 | 103 | +2 | 100 | 500 | 100 |
| 4 | 102 | −1 | 100 | 100 | 500 |
Recalculate the same RSI and three different MFI values
RSI uses average gain G and average loss L in 100 × G / (G + L). Seed its Wilder averages with the first four changes: gains are 2, 0, 2, 0 and losses are 0, 1, 0, 1. G = 1 and L = 0.5, giving RSI = 100 / 1.5 = 66.6667. Volume never enters this calculation. Later bars update each average as ((length − 1) × previous average + current gain or loss) / length; a mature chart RSI is not just the last four changes averaged again.
- MFI uses typical price = (high + low + close) / 3 and raw flow = typical price × volume. Sum raw flow into P when typical price rises and N when it falls. An unchanged typical price contributes to neither sum.
- For case A, P = 102 × 100 + 103 × 100 = 20,500; N = 101 × 100 + 102 × 100 = 20,300. MFI = 100 × P / (P + N) = 50.2451. This is equivalent to 100 − 100 / (1 + P / N) when N is positive.
- For B, MFI = 100 × 102,500 / 122,800 = 83.4691. For C, MFI = 100 × 20,500 / 122,000 = 16.8033. Display values are rounded to two decimals; classification uses the unrounded results.
- Case D proves a scaling limit: ten times the volume on every bar cancels from the ratio. MFI responds to relative flow allocation, not absolute market activity alone. B and C also have the same total volume of 1,200 units, yet opposite MFI extremes.
| Case at bar 4 | Positive flow P | Negative flow N | MFI | RSI |
|---|
| A: equal volume | 20,500 | 20,300 | 50.25 | 66.67 |
| B: heavier up bars | 102,500 | 20,300 | 83.47 | 66.67 |
| C: heavier down bars | 20,500 | 101,500 | 16.80 | 66.67 |
| D: A with every volume × 10 | 205,000 | 203,000 | 50.25 | 66.67 |
Why RSI thresholds do not transfer to MFI
TradingView describes traditional RSI reference levels of 70 and 30, and MFI levels of 80 and 20. These are conventions, not calibrated probabilities or automatic entry rules. In the controlled sample, B exceeds MFI 80 and C falls below MFI 20, while RSI stays between 30 and 70 in every case. The same price path can therefore receive different extreme labels without any change in its closing-price momentum.
- Equal volume in A still gives MFI 50.25 versus RSI 66.67. RSI counts gain and loss magnitudes; MFI assigns each full typical-price-times-volume value by direction. MFI also uses window sums, while RSI carries Wilder-smoothed history after initialization.
- Ordinary candles introduce another difference: their typical price can move in a different direction from their close. Attributing every RSI/MFI disagreement to volume would miss that effect.
- Do not translate RSI 70 into MFI 70, or assume RSI 70 and MFI 80 identify equally rare events. Compare the frequency and timing of threshold events on the same evaluation data before choosing separate thresholds.
- A value above a reference level describes the calculation at that bar. It does not establish a reversal, an execution price or positive returns. Combining both indicators also does not provide two independent confirmations because they share price inputs.
Check missing volume, zero volume and tick volume separately
TradingView says volume availability depends on the provider, ticker and timeframe. A visible price chart is not evidence that traded-volume data exists. Add the Volume indicator and inspect the exact bars you intend to compare; if values are absent, investigate the feed before interpreting MFI. RSI can still use available prices when volume is missing.
- An unchanged typical-price window can also have P = N = 0 even when volume is positive. Treat undefined arithmetic separately from a neutral reading of 50. These are explicit handling rules for a custom comparison, not a promise about every indicator implementation.
- The bounds above assume positive prices and nonnegative volume. Synthetic spreads or invalid inputs can violate those assumptions; do not apply the usual MFI interpretation without checking them.
- Missing bars, different sessions or a different provider change the experiment. A second feed may help diagnose availability, but its readings are a new dataset rather than a controlled volume-only substitution.
| Data condition | What it means for the comparison | Check or handling |
|---|
| Missing volume / n/a | The required MFI input is unavailable. A missing value is not a zero-volume observation. | Mark the comparison unavailable. Do not silently replace missing volume with zero or one. |
| Reported zero volume | That bar contributes zero raw flow. An entire window with P + N = 0 leaves the displayed ratio undefined. | Inspect whether zeros are genuine observations or a feed limitation; suppress signals when the denominator is zero. |
| Tick volume | TradingView defines this as the number of price updates. It is not the number of shares or contracts traded. | Describe the result as weighted by price-update activity and keep the provider fixed. Do not present it as total traded money. |
| Only positive or only negative flow | For positive prices and nonnegative volume, P > 0 with N = 0 gives 100; P = 0 with N > 0 gives 0. | Use the P / (P + N) form when the denominator is positive. Both sums zero is a different case. |
Compare the indicators on a TradingView chart
Add the built-in RSI and Money Flow Index to the same standard candlestick chart. Record the exchange-qualified symbol, provider, timeframe, session and date range. Match their lengths, retain RSI close as the source for the conventional comparison, and read both on the same completed candle. Do not confuse an extra smoothing line with the underlying RSI output.
- Inspect the volume feed first. Note whether it represents trades, price updates or unavailable data, and whether that coverage changes across timeframes.
- Choose one mismatched bar and inspect close changes, typical-price direction and volume over the window. Check RSI warm-up history as well. The synthetic table isolates volume; ordinary chart disagreements can have several causes.
- A still-open bar can change price and accumulate volume. Use a specified bar-close rule when comparing recorded events; do not mix intrabar observations with completed-bar values.
- For a strategy comparison, define entry, exit, equality handling, order timing, position size, fees and slippage. Keep those fixed when switching indicators, then evaluate separately reserved data. The numerical experiment above tests calculations only.
Write the selected rules as inspectable Pine Script
The Pine Script AI Coding Agent can draft a script from explicit indicator or strategy rules. Describe the RSI source and smoothing, MFI price input, length, volume requirements and missing-data policy. Request a comparison table with both readings and separate thresholds, then ask for a syntax check and compare the generated output with hand calculations and TradingView.
- To reproduce this experiment, provide all five prices, the A/B/C volume sequences and the first-window RSI seed. A script using ordinary chart history will not reproduce that seed automatically.
- Specify whether undefined data blocks signals and whether decisions wait for bar close. A successful syntax check does not prove formula correctness, profitable trades or matching execution assumptions.
- This workflow implements rules you supply and can review. It does not recover protected indicator source, migrate a trading account or execute trades for you.