MFI

Buying against selling money flow, weighted by volume, from 0 to 100.

Money Flow Index: raw money flow = typical price (hlc3) × volume, counted positive when the typical price rose from the previous candle, negative when it fell, neither when unchanged; MFI = 100 × positive ÷ (positive + negative) over the last length changes. Ready at length + 1 candles; not ready when both sums are 0. Mirror: midpoint 50 (a mirrored price swaps positive and negative flow; volume itself is unchanged).

Settings

SettingDefaultRangeWhat it does
length141 to 500Changes in the window.

What it gives

OutputWhat it is
mfiMFI, 0–100.

What it reads

It reads the whole candle (open, high, low, close and volume).

Warm-up

With its default settings, MFI needs 15 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.

Test it

Copy this sentence into the Algonney chat to backtest it:

Backtest a strategy on BTC that uses MFI with its default settings