Learn R Programming

lares (version 5.1.0)

stocks_quote: Download Stocks Historical and Current Values

Description

This function lets the user download stocks live data.

This function lets the user download stocks historical data.

Usage

stocks_quote(symbols)

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

# S3 method for stocks_hist plot(x, type = 1, ...)

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)

cache

Boolean. Use daily cache if available?

quiet

Boolean. Keep quiet? If not, informative messages will be printed.

...

Additional parameters

x

stocks_hist object

type

Integer. Select type of plot.

Value

data.frame with Symbol, Type of stock, Quote time, current value, Daily Change, Market, and Symbol Name.

See Also

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

Other Scrapper: filesGD(), get_mp3(), gtrends_related(), holidays(), ip_data(), readGS(), splot_etf()

Examples

Run this code
# NOT RUN {
# Multiple quotes at the same time
stocks_quote(c("VTI", "VOO", "TSLA"))
# }
# NOT RUN {
df <- stocks_hist(symbols = c("VTI", "FB", "FIW"), from = Sys.Date() - 180)
print(head(df))
plot(df)
# }

Run the code above in your browser using DataLab