download_data_stock_prices {tidyfinance} | R Documentation |
Download Stock Data
Description
Downloads historical stock data from Yahoo Finance for given symbols and date range.
Usage
download_data_stock_prices(symbols, start_date = NULL, end_date = NULL)
Arguments
symbols |
A character vector of stock symbols to download data for. At least one symbol must be provided. |
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. |
Value
A tibble containing the downloaded stock data with columns: symbol, date, volume, open, low, high, close, and adjusted_close.
Examples
download_data_stock_prices(c("AAPL", "MSFT"))
download_data_stock_prices("GOOGL", "2021-01-01", "2022-01-01" )
[Package tidyfinance version 0.4.3 Index]