[R] Continuasly Compunded Returns with quantmod-data

barb mainzel89 at hotmail.com
Mon Nov 21 00:52:55 CET 2011


Hey guys,  

i want to calculate the continuasly compounded returns for stock prices. 

Formula for CCR:
R_t = ln(P_t/P_{t-1})*100

With R:

First i have to modify the vectors, so that they have the same length 
and we start at the second observation. 

log(GOOG1[-1]/GOOG1[1:length(GOOG1)-1])*100

That does work with normal vectors. 

My Questions:

1) I want to use this for stock prices.


so i use:

library(quantmod) 
getSymbols("GOOG",from="2011-11-01")
GOOG1<-GOOG[,1]


If i use my formula i get only the value "1" for every observation :( 



Thanks for your time and help!
I appreciate it

Regards
Tonio

--
View this message in context: http://r.789695.n4.nabble.com/Continuasly-Compunded-Returns-with-quantmod-data-tp4090014p4090014.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list