| save_scrub_agg | R Documentation |
*.RData’ file.Load, scrub, aggregate, and rbind multiple days of TAQ data for a
single symbol, and save the OHLC time series to a single
‘*.RData’ file.
save_scrub_agg(
symbol,
dirin = "E:/mktdata/sec/",
dirout = "E:/output/data/",
lookb = 51,
volm = 2,
period = "minutes",
tzone = "America/New_York"
)
symbol |
A character string representing symbol or ticker. |
dirin |
A character string representing directory
containing input ‘ |
dirout |
A character string representing directory
containing output ‘ |
The function save_scrub_agg() loads multiple days of
TAQ data, then scrubs, aggregates, and rbinds them into a
OHLC time series, and finally saves it to a single
‘*.RData’ file. The OHLC time series is stored in a
variable named ‘symbol’, and then it's saved to a file named
‘symbol.RData’ in the ‘dirout’ directory.
The TAQ data files are assumed to be stored in separate directories
for each ‘symbol’. Each ‘symbol’ has its own
directory (named ‘symbol’) in the ‘dirin’
directory. Each ‘symbol’ directory contains multiple daily
‘*.RData’ files, each file containing one day of TAQ
data.
An OHLC time series in xts format.
## Not run:
# set data directories
dirin <- "C:/Develop/data/hfreq/src/"
dirout <- "C:/Develop/data/hfreq/scrub/"
symbol <- "SPY"
# Aggregate SPY TAQ data to 15-min OHLC bar data, and save the data to a file
save_scrub_agg(symbol=symbol, dirin=dirin, dirout=dirout, period="15 min")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.