Money Flow Index (MFI)
Money Flow Index: a volume-weighted oscillator from 0 to 100 that compares the money flow of rising and falling candles, with automatic divergence lines.
What you see
A line in its own pane on a fixed scale from 0 to 100, without reference lines. Green and red lines mark bullish and bearish divergences.
How it is calculated
With N = Period:
- Typical price
TP = (high + low + close) / 3; money flow of a candle =TP × volume. - Over the last N candles, the money flow of candles whose TP is above the previous candle's TP adds to the positive flow, the money flow of candles with a lower TP to the negative flow. Candles with an unchanged TP are ignored.
money ratio = positive flow / negative flow. Without negative flow it divides by 1, so the MFI ends up close to 100.MFI = 100 − 100 / (1 + money ratio)
The first value appears on candle N + 1. Divergences use Period as the swing window and the same rules as the RSI.
How to read it
- Above 80 is commonly read as overbought, below 20 as oversold. These levels are not drawn.
- Because volume is included, a move on high volume shifts the MFI more than the RSI, and a move on thin volume less.
- A new price high without a new MFI high suggests that buying volume is drying up; the opposite applies to lows.
Using it in strategies
Output: value (0 to 100). In the Trade Setup it works like the RSI with "Range", "Against" and "Compare". In WickScript use the built-in mfi(length), e.g. mfi(14) < 20, or use indicator "MFI" with period 14 as m and read m.value.
Settings
Open the settings with the slider icon next to the indicator (Indicators, F3). Numeric settings can be swept as Step 1 / Step 2 parameters when you run a strategy.
Inputs
| Setting | Type | Default | Description |
|---|---|---|---|
| Period | Number | 14 | Number of candles (N) whose money flow is summed. Also the swing window for divergence detection. (min 1) |
| Look Back Range | Number | 2 | Candles after a swing point that are checked before the swing counts for a divergence. Higher values give fewer, later divergences. (min 1) |
| Height | Number | 70 | Height of the pane in pixels. (min 30) |
Styles
| Setting | Type | Default | Description |
|---|---|---|---|
| Line Color | Color | #44ff44 |
Outputs
These values can be used in Trade Setup triggers, filters and exits (see Trade Setup) and in WickScript.
| Output | In WickScript | Description |
|---|---|---|
| value | value |
Use in WickScript
use indicator creates this indicator inside a script, with settings by their ID. Each output is a field of the name after as. See WickScript indicators.
wickscript 1
indicator "Money Flow Index (MFI) from the list" in pane
use indicator "MFI" with period 14 as myMfi
show myMfi.value as line "value"