Sharp: Calculate Sharp Ratio with stock prices

View source: R/backtest.R

SharpR 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)

RMOPI documentation built on Aug. 22, 2022, 5:07 p.m.

Related to Sharp in RMOPI...