| YahooFinanceBase-class | R Documentation |
Base class for Ticker and Index classes.
An R6 class object
symbolSymbol for which data is retrieved.
YahooFinanceBase$new()Create a new YahooFinanceBase object.
YahooFinanceBase$new(symbol = NA, validate = TRUE)
symbolSymbol.
validateLogical; if TRUE, validate symbol against Yahoo Finance. Defaults to TRUE.
YahooFinanceBase$set_symbol()Set a new symbol.
YahooFinanceBase$set_symbol(symbol, validate = TRUE)
symbolNew symbol
validateLogical; if TRUE, validate symbol against Yahoo Finance. Defaults to TRUE.
YahooFinanceBase$get_history()Retrieves historical pricing data from the Yahoo Finance chart API.
**Intraday lookback limits** (imposed by Yahoo Finance):
"1m": max 7 days
"2m", "5m", "15m", "30m", "60m", "90m": max 60 days
"1h": max 730 days
YahooFinanceBase$get_history( period = "ytd", interval = "1d", start = NULL, end = NULL )
periodLength of time. Defaults to 'ytd'. Valid values:
"1d", "5d", "1mo", "3mo", "6mo",
"1y", "2y", "5y", "10y", "ytd", "max".
Ignored when start is provided.
intervalTime between data points. Defaults to '1d'. Valid values:
"1m", "2m", "5m", "15m", "30m",
"60m", "90m", "1h", "1d", "5d",
"1wk", "1mo", "3mo".
startSpecific starting date. String or Date object
in "YYYY-MM-DD" format.
endSpecific ending date. String or Date object
in "YYYY-MM-DD" format. Defaults to today when start is
provided but end is NULL.
A tibble with 8 columns:
symbolCharacter. Ticker symbol.
datePOSIXct. Timestamp of the data point (UTC).
openNumeric. Opening price.
highNumeric. Period high.
lowNumeric. Period low.
closeNumeric. Closing price.
adj_closeNumeric. Split- and dividend-adjusted close.
Falls back to close when the API omits adjusted data.
volumeNumeric. Trading volume.
Returns invisible(NULL) on network failure or invalid symbol.
YahooFinanceBase$clone()The objects of this class are cloneable with this method.
YahooFinanceBase$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.