Description Usage Arguments Value Examples
View source: R/get_and_adjust.R
Retrieves ticker price histories and applies adjusted values.
The retrieved histories will be assigned to the global environment.
If the ticker symbol is already available according to the
set of tickers passed in, then take no action. This function
will not add the ticker to the set, so if needed update the set
separately.
Uses quantmod::getSymbols
to fetch by default from Yahoo.
Applies quantmod::adjustOHLC
function if adjusted column available.
Strips price history prior to given switch_date
.
Strips ticker symbol from the resulting xts
column names.
1 2 | get_and_adjust(tickers, init_date, switch_date, scorecard_set = c(),
adjust = TRUE)
|
tickers |
a list of ticker symbols to retrieve |
init_date |
the price history retrieval initial or from date |
switch_date |
the first date to keep in the history |
scorecard_set |
set of tickers to skip, default empty |
adjust |
whether to apply adjusted close value, default TRUE |
nothing, side effect loads price history to global environment
1 2 3 4 5 6 | ## Not run:
library(quantmod)
previous <- c("XLB")
get_and_adjust(c("XLB","XLE"),"2015-01-01","2016-07-01",previous)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.