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,
data_dir = "E:/mktdata/sec/",
output_dir = "E:/output/data/",
look_back = 51,
vol_mult = 2,
period = "minutes",
tzone = "America/New_York"
)
symbol |
A character string representing symbol or ticker. |
data_dir |
A character string representing directory containing
input ‘ |
output_dir |
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 ‘output_dir
’ 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 ‘data_dir
’
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
data_dir <- "C:/Develop/data/hfreq/src/"
output_dir <- "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, data_dir=data_dir, output_dir=output_dir, period="15 min")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.