get_from: Get first or last date for which there are data stored on...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/get_from.R

Description

Get first or last date for which there are data stored on disk

Usage

1
2
3
4
5
get_from(Symbol, base_dir = "/mnt/W/TRADES", maxDays = 365,
  use_identifier = FALSE, ...)

get_to(Symbol, base_dir = "/mnt/W/TRADES", maxDays = 365,
  use_identifier = FALSE, ...)

Arguments

Symbol

name of instrument

base_dir

directory that has subdirectories for all of your Symbols (where each subdirectory contains data files named ).

maxDays

if there are no data for Symbol stored on disk, get_from and get_to will return today's date minus maxDays.

use_identifier

if not FALSE Symbol will become getInstrument(Symbol, ...)$identifiers[[use_identifier]]

...

anything to pass through to getInstrument. Only used if use_identifier is not FALSE

Details

Data should be stored as follows: There should be a directory under base_dir named the same as Symbol that contains a separate data file for each day. The data file names should begin with "%Y.%m.%d". ("2011.07.05.SPY.RData", for example).

Value

character string of format "%Y-%m-%d" representing the first date for which there is data stored in base_dir. If there are no data for Symbol then the date returned will be today's date minus maxDays

Author(s)

Garrett See

See Also

saveSymbols.days to save data the way this function expects it to be saved.

Examples

1
get_from("SPY")

twsInstrument documentation built on May 2, 2019, 5:24 p.m.