Money Flow Index

All functions · nseries package

MFI

func (s Series) MFI(h, l, c, v Series, period int) Series

MFI implements the Money Flow Index. A period of less than one returns a zero-filled series; mismatched input lengths return an empty series.

The output is on a 0 to 100 scale. The warm-up reads 0, not NaN: bars 0 to period-2 are exactly 0, the first valid index is period-1 and the minimum length is period. 0 is the oversold extreme, so a < 20 rule fires on every warm-up bar, and the first computed bar, period-1, sums only period-1 money flows, so the first full value is at bar period; trim (Window(-period)) or mask that many bars before a threshold rule. A flat window after the warm-up gives 50.

MoneyFlowIndex

func (s Series) MoneyFlowIndex(h, l, c, v Series, period int) Series