View source: R/download_data_stock_prices.R
| download_data_stock_prices | R Documentation |
Downloads historical stock data from Yahoo Finance for given symbols and date range.
download_data_stock_prices(symbols, start_date = NULL, end_date = NULL)
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 one-year
subset of the dataset is returned (see |
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 one-year
subset of the dataset is returned (see |
A tibble containing the downloaded stock data with columns: symbol, date, volume, open, low, high, close, and adjusted_close.
Other download functions:
download_data(),
download_data_constituents(),
download_data_factors_ff(),
download_data_factors_q(),
download_data_fred(),
download_data_huggingface(),
download_data_jkp(),
download_data_macro_predictors(),
download_data_osap(),
download_data_pastor_stambaugh(),
download_data_risk_free(),
download_data_stambaugh_yuan(),
download_factor_library_grid(),
download_factor_library_ids()
download_data_stock_prices(c("AAPL", "MSFT"))
download_data_stock_prices("GOOGL", "2021-01-01", "2022-01-01" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.