Risk-Return Ratio
Calculate the risk-return ratio of an investment portfolio or asset: its mean return per unit of volatility, the Sharpe ratio without the risk free rate.
The formula is as follows:
\[\text{Risk-Return Ratio} = \frac{\operatorname{Mean}(\text{Returns})}{\text{Standard Deviation}(\text{Returns})}\]Computed from the daily returns within each period (or the period returns over a rolling window), per observation; annualizing multiplies it by the square root of the observations in a year (252 daily returns, 365 for a ticker that trades on weekends, or 52, 12, 4 or 1 for rolling weekly, monthly, quarterly or yearly returns). Leaving out the risk free rate makes it comparable across currencies and rate environments, but it overstates the reward of a low-risk asset that earns little more than cash; get_sharpe_ratio subtracts the risk free rate.
The ratio under this name is defined in quantstats (Ran Aroussi) and ffn (Philippe Morissette).
Also known as: return to risk ratio, return over volatility, information ratio against cash.
Example · AAPL, MSFT, KO · 2021 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_risk_return_ratio:
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "MSFT", "KO"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.performance.get_risk_return_ratio(annualize=True)
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
What was the annualized return per unit of volatility of Apple, Microsoft and Coca-Cola in each year from 2021 to 2025?
Which returns:
| Date | AAPL | MSFT | KO |
|---|---|---|---|
| 2021 | 1.4198 | 2.2294 | 1.0697 |
| 2022 | -0.6845 | -0.7585 | 0.6130 |
| 2023 | 2.0830 | 1.9698 | -0.2722 |
| 2024 | 1.2937 | 0.7093 | 0.7286 |
| 2025 | 0.4286 | 0.7212 | 0.9210 |
5 rows
Parameters
get_risk_return_ratio accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The period to use for the calculation. Options are: “daily”, “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “quarterly” if the Toolkit is initialised with quarterly=True, otherwise “yearly”. | "weekly" |
rolling | int | The rolling window size to use for the calculation. If you select period = ‘monthly’ and set rolling to 12 you obtain the rolling 12-month ratio. At least 2. Defaults to None. | 4 |
annualize | bool | Whether to annualize the ratio, multiplying it by the square root of the observations in a year. Defaults to False. | True |
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 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Library Referenced against quantstats’ smart_sharpe (with get_autocorrelation_penalty)
- Library Shares similar logic as quantstats’ rolling_sharpe
- Library Shares similar logic as PerformanceAnalytics (R)’s SharpeRatio
- Library Shares similar logic as empyrical’s sharpe_ratio
- Library Shares similar logic as quantstats’ sharpe
- Library Shares similar logic as quantstats’ risk_return_ratio
- Library Shares similar logic as ffn’s calc_risk_return_ratio