def money_flow_index(close_data, high_data, low_data, volume, period):
catch_errors.check_for_input_len_diff(<EOL>close_data, high_data, low_data, volume<EOL>)<EOL>catch_errors.check_for_period_error(close_data, period)<EOL>mf = money_flow(close_data, high_data, low_data, volume)<EOL>tp = typical_price(close_data, high_data, low_data)<EOL>flow = [tp[idx] > tp[idx-<NUM_LIT:1>] for idx in range(<NUM_LIT:1>, len(tp))]<EOL>pf = [mf[idx] if flow[idx] else <NUM_LIT:0> for idx in range(<NUM_LIT:0>, len(flow))]<EOL>nf = [mf[idx] if not flow[idx] else <NUM_LIT:0> for idx in range(<NUM_LIT:0>, len(flow))]<EOL>pmf = [sum(pf[idx+<NUM_LIT:1>-period:idx+<NUM_LIT:1>]) for idx in range(period-<NUM_LIT:1>, len(pf))]<EOL>nmf = [sum(nf[idx+<NUM_LIT:1>-period:idx+<NUM_LIT:1>]) for idx in range(period-<NUM_LIT:1>, len(nf))]<EOL>with warnings.catch_warnings():<EOL><INDENT>warnings.simplefilter("<STR_LIT:ignore>", category=RuntimeWarning)<EOL>money_ratio = np.array(pmf) / np.array(nmf)<EOL><DEDENT>mfi = <NUM_LIT:100> - (<NUM_LIT:100> / (<NUM_LIT:1> + money_ratio))<EOL>mfi = fill_for_noncomputable_vals(close_data, mfi)<EOL>return mfi<EOL>
Money Flow Index.

Formula:
MFI = 100 - (100 / (1 + PMF / NMF))