The Treynor Ratio, also known as Treynor’s Measure or the Reward-to-Volatility Ratio, is a financial metric used to assess the risk-adjusted performance of an investment portfolio or asset. It measures the excess return generated by the portfolio per unit of systematic or market risk, often represented by Beta. The Treynor Ratio is a valuable tool for evaluating the performance of investments in relation to their market risk exposure.

The formula is as follows:

\[\text{Treynor Ratio} = (\text{Portfolio's Return} - \text{Risk-Free Rate}) / \text{Portfolio Beta}\]

See definition: https://en.wikipedia.org/wiki/Treynor_ratio

Also known as: reward-to-volatility ratio.

Treynor Ratio in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_treynor_ratio as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["UNP", "UPS", "FDX"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2020-01-01",
    end_date="2025-12-31",
)

toolkit.performance.get_treynor_ratio()

Or, after setting up the Finance Toolkit MCP, ask:

What was the Treynor ratio of Union Pacific, UPS and FedEx in each year from 2021 to 2025?

Which returns:

Date UNP UPS FDX
2021 0.2344 0.3677 -0.0077
2022 -0.2789 -0.2134 -0.3426
2023 0.2003 -0.0898 0.4279
2024 -0.163 -0.3386 0.1571
2025 -0.0065 -0.2648 0.008

Parameters

get_treynor_ratio accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe period to use for the calculation. Defaults to “quarterly” if the Toolkit is initialised with quarterly=True, otherwise “yearly”."quarterly"
rollingintThe rolling window size to use for the Beta component of the calculation. If set, Beta is estimated over a rolling window of this many periods across the full return history instead of per period. Defaults to None.4
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the ratios. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
Share