M2 Ratio
The M2 Ratio, also known as the Modigliani-Modigliani Measure, is a financial metric used to evaluate the risk-adjusted performance of an investment portfolio or strategy. It assesses the excess return generated by the portfolio relative to a risk-free investment, taking into account the portfolio’s volatility or risk. The M2 Ratio helps investors and portfolio managers determine whether the portfolio is delivering returns that justify its level of risk.
The formula is as follows:
\[M_{2} \;\text{Ratio} = \text{Risk-Free Rate} + \left[(\text{Portfolio's Return} - \text{Risk-Free Rate}) / \text{Portfolio Standard Deviation}\right] \cdot \text{Benchmark Standard Deviation}\]This rescales the (dimensionless) Sharpe ratio back into return-space by asking what return the portfolio would have earned had it been leveraged or de-leveraged, via risk-free borrowing or lending, to match the benchmark’s volatility exactly – producing a number directly comparable to the benchmark’s actual return. Requires a benchmark_ticker to be set on the Toolkit instance, since the benchmark’s standard deviation is part of the formula.
See definition: https://en.wikipedia.org/wiki/Modigliani_risk-adjusted_performance
Also known as: Modigliani-Modigliani measure, M2, risk-adjusted performance.
M2 Ratio in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_m2_ratio as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["HD", "LOW"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2020-01-01",
end_date="2025-12-31",
)
toolkit.performance.get_m2_ratio()
Or, after setting up the Finance Toolkit MCP, ask:
What was the M2 measure, the return at the S&P 500's volatility, of Home Depot and Lowe's in each year from 2021 to 2025?
Which returns:
| Date | HD | LOW |
|---|---|---|
| 2021 | 0.39 | 0.3481 |
| 2022 | -0.1634 | -0.1482 |
| 2023 | 0.0932 | 0.0955 |
| 2024 | 0.1083 | 0.0921 |
| 2025 | -0.0718 | 0.0055 |
Parameters
get_m2_ratio accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The period to use for the calculation. Defaults to “quarterly” if the Toolkit is initialised with quarterly=True, otherwise “yearly”. | "quarterly" |
rolling | int | The rolling window size to use for the calculation. If set, the M2 ratio is calculated over a rolling window of this many periods across the full return history instead of per period. Defaults to None. | 4 |
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 ratios. 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 |