Sharp {RMOPI} | R Documentation |
Calculate Sharp Ratio with stock prices
Description
Calculate sharp ratio of stock with running window.
Usage
Sharp(x, rf = 0, n = 10)
Arguments
x |
vector of price |
rf |
risk free rate |
n |
the length of running window |
Value
The sharp ratio series with length the same as x
Examples
date <- as.Date("2015-01-01") + days(0:29)
trade <- rTrade(date)
x <- trade$Close
Sharp(x)
[Package RMOPI version 1.1 Index]