Array of candlestick data to analyze
Period for MFI calculation (default: 14)
Number of decimal places for rounding (default: 2)
Use O(N) rolling window optimization vs O(N*period) (default: true)
Array of MFI values (same length as input, with null for insufficient data)
import * as ta from 'chart-patterns';
const mfiValues = ta.MFI.calculateMFI(candles, 14);
console.log('Latest MFI:', mfiValues[mfiValues.length - 1]);
// Check for overbought/oversold conditions
const latestMFI = mfiValues[mfiValues.length - 1];
if (latestMFI && latestMFI > 80) {
console.log('Overbought condition detected');
} else if (latestMFI && latestMFI < 20) {
console.log('Oversold condition detected');
}
Generated using TypeDoc
Calculate Money Flow Index (MFI) for a series of candles.
The Money Flow Index is a momentum oscillator that uses both price and volume to measure buying and selling pressure. It's often called the "Volume RSI" because it incorporates volume into the RSI formula.
The MFI oscillates between 0 and 100: