rtn.summary: rtn.summary

Description Usage Arguments Value Author(s) Examples

View source: R/pub01_utilityFuncs.R

Description

get the summary infomation of the rtn series,including Annualized Return,Annualized Std Dev,Annualized Sharpe,HitRatio,Worst Drawdown

Usage

1
2
rtn.summary(rtn, hitFreq = "day", Rf = 0, freq = NULL, from = NULL,
  to = NULL, formula = "period+asset~var")

Arguments

rtn

an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns

hitFreq, indicating

the interval when computing the hitRatio of rtn. An interval specification, one of "day", "week", "month", "quarter" and "year", optionally preceded by an integer and a space, or followed by "s".See cut.Date for detail.

Rf

risk free rate, in same period as your returns

freq

NULL or an interval specification.

formula

a charactor string of formula. eg. "period+asset~var". only used when rtn is multi-asset and freq not null.

Value

a matrix if freq is null or rtn is single asset, else a dataframe.

Author(s)

Ruifei.Yin

Examples

1
2
3
4
5
6
7
8
9
rtn.long <- zoo(rnorm(1000,0.001,0.02),as.Date("2010-01-01")+1:1000)
rtn.short <- rtn.long + rnorm(1000,-0.001,0.003)
rtn <- merge(rtn.long,rtn.short)
rtn.summary(rtn)
rtn.summary(rtn.long)
rtn.summary(rtn.long,freq="year")
rtn.summary(rtn,freq="year")
rtn.summary(rtn,freq="year",formula="asset+period~var")
rtn.summary(rtn,from=c("2010-02-03","2010-03-04"),to=c("2011-03-09","2011-03-30"))

raphael210/QUtility documentation built on May 26, 2019, 11:05 p.m.