| save_rets | R Documentation |
*.RData’ file.Load, scrub, aggregate, and rbind multiple days of TAQ data for a
single symbol. Calculate the returns and save them to a single
‘*.RData’ file.
save_rets(
symbol,
dirin = "E:/mktdata/sec/",
dirout = "E:/output/data/",
lookb = 51,
volm = 2,
period = "minutes",
tzone = "America/New_York"
)
The function save_rets loads multiple days of TAQ
data, then scrubs, aggregates, and rbinds them into a OHLC time
series. It then calculates returns using function ohlc_returns(), and
stores them in a variable named ‘symbol.rets’, and saves them
to a file called ‘symbol.rets.RData’.
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.
A time series of returns and volume in xts format.
## Not run:
save_rets("SPY")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.