Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

yahoo.get.hist.quote

Download stock data from Yahoo!


Description

Downloads stock data from Yahoo!

Usage

yahoo.get.hist.quote(instrument = "^gspc", 
destfile = paste(instrument, ".csv", sep = ""), 
start, end, quote = c("Open", "High", "Low", "Close"), 
adjusted = TRUE, download = TRUE, 
origin = "1970-01-01", compression = "d")

Arguments

instrument

Ticker symbol as character string.

destfile

Temporary file for storage

start

Date to start. Specified as "2005-12-31"

end

Date to end

quote

Any/All of "Open", "High", "Low", "Close"

adjusted

Adjust for stock splits, dividends. Defaults to TRUE

download

Download the data

origin

Dates are recorded in the number of days since the origin. A value of "1970-01-01" is the default. This was changed from "1899-12-30".

compression

Passed to yahoo

Details

Goes to chart.yahoo.com and downloads the stock data. By default returns a multiple time series of class mts with missing days padded by NAs.

Value

A multiple time series with time measureing the number of days since the value specified to origin.

Author(s)

Daniel Herlemont <dherlemont@yats.com>

References

This function was found on the mailling list for R-SIG finance

See Also

yahoo.get.hist.quote in the tseries package


UsingR

Data Sets, Etc. for the Text "Using R for Introductory Statistics", Second Edition

v2.0-6
GPL (>= 2)
Authors
John Verzani <verzani@math.csi.cuny.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.