get_ochlav: Get Securities Price and Volume Data

Description Usage Arguments Value Examples

View source: R/Symbols.R

Description

Wrapper function to get historical security prices for 1 or more symbols. Function uses getSymbol function from quantmod package. Returns Open, Close, High, Low, Adj Close, and Volume

Usage

1
2
get_ochlav(symbols, start_date = "1990-01-01", end_date = Sys.Date(),
  error_handling = "pass", warning = FALSE)

Arguments

symbols

vector of stock symbol characters. can be 1 or more

start_date

starting date for historical prices. default is '1990-01-01'. Y-m-d format required

end_date

ending date for historical prices. default is current date. Y-m-d format required

error_handling

option to handle errors within foreach loop. options are 'pass', 'remove', or 'stop'

warning

logical argument to print getSymbol warnings to console

Value

tibble with symbol historical prices. schema is date, symbol, open, close, high, low, adj_close, volume

Examples

1
2
3
4
library(tidyverse)
library(quantmod)
symbols <- c("spy", "tlt")
sym_data <- symbols %>% get_ochlav(.)

chrishaarstick/madstork documentation built on Jan. 3, 2022, 8:34 p.m.