getdata {atmi}R Documentation

getdata

Description

Get the daily finance data for the desired period from http://finance.yahoo.com/.

Usage

getdata(symbol = FALSE, period = c(startdate = FALSE, enddate = FALSE))

Arguments

symbol a unique series of letters assigned to a security for trading purposes. You can get the symbols by using the function getsymbols or from http://finance.yahoo.com/. If FALSE, a datamatrix is needed.
period is a vector of start and end dates, in "YYYY-MM-DD" format. If the startdate is FALSE, all available data until the enddate will be used. If the enddate is FALSE, all available data from the startdate will be used. If both are FALSE, all available data will be used.

Value

datamatrix a matrix object with the following columns::
Date trade date in "YYYY-MM-DD" format
Open open price
High the highest price of the day
Low the lowest price of the day
Close closing price
Volume average volume
Adj.Close adjusted closing price

Warning

To run the function, an active Internet connection is required.

Note

The last column Adj.Close of the returned matrix datamatrix provides the closing price adjusted for all applicable splits and dividend distributions.

Author(s)

Waldemar Kemler, Peter Schaffner

See Also

getsymbols

Examples

# Returns data for "AACC" for whole available period.
datamat<-getdata("AACC")
# Returns data for "AACC" for the period from 2008-01-01 through 2008-12-31.
datamat<-getdata("AACC", period=c("2008-01-01","2008-12-31"))
# Returns all available data for "AACC" until 12/31/08.
datamat<-getdata("AACC", period=c(FALSE,"2008-12-31"))
# Returns all available data from 01/01/08. With the usage of function "getsymbols".
symbol<-getsymbols("DJI")
datamat<-getdata(symbol[1], period=c("2008-01-01",FALSE))
datamat

[Package atmi version 1.0 Index]