## Finance

You can easily double the investment and also double your return right? Not really… read on to see a few metrics that I use.

Why doubling the investment is not always a good idea, because you are also doubling the risk, ideally we should increase the return and decrease the risk.

That's why we need to use risk-adjusted return (ratio) as the ones presented below.

#### Sharpe ratio

In financial books Sharpe ratio (and a few others) is defined as excess return (portfolio return rate - risk free rate) divided by volatility.

$\textcolor{blue} { Sharpe = \frac{R_p - r_f}{\sigma} }$ but we will keep things simple and only consider portfolio return: $\textcolor{blue} { Sharpe = \frac{R_p}{\sigma} }$ where:

• Rp - average portfolio return
• rf - risk-free rate
• σ - standard deviation (both upside and downside volatility)

#### Calmar ratio

Portfolio return over Maximum Drawdown.

$\textcolor{blue} { Calmar = \frac{R_p}{MDD} }$ where:

• Rp - portfolio return
• MDD - maximum drawdown (see below)

Note: this is also called Return over Maximum Drawdown (RoMad) or Risk Return Ratio (RRR) while Sterling ratio is different version of the same MDD-adjusted metric.

#### Ulcer Performance index (UPI)

Same as Sharpe ratio but it uses Ulcer Index (UI) as risk measure instead of volatility (σ).

$\textcolor{blue} { UPI = \frac{R_p}{UI} }$ where:

• Rp - portfolio return
• UI - Ulcer Index (see below)

### Risk metrics

#### Volatility (σ)

Standard deviation of log returns.

$\textcolor{blue} { \sigma = \frac{1}{N} * \sqrt{\sum_{i=1}^{N} (r_i - \mu)^2} }$ where:

• ri - return for period i
• μ - mean of returns
• N - number of periods

#### Ulcer Index (UI)

$\textcolor{blue} { UI = \frac{1}{N} * \sqrt{\sum_{i=1}^{N} {(\frac{C_i - MAX_N}{MAX_N})}^2 * 100} }$ where:

• N - N-period (eg 14-day)
• Ci - current close price
• MAXN - peak value for given N-period

#### Maximum Drawdown (MDD)

Maximum Drawdown measures the largest drop, the difference between a peak and trough for a given period.

$\textcolor{blue} { MDD = \frac{T_t - P_t}{P_t} }$ where:

• Tt - through value for given period t
• Pt - peak value

#### Compound Annual Growth Rate (CAGR)

CAGR is an accurate way to measure how investments have performed over different periods of time but it does not account for risk, only for time.

$\textcolor{blue} { CAGR = [ (\frac{C}{P})^{1/n} - 1 ] * 100 }$ where:

• C - compounded end value
• P - investment begin value
• n - compounding periods (eg years)

### Other Performance metrics

These are not risk/time-adjusted ratios but are good to keep an eye on them.

#### Gain to Pain ratio

It calculates the bang for the buck ratio, the amount of loss (pain) that is "needed" to play the game and make some profit (gain).

$\textcolor{blue} { GtP = \frac{\sum_{i=1}^n{r_i}}{abs(\sum_{i=1}^m{r_{i,n}})} }$ where:

• ri - return for period i (eg monthly)
• ri,n - negative return only
• n - number of trades
• m - number of negative trades
• abs - absolute value

#### Profit factor

Profit factor is a bit different because it uses profit/loss for each individual trade/strategy instead of return for given period.

$\textcolor{blue} { PF = \frac{\sum_{t=1}^n{p_{t}}}{abs(\sum_{t=1}^m{l_{t}})} }$ where:

• pt - positive return (profit) for each trade (strategy)
• lt - negative return (loss)
• n - number of positive trades
• m - number of negative trades

#### Win rate

$\textcolor{blue} { WR = \frac{\#\ of\ t_w}{\#\ of\ t_t} }$ where:

#### Avg win vs. loss ratio

It compares the average size of win vs. loss trades.

$\textcolor{blue} { AWL = \frac{avg(\sum_{i=1}^n{r_{i,p}})}{avg(\sum_{i=1}^n{r_{i,n}})} }$ where:

• ri,p - positive return for i period
• ri,n - negative return
• avg - the average