Description Usage Arguments Value Author(s) See Also Examples
backtesting the factor with some tables and charts using the 'long-short(hedging)' method.
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)
|
rtn.LSH |
a rtn.LSH or a rtn.LBH object getting by function |
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 |
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 |
tables.longshort return a list containing some tables which giving the result of the long-short strategy backtesting.The items are:
summary: summary of of long,short and hedge.
summary.yearly: yearly summary of the hedged rtn.
hedge.stats: main statisticals of the hedged rtn,by different freq.
period.stats: table showing yearly,all-span and annualized return of long,short and hedge.
DD.stats:table showing statistics for the worst drawdowns of the hedged rtn.
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.
Ruifei.Yin
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.