save_rets: Load, scrub, aggregate, and rbind multiple days of _TAQ_ data...

View source: R/HighFreq.R

save_retsR Documentation

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.

Description

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.

Usage

save_rets(
  symbol,
  dirin = "E:/mktdata/sec/",
  dirout = "E:/output/data/",
  lookb = 51,
  volm = 2,
  period = "minutes",
  tzone = "America/New_York"
)

Details

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.

Value

A time series of returns and volume in xts format.

Examples

## Not run: 
save_rets("SPY")

## End(Not run)


algoquant/HighFreq documentation built on June 10, 2025, 3:54 p.m.