| Tickers | R Documentation |
An R6 class to manage and aggregate data from multiple Yahoo Finance tickers
simultaneously. It wraps the Ticker class to provide a unified,
long-format data interface suitable for bulk analysis and visualization.
The Tickers class automates the process of iterating over a vector of
symbols. It handles per-symbol errors gracefully via an internal
aggregate_data helper, ensuring that a failure in one symbol does
not prevent the collection of data for others.
Most properties return a data.frame where the first column is
symbol, facilitating easy filtering and joining in tidy workflows.
symbolsA unique character vector of symbols being tracked.
ticker_objsA named list of underlying Ticker R6 objects.
recommendationsRelated symbols suggested by Yahoo Finance and their relevance scores.
valuation_measuresQuarterly valuation statistics including PE and Enterprise Value.
technical_insightsTechnical indicator snapshots (e.g., RSI, Moving Averages).
regular_market_priceThe current market price for each symbol.
regular_market_timeThe timestamp of the last market trade.
regular_market_volumeThe current trading volume.
regular_market_day_highThe highest price during the current trading session.
regular_market_day_lowThe lowest price during the current trading session.
previous_closeThe closing price of the previous trading day.
fifty_two_week_highThe highest price over the last 52 weeks.
fifty_two_week_lowThe lowest price over the last 52 weeks.
currencyThe currency code (e.g., "USD") for the symbols.
exchange_nameThe short name of the stock exchange.
full_exchange_nameThe full name of the stock exchange.
first_trade_dateThe Unix timestamp of the first recorded trade.
timezoneThe timezone code (e.g., "EDT").
exchange_timezone_nameThe full name of the exchange's timezone.
Tickers$new()Create a new Tickers object.
Tickers$new(symbols, validate = TRUE)
symbolsA character vector of Yahoo Finance ticker symbols.
validateLogical; if TRUE, validate symbols against Yahoo Finance. Defaults to TRUE.
A new Tickers object.
Tickers$get_history()Retrieve historical market data for all symbols.
Tickers$get_history(period = "1y", interval = "1d", start = NULL, end = NULL)
periodLength of time. Defaults to '1y'. 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 tidy tibble containing historical prices and volumes.
Columns: symbol, date, open, high, low,
close, adj_close, volume. Returns a zero-row tibble with these columns if all tickers fail.
Tickers$aggregate_data()Internal helper to execute a method across all symbols and combine results. Not intended for direct end-user use.
Tickers$aggregate_data(fn)
fnA function or anonymous function that takes a Ticker object.
A combined tibble, or an empty tibble if all tickers fail.
Tickers$clone()The objects of this class are cloneable with this method.
Tickers$clone(deep = FALSE)
deepWhether to make a deep clone.
Other historical data:
Indice-class,
Ticker-class,
yf_download_prices(),
yf_get_index_quotes()
## Not run:
# Initialize for a set of tech stocks
stocks <- Tickers$new(c("AAPL", "MSFT", "GOOGL"))
# 1. Get 1 month of historical daily prices
hist_data <- stocks$get_history(period = "1mo", interval = "1d")
head(hist_data)
# 2. Get current market prices for the group
current_prices <- stocks$regular_market_price
# 3. View recommended related symbols and scores
recs <- stocks$recommendations
# 4. Get technical insights (RSI, Moving Averages)
tech <- stocks$technical_insights
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.