download_data_stocks {tidyfinance}R Documentation

Download Stock Data

Description

Downloads historical stock data for a given symbol and date range from specified sources.

Usage

download_data_stocks(type, start_date, end_date, symbols)

Arguments

type

A character string representing the data source type. Currently supported type is "stocks_yf" for Yahoo Finance. Defaults to "stocks_yf".

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 depending on the data source.

Examples

## Not run: 
download_data_stocks(type = "stocks_yf", symbols = c("AAPL", "MSFT"))

## End(Not run)

[Package tidyfinance version 0.3.0 Index]