CalculateReturns(prices, method=c("compound","simple"))
Return.cumulative
require(tseries)
prices = get.hist.quote("^gspc", start = "1999-01-01", end = "2007-01-01", quote = "Close", compression = "m")
returns = CalculateReturns(prices, method="simple")
colnames(returns)="SP500"
Run the code above in your browser using DataLab