Sharp | R Documentation |
Calculate sharp ratio of stock with running window.
Sharp(x, rf = 0, n = 10)
x |
vector of price |
rf |
risk free rate |
n |
the length of running window |
The sharp ratio series with length the same as x
date <- as.Date("2015-01-01") + days(0:29) trade <- rTrade(date) x <- trade$Close Sharp(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.