ta.mfi()
Money Flow Index
The Money Flow Index (MFI) is a technical oscillator that uses price and volume data for identifying overbought or oversold signals in an asset. It is also known as volume-weighted RSI.
Syntax
ta.mfi(series, length) → series floatArguments
| Parameter | Type | Description |
|---|---|---|
| series | series int/float | Typical price series (commonly hlc3) for money flow. |
| length | series int | Lookback length for positive and negative money flow sums. |
Returns
Money Flow Index.
Remarks
na values in the source series are ignored.
Code Examples
//@version=6
indicator("ta.mfi")
plot(ta.mfi(hlc3, 14))
// same on pine
pine_mfi(src, length) =>
float upper = math.sum(volume * (ta.change(src) <= 0 ? 0 : src), length)
float lower = math.sum(volume * (ta.change(src) >= 0 ? 0 : src), length)
100.0 - (100.0 / (1.0 + upper / lower))
plot(pine_mfi(hlc3, 14))Trading Applications
Identify overbought (>80) and oversold (<20) conditions with volume confirmation
Detect divergences between price and money flow
Confirm breakouts with volume-weighted momentum
Use as a volume-enhanced alternative to RSI
Frequently Asked Questions
Generate ta.mfi() Code with AI
Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.mfi() and other built-in functions instantly.
Related Pine Script Functions
ta.rsi() - Relative Strength Index
Learn how to use ta.rsi() in Pine Script. Syntax, parameters, code examples for the RSI momentum oscillator.
ta.obv - On Balance Volume
Learn about ta.obv built-in variable in Pine Script. Access On Balance Volume for volume-based trend confirmation.
ta.stoch() - Stochastic Oscillator
Learn how to use ta.stoch() in Pine Script. Syntax, parameters, code examples for the Stochastic Oscillator.
ta.wpr() - Williams %R
Learn how to use ta.wpr() in Pine Script. Syntax, parameters, code examples for the Williams Percent R oscillator.
ta.accdist - Accumulation/Distribution
Learn about ta.accdist built-in variable in Pine Script. Access the Accumulation/Distribution Index for money flow analysis.