# Using R to analyse MAN AHL Trend

(This article was first published on Copula, and kindly contributed to R-bloggers)

Let’s use the great PerformanceAnalytics package to get some insights on the risk profile of the MAN AHL Trend Fund. It’s a program with a long track record – I believe in the late 80′. The UCITS Fund NAV Data can be downloaded from the fund webpage as xls file- starting 2009.

First let’s import the data into R. I’m using a small function, to import .csv which returns an .xts object named ahl.

#Monthly NAV MAN AHL
a=read.table(“ahl_trend.csv”,sep = “,”,dec = “,”)
a\$date = paste(substr(a\$V1,1,2),substr(a\$V1,4,5),substr(a\$V1,7,10),sep=”-“)
ahl=a\$date
ahl=cbind(ahl,substr(a\$V2,1,5))
a=as.POSIXct(ahl[,1],format=”%d-%m-%Y”)
ahl=as.xts(as.numeric(ahl[,2]),order.by=a)
rm(a)
return(ahl)
}

next we would like to have the monthly returns

`monthlyReturn(x, subset=NULL, type='arithmetic',           leading=TRUE, ...)`
` `
` `

which we store in retahl.

retahl=monthlyReturn(ahl,type=”log”)

Next, I usually plot the chart.Drawdown to get a visual idea, if the product is designed for my risk appetite.

`chart.Drawdown(retahl)`

`table.AnnualizedReturns(retahl)`
` `
`                          monthly.returnsAnnualized Return                  0.0212Annualized Std Dev                 0.1246Annualized Sharpe (Rf=0%)          0.1702`
` `
`table.DownsideRisk(retahl)                             monthly.returnsSemi Deviation                        0.0254Gain Deviation                        0.0222Loss Deviation                        0.0222Downside Deviation (MAR=10%)          0.0289Downside Deviation (Rf=0%)            0.0241Downside Deviation (0%)               0.0241Maximum Drawdown                      0.2478Historical VaR (95%)                 -0.0521Historical ES (95%)                  -0.0748Modified VaR (95%)                   -0.0573Modified ES (95%)                    -0.0730 `
` `
` `

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more…

Source:: R News