Calculating Daily Returns with Quantmod for R

Joined
6/22/08
Messages
114
Points
28
First, I am still quite the novice when it comes to R in general.

I am finding some odd results with quantmod's functions for daily returns.

Start with the following code:
Code:
getSymbols('QQQ',src='yahoo')
testRet<-allReturns(QQQ,type='arithmetic')

Then I perform the following:
Code:
> testRet[2]
                daily weekly monthly quarterly
2007-01-04 0.01896392    NA      NA        NA

> QQQ$QQQ.Adjusted[2]
          QQQ.Adjusted
2007-01-04        42.97

> QQQ$QQQ.Adjusted[1]
          QQQ.Adjusted
2007-01-03        42.17
> (42.97-42.17)/42.17
[1] 0.01897083

Can somebody help me with this one? Is it a rounding issue?

Thanks!
 
Back
Top