[R-SIG-Finance] [R-sig-finance] getSymbols() date range

Jeff Ryan jeff.a.ryan at gmail.com
Fri Jul 31 16:11:07 CEST 2009


Eduard,

getSymbols( src="yahoo") will let you set any time as the from parameter.

getSymbols("^GSPC", from="1900-01-01") should do what you want.  The
'to' is always today's date.

HTH
Jeff

P.S. The data editor issue is one you should ask on R-help, as that
would have nothing to do with the quantmod/finance side of things.



On Fri, Jul 31, 2009 at 8:28 AM,
ehxpieterse<eduard.pieterse at macquarie.com> wrote:
>
> Hi,
>
> Using the following code, I can easily grab the S&P history:
>
> from.dat <- as.Date("01/01/80", format="%m/%d/%y")
> to.dat <- as.Date("07/30/09", format="%m/%d/%y")
> getSymbols("^GSPC", src="yahoo", from = from.dat, to = to.dat)
>
> However, I would like to know how to grab all the history, without knowing
> beforehand when it starts. Using getSymbols() without the date ranges, only
> gives a few years' worth of history. Typically, the Dow started somwhere in
> 1920 and the S&P somewhere in 1970 (the data that is).
>
> Also, out of interest, when I open an imported data set and view it using
> data editor, I can only see the Series.open values. Is this a feature or am
> I doing something strange?
>
> Many thanks,
> Eduard
> --
> View this message in context: http://www.nabble.com/getSymbols%28%29-date-range-tp24756400p24756400.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



-- 
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com



More information about the R-SIG-Finance mailing list