Money Flow Index
Calculate the Money Flow Index (MFI) for a given price series.
The Money Flow Index is a momentum indicator that measures the strength and direction of money flowing in and out of a security by considering both price and volume.
The formula is as follows:
\[\text{MFI} = 100 - (100 / (1 + (\text{positive\_money\_flow} / \text{negative\_money\_flow})))\]Also known as: MFI, volume-weighted RSI.
Money Flow Index in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_money_flow_index as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
tickers=["^IXIC"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.technicals.get_money_flow_index().tail(5)
Or, after setting up the Finance Toolkit MCP, ask:
How did the Money Flow Index of the Nasdaq Composite move from 24 to 31 December 2025?
Which returns:
| Date | ^IXIC | Benchmark |
|---|---|---|
| 2025-12-24 | 49.2154 | 53.8187 |
| 2025-12-26 | 47.7867 | 52.3146 |
| 2025-12-29 | 48.6922 | 51.9588 |
| 2025-12-30 | 48.8975 | 52.4467 |
| 2025-12-31 | 42.2704 | 45.3999 |
Parameters
get_money_flow_index accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The time period to consider for historical data. Can be “intraday”, “daily”, “weekly”, “monthly”, “quarterly” or “yearly”. Defaults to “daily”. | "weekly" |
close_column | str | The name of the column containing the close prices. Defaults to “Adj Close”, in which case the open, high and low prices are adjusted for dividends in the same way. | "Close" |
window | int | The number of periods for calculating the MFI. Defaults to 14. | 20 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the indicator values. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |