I have a problem trying to use a loop structure to download prices from
Yahoo.
When I try the following code segment:

library(tseries)
# Initialize price vector
prices <- get.hist.quote("^dji", start = "2006-01-01", compress = "m")[,
"Close"]
# Now download individual securities
indices <- c("OEX", "IXIC")
for (index in indices)
  {
    symbol = paste("^", index, sep="")
    p <-  get.hist.quote(symbol, start = "2006-01-01", compress = "m")[,
"Close"]
    prices <- merge(prices, p, all = FALSE)
  }

I get the error message:
"Error in get(x, envir, mode, inherits) : variable "OEX" of mode "function"
was not found".

The prices for the first item in the index series appears to be downlaoded
correctly, but the "merge" fails?

I have a lot of equities to process, so doing it by hand would be very
unpleasant.
Any help wold be appreciated.
(As you might have guessed, I am not a programmer!)

Michael.

-- 
Michael B Cohen
Southern Cross University

	[[alternative HTML version deleted]]

