stockSymbols | R Documentation |
Get investment data from the internet.
stockSymbols(
exchange = c("AMEX", "NASDAQ", "NYSE", "ARCA", "BATS", "IEX"),
sort.by = c("Exchange", "Symbol"),
quiet = FALSE
)
getYahooData(
symbol,
start,
end,
freq = "daily",
type = "price",
adjust = TRUE,
quiet = FALSE
)
exchange |
Character vector of exchange names on which desired instrument symbols are traded. |
sort.by |
Character vector of columns by which returned data will be
sorted. Must be one or more of |
quiet |
Logical; if |
symbol |
Yahoo! Finance instrument symbol. |
start |
Numeric; first date of desired data, in YYYYMMDD format. Default is first date of series. |
end |
Numeric; last date of desired data, in YYYYMMDD format. Default is last date of series. |
freq |
Desired data frequency. One of |
type |
Type of data to return. One of |
adjust |
Logical; if |
getYahooData
fetches individual stock data from the Yahoo! Finance
website. It also adjusts price for splits and dividends, and volume for
splits. See the Warning section, and note that it is deprecated in favor
of getSymbols in the quantmod package.
stockSymbols
fetches instrument symbols from the nasdaq.com website,
and adjusts the symbols to be compatible with the Yahoo! Finance website.
getYahooData
returns an xts object containing the columns:
stockSymbols
returns a character vector containing all the listed
symbols for the given exchanges.
Trade date, in CCYYMMDD format.
Open price.
High price.
Low price.
Close price.
Volume.
As of TTR 0.23-2, getYahooData
has been patched to work with changes
to Yahoo Finance, which also included the following changes to the raw data:
The adjusted close column appears to no longer include dividend adjustments
The open, high, and low columns are adjusted for splits, and
The raw data may contain missing values.
The raw data may contain errors.
As of TTR 0.24.2, stockSymbols
began using data from NASDAQ's FTP
site because the data from the original site is no longer available. This
new file does not contain data for the columns: LastSale, MarketCap,
IPOyear, Sector, and Industry. All the columns still appear in the results,#' but all the values in the columns are set to NA
.
The symbols returned by stockSymbols
may not be in the format
necessary to retrieve data using getYahooData
.
getYahooData
has only been tested on daily data. It isn't known if
the function correctly adjusts data for any other frequency.
Joshua Ulrich
### Note: you must have a working internet
### connection for these examples to work!
if (interactive()) {
ge <- getYahooData("GE", 19990404, 20050607, adjust = FALSE)
nyse.symbols <- stockSymbols("NYSE")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.