# 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.

Updated: 2026-10-25T00:01:52.000Z · https://chartrider.com/docs/indicators/money-flow-index/

## 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:
1. Typical price `TP = (high + low + close) / 3`; money flow of a candle = `TP × volume`.
2. 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.
3. `money ratio = positive flow / negative flow`. Without negative flow it divides by 1, so the MFI ends up close to 100.
4. `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](https://chartrider.com/docs/indicators/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](https://chartrider.com/docs/strategies/trade-setup/) it works like the RSI with "Range", "Against" and "Compare". In [WickScript](https://chartrider.com/docs/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](https://chartrider.com/docs/strategies/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](https://chartrider.com/docs/wickscript/indicators/).

```wickscript
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"
```
