I'm having a little trouble understanding why my calculated values are not
matching up with what's being shown on the PerformanceAnalytics chart and
drawdown table:

My calculated equity = 2.83
Cumulative return on the PerformanceAnalytics chart shows about 2.05

table.Drawdowns shows the worst drawdown as about 23%
Drawdown chart shows worst drawdown at about 13%

table.Drawdown shows the worst drawdown beginning on Nov 01, 2011
If I look at the cumulative return chart, it seem to start around July 2007

My code is as follows:

require(quantmod)
require(PerformanceAnalytics)

getSymbols("FAIRX", from='2000-01-01', to=Sys.Date())
FAIRX  <-na.locf(FAIRX )

ind <- EMA(Ad(FAIRX),100)

sig <- Lag(ifelse(ind > Lag(ind,30), 1, 0))

ret <- diff(log(Ad(FAIRX )))*sig
bh.ret <- Delt(Ad(FAIRX ), type='log')
ret[is.na(ret)] <- 0

eq <- exp(cumsum(ret))

table <- na.omit(merge.xts(Ad(FAIRX ), round(ind,3), sig, round(ret,3),
round(bh.ret,3),round(eq,3)))
names(table) <-c("SP5", "ind", "sig", "rtn", "bhrtn", "equity")

table.Drawdowns(ret, top=5)
table.DownsideRisk(ret)
charts.PerformanceSummary(table[,c("rtn","bhrtn")], wealth.index=TRUE,
colorset=rich6equal, lwd=1, ylog=FALSE, geometric=FALSE)
print(tail(table))

	[[alternative HTML version deleted]]

