get_and_adjust: Retrieves ticker price histories and applies adjusted values....

Description Usage Arguments Value Examples

View source: R/get_and_adjust.R

Description

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.

Usage

1
2
get_and_adjust(tickers, init_date, switch_date, scorecard_set = c(),
  adjust = TRUE)

Arguments

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

Value

nothing, side effect loads price history to global environment

Examples

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)

greatgray/scorecard documentation built on May 17, 2019, 8:34 a.m.