mfi
Money Flow Index (Volume-weighted momentum oscillator)
mfi(period)
Parameters
| Name | Type | Description |
|---|---|---|
period |
int | Number of periods for money flow calculation |
Formula
MFI = 100 - (100 / (1 + positive_money_flow_sum / negative_money_flow_sum))
Examples
mfi(14); # Standard 14-period MFI
mfi(10); # More sensitive 10-period MFI
mfi(14) > 80; # Overbought with volume confirmation
mfi(14) < 20; # Oversold with volume confirmation
Returns
float
Range
period must be 2-400
Notes
positive_money_flow_sum/negative_money_flow_sum are windowed SUMs over a CASE that always resolves to a non-negative number, never NULL; the CASE returns 100 when the negative sum is 0 and 0 when the positive sum is 0, so MFI itself never resolves to NULL
References
TradingView: ta.mfi(); developed by Gene Quong and Avrum Soudack