πŸ”’Formulas and Calculations

How does Index One calculate volatility, sharpe ratio, sortino ratio, max drawdowns and returns?

Volatility

The volatility of daily log returns is calculated as the standard deviation of the log returns. Volatility is "annualized" unless specified otherwise. Number of trading days for the index is typically 252.

𝜎=1nβˆ’1βˆ‘t=2n(ln⁑(PtPtβˆ’1)βˆ’ΞΌR)2𝜎=\sqrt{\tfrac{1}{n-1}\displaystyle\sum_{t=2}^n(\ln(\tfrac{P_t}{P_t-1})-\mu_R)^2}

Where:

  • Οƒ = Volatility (standard deviation of log returns).

  • Pt = Index value on day t.

  • Rt=ln⁑(Pt/Ptβˆ’1) = Log return on day t.

  • ΞΌR​ = Mean of the log returns.

  • n = Total number of days.

  • Annualized Volatility (𝜎annual):

𝜎annual=N.𝜎daily𝜎annual=\sqrt{N}.𝜎daily

Where:

  • 𝜎annual = Annualized volatility.

  • N = Number of trading days in a year.

  • 𝜎daily = Standard deviation of daily log returns.


Sharpe ratio

The Sharpe Ratio measures the excess return (above a risk-free rate) per unit of risk (volatility) for an investment.

For the Sharpe ratio, we assume the risk-free return is zero.

S=Rβ€Ύβˆ’Rf𝜎S = \tfrac{\overline{R}-R_f}{𝜎}

Definitions of Variables

  • Average Daily Log Return (Rβ€Ύ): The mean of the daily log returns is:

Rβ€Ύ=1nβˆ’1βˆ‘t=2nln(PtPtβˆ’1)\overline{R}=\tfrac{1}{n-1}\displaystyle\sum_{t=2}^nln(\tfrac{P_t}{P_t-1})
  • Risk-Free Rate (Rf): The daily risk-free rate is a constant, typically derived from annualized rates (e.g., from treasury bonds) and converted to a daily equivalent.

  • Volatility (Οƒ): The annualized standard deviation of the daily log returns, refer to the Volatility definition for further details.


Sortino ratio

The Sortino ratio evaluates the risk-adjusted return of an investment, portfolio, or strategy.

For the Sortino ratio, we assume the risk-free return is zero.

S=Rβ€Ύβˆ’Rf𝜎DS = \tfrac{\overline{R}-R_f}{𝜎_D}

Definitions of Variables

  • Risk-Free Return (Rf): The daily risk-free rate is a constant, typically derived from annualized rates (e.g., from treasury bonds) and converted to a daily equivalent.

  • Mean Daily Log Return (Rβ€Ύ): The average daily log return is:

Rβ€Ύ=1nβˆ’1βˆ‘t=2nRt\overline{R}= \tfrac{1}{n-1}\displaystyle\sum_{t=2}^nR_t
  • Downside Deviation (ΟƒD): The downside deviation measures the variability of returns that fall below the Risk-Free Rate. It is calculated as:

𝜎D=1nβˆ’1βˆ‘t=2mmax(0,Rfβˆ’Rt)2𝜎_D=\sqrt{\tfrac{1}{n-1}\displaystyle\sum_{t=2}^mmax(0,R_f-R_t)^2}

Maximum Drawdown

Maximum Drawdown (MDD) measures the largest peak-to-trough decline in a portfolio's value over a given period, expressed as a percentage.

Given a sequence of daily index values P1, P2, ... Pt (where t represents the day or index number), the maximum drawdown is calculated as:

MDD=1≀t≀Tmax(Ptβˆ’maxt≀i≀tPimaxt≀i≀tPi)MDD = _{1\leq{t}\leq{T}}^{max}(\tfrac{P_t-max_{t\leq{i}\leq{t}}P_i}{max_{t\leq{i}\leq{t}}P_i})

Where:

  • Pt: Value of the index at time t.

  • T: Total number of time periods.

  • max_1≀i≀tPi: The highest value of the index observed from the beginning of the period up to time t.

  • (P_t-max_1≀i≀tPi)/(max_1≀i≀tPi): The relative drawdown at time t, which is the percentage loss from the highest value observed up to time t.


Rate of return

The return measures the percentage change in the value of an investment over a given period. For daily index values, the return is calculated using the initial and final index values.

Return=PnP1βˆ’1Return=\tfrac{P_n}{P_1}-1

Where:

  • P1​: The initial index value (on the first day of the period).

  • Pn: The final index value (on the last day of the period).


Annualized Return

The annualized return converts the total return over a period into an equivalent yearly return, assuming compounding. It helps to compare returns over different time periods.

AnnualizedReturns=(1+Return)365Tβˆ’1AnnualizedReturns=(1+Return)^\tfrac{365}{T}-1

Definitions of Variables

  • Return: The total return over the entire period, calculated as:

Return=PnP1βˆ’1Return=\tfrac{P_n}{P_1}-1
  • T: The total number of days in the period.

  • 365: The number of days in a year, used for annualization.

Last updated