Returns the money flow index: a volume-weighted relative strength reading from 0 to 100 over length bars.
ta.mfi multiplies each bar's volume by series when series rose, and separately when it fell. It sums both over length bars and returns 100 - 100 / (1 + upSum / downSum).
Feed it hlc3 for the usual typical-price version. The first reading comes on bar number length.
Syntax
ta.mfi(series: series int/float, length: series int) -> series floatArguments
| Name | Type | Default | Description |
|---|---|---|---|
| series | series int/ | required | Price series whose direction decides the side of each bar's volume, usually hlc3. |
| length | series int | required | Number of bars in the sums. A whole number of 1 or more. |
Returns
series float: a value from 0 to 100, or na while the window is not full.
Remarks
- The result is na on symbols that report no volume.
- Readings above 80 and below 20 are the usual extremes.
Example
//@version=6
indicator("MFI")
value = ta.mfi(hlc3, 14)
plot(value, "MFI", color = color.purple)
hline(80, color = color.red)
hline(20, color = color.green)See also
Runs on Sidechair