download_data_stocks_yf {tidyfinance} | R Documentation |
Download Stock Data from Yahoo Finance
Description
Downloads historical stock data from Yahoo Finance for given symbols and date range.
Usage
download_data_stocks_yf(start_date, end_date, symbols)
Arguments
start_date |
Optional. A character string or Date object in "YYYY-MM-DD" format specifying the start date for the data. If not provided, a subset of the dataset is returned. |
end_date |
Optional. A character string or Date object in "YYYY-MM-DD" format specifying the end date for the data. If not provided, a subset of the dataset is returned. |
symbols |
A character vector of stock symbols to download data for. At least one symbol must be provided. |
Value
A tibble containing the downloaded stock data with columns: symbol, date, volume, open, low, high, close, and adjusted_close.
Examples
## Not run:
download_data_stocks_yf(symbols = c("AAPL", "MSFT"))
download_data_stocks_yf("2021-01-01", "2022-01-01", symbols = "GOOGL")
## End(Not run)
[Package tidyfinance version 0.3.0 Index]