{"id":184215,"date":"2023-01-24T17:25:00","date_gmt":"2023-01-24T22:25:00","guid":{"rendered":"https:\/\/ibkrcampus.com\/traders-insight\/volatility-and-measures-of-risk-adjusted-return-with-python\/"},"modified":"2023-02-13T16:10:04","modified_gmt":"2023-02-13T21:10:04","slug":"volatility-and-measures-of-risk-adjusted-return-with-python","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/","title":{"rendered":"Volatility And Measures Of Risk-Adjusted Return With Python"},"content":{"rendered":"\n<p>Volatility is an important factor to consider for traders since volatility can greatly impact the returns of an investment. A volatile stock or the market can be taken care of with the help of measures to adjust the risk.<\/p>\n\n\n\n<p>In this post, we will see how to compute historical volatility in Python and the different measures of risk-adjusted return based on it.<\/p>\n\n\n\n<p>This blog covers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>What is meant by volatility?<\/li>\n\n\n\n<li>Historical volatility<\/li>\n\n\n\n<li>What is a risk-adjusted return in trading?<\/li>\n\n\n\n<li>Purpose of risk-adjustment<\/li>\n\n\n\n<li>Risk-adjusted return ratios in python<\/li>\n\n\n\n<li>Pros of using the risk-adjusted return ratios<\/li>\n\n\n\n<li>Cons of using the risk-adjusted return ratios<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-meant-by-volatility\">What is meant by volatility?<\/h2>\n\n\n\n<p>The upward and downward movement of a security over a period is called volatility. Volatility is one of the factors that define the risk of security. In general, the higher the volatility, the riskier the security. If the price of a security fluctuates slowly over a longer span of time, it is considered to be less volatile.<\/p>\n\n\n\n<p>Conversely, If the price of a security fluctuates rapidly over a small span of time, it is considered to be more volatile. Volatility is measured best by calculating the standard deviation of the annualised returns over a period of time.<\/p>\n\n\n\n<p>Volatility measures the dispersion of returns for given security. It plays a key role in&nbsp;<a href=\"https:\/\/quantra.quantinsti.com\/course\/options-trading-strategies-python-basic\" target=\"_blank\" rel=\"noreferrer noopener\">options trading<\/a>.<\/p>\n\n\n\n<p>The main two volatilities are-<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Implied volatility and<\/li>\n\n\n\n<li>Historical volatility.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"implied-volatility\">Implied volatility<\/h3>\n\n\n\n<p>Let us first talk about implied volatility. Implied volatility is the expected future volatility of the stock. Implied volatility shows the stock\u2019s potential movement, but it doesn\u2019t forecast the direction of the move. If the implied volatility is high, then it means that the market has priced in the potential for large price movements in either direction for the stock.<\/p>\n\n\n\n<p>If the implied volatility is low, the price won\u2019t move as much or may not make any unpredictable changes.<\/p>\n\n\n\n<p>Implied volatility is one of the important deciding factors in the pricing of&nbsp;<a href=\"https:\/\/quantra.quantinsti.com\/glossary\/Option\" target=\"_blank\" rel=\"noreferrer noopener\">options<\/a>. As implied volatility increases, the value of options will increase. That is because an increase in implied volatility suggests an increased range of potential movement for the stock.<\/p>\n\n\n\n<p>The implied volatility is derived from the&nbsp;<a href=\"https:\/\/quantra.quantinsti.com\/glossary\/BlackScholes\" target=\"_blank\" rel=\"noreferrer noopener\">Black-Scholes<\/a>&nbsp;formula by entering all the parameters needed to solve for the options price through the Black-Scholes Model and then taking the actual market price of the option and solving back for the implied volatility parameter.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"historical-volatility\">Historical volatility<\/h3>\n\n\n\n<p>We will discuss historical volatility here since historical data can best determine a strategy\u2019s performance based on past data.<\/p>\n\n\n\n<p>Historical volatility is derived from time series of past price data, whereas implied volatility is derived using the market price of a traded derivative instrument like an options contract.<\/p>\n\n\n\n<p>Let us see an example by computing the historical volatility of risk-adjusted return for NIFTY.<\/p>\n\n\n\n<p>First, we use the log function from NumPy to compute the logarithmic returns using the NIFTY closing price. Then we use the rolling_std function from Pandas plus the NumPy square root function to calculate the annualised volatility.<\/p>\n\n\n\n<p>The rolling function uses a window of 252 trading days. Each day in the selected lookback period is assigned an equal weight. The user can choose a longer or a shorter period as per his need.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>## Computing Volatility\n# Load the required modules and packages\nimport numpy as np\nimport pandas as pd\nimport yfinance as yf\n\n# Pull NIFTY data from Yahoo finance\nNIFTY = yf.download('^NSEI',start='2018-6-1', end='2022-6-1')\n\n# Compute the logarithmic returns using the Closing price\nNIFTY&#91;'Log_Ret'] = np.log(NIFTY&#91;'Close'] \/ NIFTY&#91;'Close'].shift(1))\n\n# Compute Volatility using the pandas rolling standard deviation function\nNIFTY&#91;'Volatility'] = NIFTY&#91;'Log_Ret'].rolling(window=252).std() * np.sqrt(252)\nprint(NIFTY.tail(15))\n\n# Plot the NIFTY Price series and the Volatility\nNIFTY&#91;&#91;'Close', 'Volatility']].plot(subplots=True, color='blue',figsize=(8, 6))<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/7ee8b5b2a71a42e37f4d9b9173b5f7e9#file-historical_volatility-py\" target=\"_blank\" rel=\"noreferrer noopener\">Historical_Volatility.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a><\/code><\/pre>\n\n\n\n<p>Output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/Historical-volatility-1-quantinsti.png\" alt=\" class=\" class=\"wp-image-174164 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">Source: NIFTY data from Yahoo finance<\/p>\n\n\n\n<p>The output above shows that the volatility was the highest between 2020-07 and 2021-06.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-risk-adjusted-return-in-trading\">What is a risk-adjusted return in trading?<\/h2>\n\n\n\n<p>Risk-adjusted return is a calculation of the return (or potential return) on the trading of a financial instrument such as a stock. Risk-adjusted returns are often represented as a ratio.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"purpose-of-risk-adjustment\">Purpose of risk-adjustment<\/h2>\n\n\n\n<p>Risk-adjusted return is a critical element to successful long-term investing and the one often overlooked and usually misunderstood by traders new in the field. Risk-adjusted returns are perhaps the most important yet least understood part of investing.<\/p>\n\n\n\n<p>It is always better to weigh the return potential of any investment against the risks it takes so that the risk-return ratio is well understood before making the investment decision.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"risk-adjusted-return-ratios-in-python\">Risk-adjusted return ratios in python<\/h2>\n\n\n\n<p>Let us now find out the various measures along with the formula of each for risk-adjusted return in Python. The following are the measures:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Sharpe ratio<\/li>\n\n\n\n<li>Information ratio<\/li>\n\n\n\n<li>Modigliani ratio (M2 ratio)<\/li>\n\n\n\n<li>Treynor Ratio<\/li>\n\n\n\n<li>Jensen\u2019s Alpha<\/li>\n\n\n\n<li>R-squared<\/li>\n\n\n\n<li>Sortino Ratio<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"-sharpe-ratio\">\u200b\u200bSharpe ratio<\/h3>\n\n\n\n<p>The&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/sharpe-ratio-applications-algorithmic-trading\/\">Sharpe ratio<\/a>&nbsp;introduced in 1966 by Nobel laureate William F. Sharpe is a measure for calculating risk-adjusted return. The Sharpe ratio is the average return earned in excess of the risk-free rate per unit of volatility.<\/p>\n\n\n\n<p>Here is the formula for Sharpe ratio:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/Sharpee-ratio-historical-volatility-1100x173.png\" alt=\" class=\" class=\"wp-image-174167 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1100px; aspect-ratio: 1100\/173;\" \/><\/figure>\n\n\n\n<p>Following is the code to compute the Sharpe ratio in python.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Sharpe Ratio function\ndef sharpe(returns, daily_risk_free_rate, days=252):\nvolatility = returns.std()\nsharpe_ratio = (returns.mean() - daily_risk_free_rate) \/ volatility * np.sqrt(days)\nreturn sharpe_ratio<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/46b5d5869dc74cc05fc27670af04a0ad#file-sharpe_ratio-py\" target=\"_blank\" rel=\"noreferrer noopener\">Sharpe_Ratio.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"information-ratio-ir-\">Information ratio (IR)<\/h3>\n\n\n\n<p>The information ratio is an extension of the Sharpe ratio which adds the returns of a benchmark portfolio to the inputs. It measures a trader\u2019s ability to generate excess returns relative to a benchmark.<\/p>\n\n\n\n<p>Formula for Information ratio is as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/formation-ratio-historical-volatility-1100x105.png\" alt=\" class=\" class=\"wp-image-174171 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1100px; aspect-ratio: 1100\/105;\" \/><\/figure>\n\n\n\n<p>The &#8220;tracking error&#8221; mentioned above in the formula is the standard deviation of the excess return with respect to the benchmark rate of return.<\/p>\n\n\n\n<p>Following is the code to compute the Information ratio in python.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Information Ratio\nimport numpy as np\ndef information_ratio(returns, benchmark_returns, days=252):\nreturn_difference = returns - benchmark_returns\nvolatility = return_difference.std()\ninformation_ratio = return_difference.mean() \/ volatility * np.sqrt(days)\nreturn information_ratio<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/818b8071102e980a68c02147bbe05b98#file-information_ratio-py\" target=\"_blank\" rel=\"noreferrer noopener\">Information_Ratio.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"modigliani-ratio-m2-ratio-\">Modigliani ratio (M2 ratio)<\/h3>\n\n\n\n<p>The Modigliani ratio measures the returns of the portfolio, adjusted for the risk of the portfolio relative to that of some benchmark.<\/p>\n\n\n\n<p>To calculate the M2 ratio, we first calculate the Sharpe ratio and then multiply it by the annualised standard deviation of a chosen benchmark. We then add the risk-free rate to the derived value to give an M2 ratio.<\/p>\n\n\n\n<p>The Modigliani ratio goes as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/modigliani-ratio-quantinsti-1100x107.png\" alt=\" class=\" class=\"wp-image-174174 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1100px; aspect-ratio: 1100\/107;\" \/><\/figure>\n\n\n\n<p>Following is the code to compute the Modigliani ratio in python.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Modigliani Ratio\nimport numpy as np\ndef modigliani_ratio(returns, benchmark_returns, rf, days=252):\nvolatility = returns.std()\nsharpe_ratio = (returns.mean() - rf) \/ volatility * np.sqrt(days)\nbenchmark_volatility = benchmark_returns.std() * np.sqrt(days)\nm2_ratio = (sharpe_ratio * benchmark_volatility) + rf\nreturn m2_ratio<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/d4dff8c84716c05c2b2ff1d290211bd4#file-modigliani_ratio-py\" target=\"_blank\" rel=\"noreferrer noopener\">Modigliani_Ratio.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"treynor-ratio\">Treynor ratio<\/h3>\n\n\n\n<p>The Treynor ratio was developed by Jack Treynor, an American economist who was one of the inventors of the Capital Asset Pricing Model (CAPM).<\/p>\n\n\n\n<p>The Treynor ratio is a risk\/return measure that allows traders to adjust a portfolio&#8217;s returns for systematic risk. A higher Treynor ratio result means a portfolio with the probability of higher returns.<\/p>\n\n\n\n<p>The formula for the Treynor Ratio is:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/traynor-ratio-quantinsti-1100x135.png\" alt=\" class=\" class=\"wp-image-174179 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1100px; aspect-ratio: 1100\/135;\" \/><\/figure>\n\n\n\n<p>Following is the python code for the Treynor ratio.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import numpy as np\nimport pandas as pd\n\ndef cumulative_returns(df):\nreturn (df&#91;-1]\/df&#91;0])-1\n\ndef Treynor_Ratio(pv,ticker_name,start,end,shares,cash,rf=0):\ntickers = &#91;ticker_name]\nticker_name_adj_close = get_adjusted_close(tickers,start,end)\nticker_name_pv = Portfolio_Value(comp_adj_close,shares,cash)\nticker_name_returns = daily_returns(comp_pv)\nport_returns = daily_returns(pv)\ncovariance = np.cov(port_returns,ticker_name_returns)&#91;0]&#91;1]\nvariance = np.var(ticker_name_returns)\nbeta = covariance\/variance\nTreynor_Ratio = (cumulative_returns(pv) - rf)\/beta<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/bd60fd80297fdb20d64feb24bd7301ae#file-treynor_ratio-py\" target=\"_blank\" rel=\"noreferrer noopener\">Treynor_ratio.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"jensen-s-alpha\">Jensen\u2019s alpha<\/h3>\n\n\n\n<p>The Jensen&#8217;s alpha, is a risk-adjusted performance measure that represents the average return on a portfolio or investment, above or below that predicted by the capital asset pricing model (CAPM).<\/p>\n\n\n\n<p>Given are the portfolio&#8217;s or investment&#8217;s beta and the average market return.<\/p>\n\n\n\n<p>The formula for Jensen&#8217;s alpha is:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/alpha-ratio-quantinsti.png\" alt=\" class=\" class=\"wp-image-174184 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/figure>\n\n\n\n<p>where,<\/p>\n\n\n\n<p>R(i) = the realized return of the portfolio or investment<\/p>\n\n\n\n<p>R(m) = the realized return of the appropriate market index<\/p>\n\n\n\n<p>R(f) = Risk free rate<\/p>\n\n\n\n<p>B = the beta of the portfolio of investment with respect to the chosen market index<\/p>\n\n\n\n<p>In python, we will calculate Jensen\u2019s alpha as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import numpy as np\nimport pandas as pd\nimport statsmodels.regression.linear_model as lm\nimport statsmodels.tools.tools as ct\n\n# Jensen\u2019s alpha\u2019s performance metric data\nreturns = pd.read_csv(\u2018Data_file_link\u2019, index_col=\u2019Date\u2019, parse_dates=True)\n\n# Jensen\u2019s alpha\u2019s performance metric calculation\nreturns.loc&#91;:CT\u2019] = ct.add_constant(returns)\n\n# Using risk free rate of ticker and risk free rate of market for calculating Jensen\u2019s alpha\nalphaj = lm.OLS(returns&#91;\u2018TICKER-RF\u2019], returns&#91;&#91;\u2018CT\u2019,  \u2018MKT-RF\u2019]], hasconst=bool).fit()\nprint (\u2018Jensen Alpha Linear Regression Summary\u2019)\nprint(alphaj.summary())<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/695b42d11e7e570bc7db6f9ef7e55dca#file-jensen_alpha-py\" target=\"_blank\" rel=\"noreferrer noopener\">Jensen_alpha.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"r-squared\">R-squared<\/h3>\n\n\n\n<p>The R squared is the proportion of the variation in the dependent variable that is predictable from the independent variable(s).<\/p>\n\n\n\n<p>It is a statistical ratio whose main purpose is either the prediction of future outcomes or the testing of hypotheses, on the basis of the related information. It provides a measure of how well-observed outcomes are replicated by the model, based on the proportion of total variation of outcomes explained by the model.<\/p>\n\n\n\n<p>The formula for R-squared is as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/r-squared-ratio-quantinsti-1100x145.png\" alt=\" class=\" class=\"wp-image-174188 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1100px; aspect-ratio: 1100\/145;\" \/><\/figure>\n\n\n\n<p>Let us see how R-squared can be calculated using Python and here is the code for the same:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from sklearn.linear_model import LinearRegression\n\n# initiate linear regression model\nmodel = LinearRegression()\n\n# define predictor and response variables\nX, y = df&#91;&#91;\"variable_1\", \"variable_2\"]], df.result\n\n# fit regression model\nmodel.fit(X, y)\n\n# calculate R-squared of regression model\nr_squared = model.result(X, y)\n\n# view R-squared value\nprint(r_squared)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/5ea9179985760bec619763dd6992fe5c#file-r_squared-py\" target=\"_blank\" rel=\"noreferrer noopener\">R_squared.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sortino-ratio\">Sortino ratio<\/h3>\n\n\n\n<p>The Sortino ratio is similar to&nbsp;<a href=\"https:\/\/quantra.quantinsti.com\/glossary\/Sharpe-Ratio\" target=\"_blank\" rel=\"noreferrer noopener\">Sharpe ratio<\/a>, except the Sharpe ratio involves both upward and downward volatility while the Sortino ratio represents only downward volatility.<\/p>\n\n\n\n<p>Just like the Sharpe ratio, the higher the Sortino ratio, the better the return for unit risk.<\/p>\n\n\n\n<p>Since most investors are only concerned about the downward volatility, the Sortino ratio represents a more realistic picture of the downward risk.<\/p>\n\n\n\n<p>The choice of using the Sortino or Sharpe ratio for evaluating an investment is solely based on the individual, whether he\/she wants to analyze the total volatility or the downside volatility. Both are commonly used for different applications.<\/p>\n\n\n\n<p>Sortino ratio is given by the equation:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/sortino-ratio-quantinsti-1100x121.png\" alt=\" class=\" class=\"wp-image-174194 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1100px; aspect-ratio: 1100\/121;\" \/><\/figure>\n\n\n\n<p>Let us now see how to calculate the Sortino ratio in python. Here is the python code for the same:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Sortino Ratio function\n\ndef sortino(returns, daily_risk_free_rate, days=252):\nvolatility = returns.std()\nsortino_ratio = (expected_returns - daily_risk_free_rate) \/ volatility * np.sqrt(days)\nreturn sortino_ratio<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/52b286e5d365c18745e70f0d3689572a#file-sortino_ratio-py\" target=\"_blank\" rel=\"noreferrer noopener\">Sortino_Ratio.py&nbsp;<\/a>hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a><\/code><\/pre>\n\n\n\n<p>Thus, this is how we compute historical volatility in python, and we also went through the different measures of risk-adjusted return based on it.<\/p>\n\n\n\n<p>You can learn to&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/portfolio-optimization-maximum-return-risk-ratio-python\/\">optimise your portfolio<\/a>&nbsp;in Python using&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/monte-carlo-simulation\/\">Monte Carlo Simulation<\/a>.<\/p>\n\n\n\n<p><em>Visit QuantInsti to read Pros and Cons of using the risk-adjusted return ratios: <a href=\"https:\/\/blog.quantinsti.com\/volatility-and-measures-of-risk-adjusted-return-based-on-volatility\/\" rel=\"sponsored nofollow\">https:\/\/blog.quantinsti.com\/volatility-and-measures-of-risk-adjusted-return-based-on-volatility\/<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we will see how to compute historical volatility in Python and the different measures of risk-adjusted return based on it.<\/p>\n","protected":false},"author":368,"featured_media":182100,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338,341,352,9563,344],"tags":[865,12031,7150,14494,14495,14496,595,14497,14498,5545,11996,14499],"contributors-categories":[13654],"class_list":{"0":"post-184215","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-python-development","10":"category-ibkr-quant-news","11":"category-quant-development","12":"category-quant-north-america","13":"category-options-quant","14":"category-quant-regions","15":"tag-github","16":"tag-historical-volatility","17":"tag-implied-volatility","18":"tag-information-ratio","19":"tag-jensens-alpha","20":"tag-modigliani-ratio-m2-ratio","21":"tag-python","22":"tag-r-squared","23":"tag-risk-adjusted-return","24":"tag-sharpe-ratio","25":"tag-sortino-ratio","26":"tag-treynor-ratio","27":"contributors-categories-quantinsti"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Volatility And Measures Of Risk-Adjusted Return With Python<\/title>\n<meta name=\"description\" content=\"In this post, we will see how to compute historical volatility in Python and the different measures of risk-adjusted return based on it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/184215\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Volatility And Measures Of Risk-Adjusted Return With Python\" \/>\n<meta property=\"og:description\" content=\"In this post, we will see how to compute historical volatility in Python and the different measures of risk-adjusted return based on it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-24T22:25:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-13T21:10:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/quant-globe-orange-purple.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Chainika Thakar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Volatility And Measures Of Risk-Adjusted Return With Python\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chainika Thakar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/volatility-and-measures-of-risk-adjusted-return-with-python\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/volatility-and-measures-of-risk-adjusted-return-with-python\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Chainika Thakar\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/c97b4c6a477fa019494f67cff50fcb10\"\n\t            },\n\t            \"headline\": \"Volatility And Measures Of Risk-Adjusted Return With Python\",\n\t            \"datePublished\": \"2023-01-24T22:25:00+00:00\",\n\t            \"dateModified\": \"2023-02-13T21:10:04+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/volatility-and-measures-of-risk-adjusted-return-with-python\\\/\"\n\t            },\n\t            \"wordCount\": 1417,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/volatility-and-measures-of-risk-adjusted-return-with-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/quant-globe-orange-purple.jpg\",\n\t            \"keywords\": [\n\t                \"GitHub\",\n\t                \"historical volatility\",\n\t                \"implied volatility\",\n\t                \"Information ratio\",\n\t                \"Jensen's Alpha\",\n\t                \"Modigliani ratio (M2 ratio)\",\n\t                \"Python\",\n\t                \"R-squared\",\n\t                \"Risk-Adjusted Return\",\n\t                \"Sharpe Ratio\",\n\t                \"Sortino ratio\",\n\t                \"Treynor Ratio\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Development\",\n\t                \"Quant North America\",\n\t                \"Quant Options\",\n\t                \"Quant Regions\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/volatility-and-measures-of-risk-adjusted-return-with-python\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/volatility-and-measures-of-risk-adjusted-return-with-python\\\/\",\n\t            \"name\": \"Volatility And Measures Of Risk-Adjusted Return With Python\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/volatility-and-measures-of-risk-adjusted-return-with-python\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/volatility-and-measures-of-risk-adjusted-return-with-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/quant-globe-orange-purple.jpg\",\n\t            \"datePublished\": \"2023-01-24T22:25:00+00:00\",\n\t            \"dateModified\": \"2023-02-13T21:10:04+00:00\",\n\t            \"description\": \"In this post, we will see how to compute historical volatility in Python and the different measures of risk-adjusted return based on it.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/volatility-and-measures-of-risk-adjusted-return-with-python\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/volatility-and-measures-of-risk-adjusted-return-with-python\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/quant-globe-orange-purple.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/quant-globe-orange-purple.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Using Python Lambda Function in Trading - Part II\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/c97b4c6a477fa019494f67cff50fcb10\",\n\t            \"name\": \"Chainika Thakar\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/chainikathakar\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Volatility And Measures Of Risk-Adjusted Return With Python","description":"In this post, we will see how to compute historical volatility in Python and the different measures of risk-adjusted return based on it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/184215\/","og_locale":"en_US","og_type":"article","og_title":"Volatility And Measures Of Risk-Adjusted Return With Python","og_description":"In this post, we will see how to compute historical volatility in Python and the different measures of risk-adjusted return based on it.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/","og_site_name":"IBKR Campus US","article_published_time":"2023-01-24T22:25:00+00:00","article_modified_time":"2023-02-13T21:10:04+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/quant-globe-orange-purple.jpg","type":"image\/jpeg"}],"author":"Chainika Thakar","twitter_card":"summary_large_image","twitter_title":"Volatility And Measures Of Risk-Adjusted Return With Python","twitter_misc":{"Written by":"Chainika Thakar","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/"},"author":{"name":"Chainika Thakar","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/c97b4c6a477fa019494f67cff50fcb10"},"headline":"Volatility And Measures Of Risk-Adjusted Return With Python","datePublished":"2023-01-24T22:25:00+00:00","dateModified":"2023-02-13T21:10:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/"},"wordCount":1417,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/quant-globe-orange-purple.jpg","keywords":["GitHub","historical volatility","implied volatility","Information ratio","Jensen's Alpha","Modigliani ratio (M2 ratio)","Python","R-squared","Risk-Adjusted Return","Sharpe Ratio","Sortino ratio","Treynor Ratio"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Development","Quant North America","Quant Options","Quant Regions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/","name":"Volatility And Measures Of Risk-Adjusted Return With Python","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/quant-globe-orange-purple.jpg","datePublished":"2023-01-24T22:25:00+00:00","dateModified":"2023-02-13T21:10:04+00:00","description":"In this post, we will see how to compute historical volatility in Python and the different measures of risk-adjusted return based on it.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/volatility-and-measures-of-risk-adjusted-return-with-python\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/quant-globe-orange-purple.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/quant-globe-orange-purple.jpg","width":1000,"height":563,"caption":"Using Python Lambda Function in Trading - Part II"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/c97b4c6a477fa019494f67cff50fcb10","name":"Chainika Thakar","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/chainikathakar\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/quant-globe-orange-purple.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/184215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/368"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=184215"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/184215\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/182100"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=184215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=184215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=184215"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=184215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}