sortino: Sortino Ratio

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

Description

Calculate Sortino ratio based on a vector of gains (or prices). The formula is: (mean(gains) - rf) / sd(negatives(gains)). Here rf is some risk-free rate of return, gains is a vector of gains (usually daily, but could be weekly, monthly, or some other time interval), and negatives(gains) gets the subset of gains that are negative. User can specify prices or gains.

Usage

1
sortino(gains = NULL, prices = NULL, rf = 0)

Arguments

gains

Numeric vector of gains.

prices

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

rf

Risk-free rate of return hypothetically available to the investor.

Details

NA

Value

Numeric value indicating the Sortino ratio.

Note

Several definitions of Sortino ratio are commonly used; this simple version may or may not be the one you prefer.

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

sharpe, rrr, mdd

Examples

1
2
3
4
5
# Randomly generate daily stock gains over a 5-year period
stock.gains <- rnorm(251*5, 0.0005, 0.01)

# Calculate Sortino ratio using risk-free return of 0
sortino(stock.gains)


Search within the stocks package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.