EVOLUTION-MANAGER
Edit File: WebData.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Fetch Internet Data</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for stockSymbols {TTR}"><tr><td>stockSymbols {TTR}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Fetch Internet Data</h2> <h3>Description</h3> <p>Get investment data from the internet. </p> <h3>Usage</h3> <pre> 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 ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>exchange</code></td> <td> <p>Character vector of exchange names on which desired instrument symbols are traded.</p> </td></tr> <tr valign="top"><td><code>sort.by</code></td> <td> <p>Character vector of columns by which returned data will be sorted. Must be one or more of <code>"Name"</code>, <code>"Symbol"</code>, <code>"Market.Cap"</code>, or <code>"Exchange"</code>.</p> </td></tr> <tr valign="top"><td><code>quiet</code></td> <td> <p>Logical; if <code>TRUE</code>, status messages will be printed to the console.</p> </td></tr> <tr valign="top"><td><code>symbol</code></td> <td> <p>Yahoo! Finance instrument symbol.</p> </td></tr> <tr valign="top"><td><code>start</code></td> <td> <p>Numeric; first date of desired data, in YYYYMMDD format. Default is first date of series.</p> </td></tr> <tr valign="top"><td><code>end</code></td> <td> <p>Numeric; last date of desired data, in YYYYMMDD format. Default is last date of series.</p> </td></tr> <tr valign="top"><td><code>freq</code></td> <td> <p>Desired data frequency. One of <code>"daily"</code>, <code>"weekly"</code>, <code>"monthly"</code>.</p> </td></tr> <tr valign="top"><td><code>type</code></td> <td> <p>Type of data to return. One of <code>"price"</code>, or <code>"split"</code>. <code>type="split"</code> will return both split and dividend data.</p> </td></tr> <tr valign="top"><td><code>adjust</code></td> <td> <p>Logical; if <code>TRUE</code>, the Open, High, Low, and Close prices will be adjusted for dividends and splits, and Volume will be adjusted for dividends.</p> </td></tr> </table> <h3>Details</h3> <p><code>getYahooData</code> 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. </p> <p><code>stockSymbols</code> fetches instrument symbols from the nasdaq.com website, and adjusts the symbols to be compatible with the Yahoo! Finance website. </p> <h3>Value</h3> <p><code>getYahooData</code> returns an xts object containing the columns: </p> <p><code>stockSymbols</code> returns a character vector containing all the listed symbols for the given exchanges. </p> <dl> <dt> Date </dt><dd><p> Trade date, in CCYYMMDD format. </p> </dd> <dt> Open </dt><dd><p> Open price. </p> </dd> <dt> High </dt><dd><p> High price. </p> </dd> <dt> Low </dt><dd><p> Low price. </p> </dd> <dt> Close </dt><dd><p> Close price. </p> </dd> <dt> Volume </dt><dd><p> Volume. </p> </dd> </dl> <h3>Warning</h3> <p>As of TTR 0.23-2, <code>getYahooData</code> has been patched to work with changes to Yahoo Finance, which also included the following changes to the raw data: </p> <ul> <li><p> The adjusted close column appears to no longer include dividend adjustments </p> </li> <li><p> The open, high, and low columns are adjusted for splits, and </p> </li> <li><p> The raw data may contain missing values. </p> </li> <li><p> The raw data may contain errors. </p> </li></ul> <p>As of TTR 0.24.2, <code>stockSymbols</code> 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 <code>NA</code>. </p> <h3>Note</h3> <p>The symbols returned by <code>stockSymbols</code> may not be in the format necessary to retrieve data using <code>getYahooData</code>. </p> <p><code>getYahooData</code> has only been tested on daily data. It isn't known if the function correctly adjusts data for any other frequency. </p> <h3>Author(s)</h3> <p>Joshua Ulrich </p> <h3>References</h3> <ul> <li> <p><a href="https://quant.stackexchange.com/questions/1640/where-to-download-list-of-all-common-stocks-traded-on-nyse-nasdaq-and-amex/1862">Quant StackExchange: Download list of all stock symbols?</a> </p> </li> <li> <p><a href="https://www.nasdaqtrader.com/trader.aspx?id=CQSsymbolconvention">CQS symbol convention</a> </p> </li> <li> <p><a href="https://web.archive.org/web/20111023221931/http://help.yahoo.com/l/us/yahoo/finance/quotes/quote-02.html">Yahoo Finance symbol conventions</a> </p> </li></ul> <h3>Examples</h3> <pre> ### 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") } </pre> <hr /><div style="text-align: center;">[Package <em>TTR</em> version 0.24.3 <a href="00Index.html">Index</a>]</div> </body></html>