Skip to content

Retrieving latest day's data

5 messages · Joshua Ulrich, Cedrick Johnson, Martin Jenkins +1 more

#
Martin,

Have you had a look at getQuote in quantmod?

Best,
Josh
--
http://www.fosstrading.com
On Mon, Nov 16, 2009 at 5:27 PM, Martin Jenkins <mjenko at yahoo.com> wrote:
#
I have found that typically after the evening extended sessions finish 
(~8PM ET) I can get today's closing prices. I just ran this now @ 9:45P 
et and got my closing prices for today:

           GSPC.Open GSPC.High GSPC.Low GSPC.Close GSPC.Volume GSPC.Adjusted
2009-11-13   1087.59   1097.79  1085.33    1093.48  3792610000       1093.48
2009-11-16   1094.13   1113.69  1094.13    1109.30  4565850000       1109.30

I see you're getting UK tickers (this is what Joshua suggested, the 
getQuote function in quantmod):
 > getQuote("AML.L")
               Trade Time  Last Change % Change Open  High   Low  Volume
AML.L 2009-11-16 11:35:00 387.4   10.8   +2.87%  385 395.1 375.6 3375783

*edit*

While composing, I thought to check using Google:

 > getSymbols("AML.L", src="google")

 > tail(AML.L,2)
           AML.L.Open AML.L.High AML.L.Low AML.L.Close AML.L.Volume
2009-11-13      372.9      376.9     368.1       376.6      1403827
2009-11-16      385.0      395.1     375.6       387.4      3375783

Try that on the rest of your symbols to see what you get. Again, the 
time(s) that they update the closing price may be different. The same 
query I just did using Yahoo as a source yielded the 13th's closing 
price, while google is getting you what you want.

HTH,
Cedrick
Martin Jenkins wrote:
#
Hi Martin,

The 'time' in an xts or zoo object isn't part of the data per se.

index() or time() will extract for you.

write.zoo() will also output what you expect to disk
[1] "AAPL"
[1] "2007-01-03" "2007-01-04" "2007-01-05" "2007-01-08" "2007-01-09"
[6] "2007-01-10"
[1] "2007-01-03" "2007-01-04" "2007-01-05" "2007-01-08" "2007-01-09"
[6] "2007-01-10"
"Index" "AAPL.Open" "AAPL.High" "AAPL.Low" "AAPL.Close" "AAPL.Volume"
"AAPL.Adjusted"
2009-11-09 196.94 201.9 196.26 201.46 18854500 201.46
2009-11-10 201.02 204.98 201.01 202.98 14315400 202.98
2009-11-11 204.56 205 201.83 203.25 15852500 203.25
2009-11-12 203.14 204.87 201.43 201.99 12990400 201.99
2009-11-13 202.87 204.83 202.07 204.45 12220200 204.45
2009-11-16 205.48 208 205.01 206.63 17216900 206.63


Best,
Jeff
On Tue, Nov 17, 2009 at 4:34 PM, Martin Jenkins <mjenko at yahoo.com> wrote: