Learn R Programming

lares (version 4.8.4)

stocks_hist: Download Stocks Historical Data

Description

This function lets the user download stocks historical data

Usage

stocks_hist(
  symbols = c("VTI", "TSLA"),
  from = Sys.Date() - 365,
  to = Sys.Date(),
  today = TRUE,
  tax = 30,
  parg = FALSE,
  verbose = TRUE
)

Arguments

symbols

Character Vector. List of symbols to download historical data

from, to

Date. Dates for range. If not set, 1 year will be downloaded. Do use more than 4 days or will be over-written.

today

Boolean. Do you wish to add today's live quote? This will happen only if to value is the same as today's date

tax

Numeric. How much [0-99] of your dividends are gone with taxes?

parg

Boolean. Personal argument. Used to personalize stuff, in this case, taxes changed from A to B in given date (hard-coded)

verbose

Boolean. Print results and progress while downloading?

See Also

Other Investment: daily_portfolio(), daily_stocks(), etf_sector(), splot_change(), splot_etf(), splot_growth(), splot_roi(), splot_summary(), splot_types(), stocks_file(), stocks_obj(), stocks_quote(), stocks_report()

Examples

Run this code
# NOT RUN {
df <- stocks_hist(symbols = c("VTI", "FB"), from = Sys.Date() - 7)
head(df)
# }

Run the code above in your browser using DataLab