Re: [R-SIG-Finance] Slow data EOD
And Jeff's already provided a quoteFormat (which I had forgotten about) so that you don't have to rearrange columns. getQuote(SPY, what=yahooQuote.EOD) Trade Time Open HighLow CloseVolume SPY 2012-10-12 04:00:00 143.46 143.95 142.58 142.89 124181904 On Tue, Oct 9, 2012 at 12:04 PM, Ralph Vince rvinc...@gmail.com wrote: Ah, okthen I can create a function to perhaps append it onto the file I am downloading entirely end of day or something like that. On Tue, Oct 9, 2012 at 1:02 PM, G See gsee...@gmail.com wrote: On Tue, Oct 9, 2012 at 11:58 AM, Ralph Vince rvinc...@gmail.com wrote: Thanks Garrett, Im really just looking for timely end-of-day data on this though. Ralph For example, getQuote(SPY), will return end of day data if you call it late in the afternoon ;-) ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
[R-SIG-Finance] Slow data EOD
I'm downloading certain equity data from yahoo on an eod basis, using the code, below. It works wonderfully, formatting the data and dates precisely as I am looking for EXCEPT often the data is late. Often, the latest market day's data is not up until 10, 11 pm that night. Is there something I am doing wrong here? Surely, yahoo must have the data by the close. is the way I am invoking calling the file, below, causing this? Or is there a way to obtain it from google earlier? I;d be very grateful for any help along these lines. Ralph Vince require(quantmod) library(plan) brsym - c( AAPL, ABT, ... WMT, XOM ); for (i in 1:length(brsym)) { tryCatch({ j - paste(http://table.finance.yahoo.com/table.csv?s=,brsym[[i]],sep=;); j - paste(j,g=dignore=.csv,sep=); print(j); X - read.csv(j, header=TRUE); # Convert the Date column from a factor class to a Date class X$Date - as.Date(X$Date) # Sort the X object by the Date column -- order(-X$Date) will sort it in the other direction X - X[order(X$Date),] # Format the date column as you want X$Date - format(as.Date(X$Date),%Y%m%d); X - X[,1:6] kk - trim.whitespace(brsym[[i]]); k - paste(/home/oracle/broadbaseddata/, kk, sep=); k - trim.whitespace(k); k - paste(k,.csv, sep=); write.table(X, k, append = FALSE, quote = FALSE, sep = ,, eol = \n, na = NA, dec = ., row.names = FALSE, col.names = FALSE, qmethod = c(escape, double)); print(k); ko - paste(X$Date[1], -,X$Date[length(X$Date)]); print(ko); }, interrupt = function(ex) { cat(An interrupt was detected.\n); print(ex); }, error = function(ex) { cat(An error was detected.\n); print(ex); }, finally = { cat(done\n); }) } ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Re: [R-SIG-Finance] Slow data EOD
Hi Ralph, You can get real time intraday data from yahoo or google: http://www.quantshare.com/sa-426-6-ways-to-download-free-intraday-and-tick-data-for-the-us-stock-market Or you can get delayed data with quantmod::getQuote. Maybe that will work better for you. I'm not sure about your particular issue, but one of the issues with yahoo's daily data is that sometimes it has duplicate timestamps (and different volume) for the most recent observation. HTH, Garrett On Tue, Oct 9, 2012 at 11:26 AM, Ralph Vince rvinc...@gmail.com wrote: I'm downloading certain equity data from yahoo on an eod basis, using the code, below. It works wonderfully, formatting the data and dates precisely as I am looking for EXCEPT often the data is late. Often, the latest market day's data is not up until 10, 11 pm that night. Is there something I am doing wrong here? Surely, yahoo must have the data by the close. is the way I am invoking calling the file, below, causing this? Or is there a way to obtain it from google earlier? I;d be very grateful for any help along these lines. Ralph Vince require(quantmod) library(plan) brsym - c( AAPL, ABT, ... WMT, XOM ); for (i in 1:length(brsym)) { tryCatch({ j - paste(http://table.finance.yahoo.com/table.csv?s=,brsym[[i]],sep=;); j - paste(j,g=dignore=.csv,sep=); print(j); X - read.csv(j, header=TRUE); # Convert the Date column from a factor class to a Date class X$Date - as.Date(X$Date) # Sort the X object by the Date column -- order(-X$Date) will sort it in the other direction X - X[order(X$Date),] # Format the date column as you want X$Date - format(as.Date(X$Date),%Y%m%d); X - X[,1:6] kk - trim.whitespace(brsym[[i]]); k - paste(/home/oracle/broadbaseddata/, kk, sep=); k - trim.whitespace(k); k - paste(k,.csv, sep=); write.table(X, k, append = FALSE, quote = FALSE, sep = ,, eol = \n, na = NA, dec = ., row.names = FALSE, col.names = FALSE, qmethod = c(escape, double)); print(k); ko - paste(X$Date[1], -,X$Date[length(X$Date)]); print(ko); }, interrupt = function(ex) { cat(An interrupt was detected.\n); print(ex); }, error = function(ex) { cat(An error was detected.\n); print(ex); }, finally = { cat(done\n); }) } ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go. ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Re: [R-SIG-Finance] Slow data EOD
Thanks Garrett, Im really just looking for timely end-of-day data on this though. Ralph On Tue, Oct 9, 2012 at 12:40 PM, G See gsee...@gmail.com wrote: Hi Ralph, You can get real time intraday data from yahoo or google: http://www.quantshare.com/sa-426-6-ways-to-download-free-intraday-and-tick-data-for-the-us-stock-market Or you can get delayed data with quantmod::getQuote. Maybe that will work better for you. I'm not sure about your particular issue, but one of the issues with yahoo's daily data is that sometimes it has duplicate timestamps (and different volume) for the most recent observation. HTH, Garrett On Tue, Oct 9, 2012 at 11:26 AM, Ralph Vince rvinc...@gmail.com wrote: I'm downloading certain equity data from yahoo on an eod basis, using the code, below. It works wonderfully, formatting the data and dates precisely as I am looking for EXCEPT often the data is late. Often, the latest market day's data is not up until 10, 11 pm that night. Is there something I am doing wrong here? Surely, yahoo must have the data by the close. is the way I am invoking calling the file, below, causing this? Or is there a way to obtain it from google earlier? I;d be very grateful for any help along these lines. Ralph Vince require(quantmod) library(plan) brsym - c( AAPL, ABT, ... WMT, XOM ); for (i in 1:length(brsym)) { tryCatch({ j - paste(http://table.finance.yahoo.com/table.csv?s=,brsym[[i]],sep=;); j - paste(j,g=dignore=.csv,sep=); print(j); X - read.csv(j, header=TRUE); # Convert the Date column from a factor class to a Date class X$Date - as.Date(X$Date) # Sort the X object by the Date column -- order(-X$Date) will sort it in the other direction X - X[order(X$Date),] # Format the date column as you want X$Date - format(as.Date(X$Date),%Y%m%d); X - X[,1:6] kk - trim.whitespace(brsym[[i]]); k - paste(/home/oracle/broadbaseddata/, kk, sep=); k - trim.whitespace(k); k - paste(k,.csv, sep=); write.table(X, k, append = FALSE, quote = FALSE, sep = ,, eol = \n, na = NA, dec = ., row.names = FALSE, col.names = FALSE, qmethod = c(escape, double)); print(k); ko - paste(X$Date[1], -,X$Date[length(X$Date)]); print(ko); }, interrupt = function(ex) { cat(An interrupt was detected.\n); print(ex); }, error = function(ex) { cat(An error was detected.\n); print(ex); }, finally = { cat(done\n); }) } ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go. ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Re: [R-SIG-Finance] Slow data EOD
On Tue, Oct 9, 2012 at 11:58 AM, Ralph Vince rvinc...@gmail.com wrote: Thanks Garrett, Im really just looking for timely end-of-day data on this though. Ralph For example, getQuote(SPY), will return end of day data if you call it late in the afternoon ;-) ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Re: [R-SIG-Finance] Slow data EOD
Ah, okthen I can create a function to perhaps append it onto the file I am downloading entirely end of day or something like that. On Tue, Oct 9, 2012 at 1:02 PM, G See gsee...@gmail.com wrote: On Tue, Oct 9, 2012 at 11:58 AM, Ralph Vince rvinc...@gmail.com wrote: Thanks Garrett, Im really just looking for timely end-of-day data on this though. Ralph For example, getQuote(SPY), will return end of day data if you call it late in the afternoon ;-) ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.