rrr: Risk-Return Ratio

Description Usage Arguments Value Author(s) References See Also Examples

Description

Calculate ratio of investment return to investment risk based on a vector of prices or gains. The formula is growth rate / mdd, where growth rate is the growth of an investment over some time period and mdd is the maximum drawdown over that time period.

Usage

1
2
3
4
rrr(prices = NULL,
    gains = NULL,
    highs = NULL, lows = NULL,
    nas = FALSE)

Arguments

prices

Numeric vector of investment prices (typically daily closing prices).

gains

Numeric vector of gains.

highs

Numeric vector of daily highs.

lows

Numeric vector of daily lows.

nas

If TRUE, function finds and removes any missing values (NAs) in prices. The default is FALSE to maximize speed for the usual case where there are no missing values.

Value

Numeric value indicating the risk-return ratio.

Author(s)

Dane R. Van Domelen

References

Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.

See Also

gains.rate, prices.rate, mdd, sharpe.ratio, sortino.ratio

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Randomly generate daily stock gains over a 5-year period
set.seed(123)
stock.gains <- rnorm(252 * 5, 0.0005, 0.01)

# Convert to daily balances assuming an initial balance of $10,000
daily.balances <- balances(stock.gains + 1)

# Total return is about 1.23
daily.balances[length(daily.balances)] / daily.balances[1] - 1

# Maximum drawdown is about 0.19
mdd(daily.balances)

# Ratio of these two is about 6.48
(daily.balances[length(daily.balances)] / daily.balances[1] - 1) /
mdd(daily.balances)

# Easier to calculate using rrr function
rrr(daily.balances)

stocks documentation built on May 2, 2019, 5:22 p.m.