backtest.longshort: backtest.longshort

Description Usage Arguments Value Author(s) See Also Examples

Description

backtesting the factor with some tables and charts using the 'long-short(hedging)' method.

Usage

1
2
3
4
5
tables.longshort(rtn.LSH, hitFreq = "month")

chart.longshort.summary(rtn.LSH, bar.freq = "month")

chart.longshort.rolling(rtn.LSH, roll.width = 250, roll.by = 30)

Arguments

rtn.LSH

a rtn.LSH or a rtn.LBH object getting by function getrtn.LSH or getrtn.LBH.

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.

bar.freq

the freq of the per-period performance bar chart

roll.width

the width argument for rolling performance chart

roll.by

the by argument for rolling performance chart

Value

tables.longshort return a list containing some tables which giving the result of the long-short strategy backtesting.The items are:

chart.longshort.summary return and print a recordedplot object, which demonstrate the performance of the return series,including wealth index chart(of long,short and hedging),underwater chart for drawdown(of hedging),and bars for per-period performance(of hedging)..

chart.longshort.rolling return and print a recordedplot object, which include a rolling annualized returns chart,a rolling annualized standard deviation chart, and a rolling annualized sharpe ratio chart.

Author(s)

Ruifei.Yin

See Also

getrtn.LSH,getrtn.LBH

Examples

1
2
3
4
5
6
7
rtn.long <- xts(rnorm(1000,0.001,0.02),as.Date("2010-01-01") + 1:1000)
rtn.short <- rtn.long + rnorm(1000,-0.0001,0.003)
rebFreq <- "month"
rtn.LSH <- addrtn.hedge(rtn.long,rtn.short,rebFreq)
re <- tables.longshort(rtn.LSH)
chart.longshort.summary(rtn.LSH)
chart.longshort.rolling(rtn.LSH)

raphael210/RFactorModel documentation built on May 26, 2019, 11:06 p.m.