[R-SIG-Finance] Return.Calculate vs ROC

Costas Vorlow costas.vorlow at gmail.com
Sun Jun 12 22:20:27 CEST 2011


Hi,

I am having a bit of trouble with  the following code:

require(PerformanceAnalytics)
require(quantmod)

getSymbols("^GSPC", from="1990-01-01")

	retorig<-Return.calculate(Cl(GSPC),method="simple")
	retroc<-ROC(Cl(GSPC), type="discrete")

strategiestest<-merge(retorig,retroc)
charts.PerformanceSummary(strategiestest, geometric=FALSE, wealth.index)


shouldn't in the above example retorig=retroc?

retorig appears to be 0....


> head(strategiestest)
           GSPC.Close GSPC.Close.1
1990-01-02          0  0.000000000
1990-01-03          0 -0.002585560
1990-01-04          0 -0.008613000
1990-01-05          0 -0.009756235
1990-01-08          0  0.004514480
1990-01-09          0 -0.011786653
>


Many thanks in advance,
Costas

-- 

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|c|o|s|t|a|s|@|v|o|r|l|o|w|.|o|r|g|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+



More information about the R-SIG-Finance mailing list