getSymbols method for loading data from split files

Description

This function should probably get folded back into getSymbols.rda in quantmod.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
getSymbols.FI(Symbols, from = getOption("getSymbols.FI.from", "2010-01-01"),
  to = getOption("getSymbols.FI.to", Sys.Date()), ...,
  dir = getOption("getSymbols.FI.dir", ""),
  return.class = getOption("getSymbols.FI.return.class", "xts"),
  extension = getOption("getSymbols.FI.extension", "rda"),
  split_method = getOption("getSymbols.FI.split_method", c("days", "common")),
  use_identifier = getOption("getSymbols.FI.use_identifier", NA),
  date_format = getOption("getSymbols.FI.date_format"),
  verbose = getOption("getSymbols.FI.verbose", TRUE),
  days_to_omit = getOption("getSymbols.FI.days_to_omit", c("Saturday",
  "Sunday")), indexTZ = getOption("getSymbols.FI.indexTZ", NA))

Arguments

Symbols

a character vector specifying the names of each symbol to be loaded

from

Retrieve data no earlier than this date. Default '2010-01-01'.

to

Retrieve data through this date. Default Sys.Date().

...

any other passthru parameters

dir

if not specified in getSymbolLookup, directory string to use. default ""

return.class

only "xts" is currently supported

extension

file extension, default "rda"

split_method

string specifying the method used to split the files, currently ‘days’ or ‘common’, see setSymbolLookup.FI

use_identifier

optional. identifier used to construct the primary_id of the instrument. If you use this, you must have previously defined the instrument

date_format

format as per the strptime, see Details

verbose

TRUE/FALSE

days_to_omit

character vector of names of weekdays that should not be loaded. Default is c("Saturday", "Sunday"). Use NULL to attempt to load data for all days of the week.

indexTZ

valid TZ string. (e.g. “America/Chicago” or “America/New_York”) See indexTZ.

Details

Meant to be called internally by getSymbols .

The symbol lookup table will most likely be loaded by setSymbolLookup.FI

If date_format is NULL (the Default), we will assume an ISO date as changed by make.names, for example, 2010-12-01 would be assumed to be a file containing 2010.12.01

If indexTZ is provided, the data will be converted to that timezone

If auto.assign is FALSE, Symbols should be of length 1. Otherwise, getSymbols will give you an error that says “must use auto.assign=TRUE for multiple Symbols requests” However, if you were to call getSymbols.FI directly (which is NOT recommended) with auto.assign=FALSE and more than one Symbol, a list would be returned.

Argument matching for this function is as follows. If the user provides a value for an argument, that value will be used. If the user did not provide a value for an argument, but there is a value for that argument for the given Symbol in the Symbol Lookup Table (see setSymbolLookup.FI), that value will be used. Otherwise, the formal defaults will be used.

See Also

saveSymbols.days instrument setSymbolLookup.FI loadInstruments getSymbols

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
getSymbols("SPY", src='yahoo')
dir.create("tmpdata")
saveSymbols.common("SPY", base_dir="tmpdata")
rm("SPY")
getSymbols("SPY", src='FI', dir="tmpdata", split_method='common')
unlink("tmpdata/SPY", recursive=TRUE)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.