bar_tick_runs: Construct tick runs bars

Description Usage Arguments Value Author(s) Examples

View source: R/bars.R

Description

Construct tick runs bars

Usage

1
bar_tick_runs(dat, w0 = 10, de = 1, bkw_T = 5, bkw_Pb1 = 5, filter = FALSE)

Arguments

dat

dat input with at least the following column: Price, Size

w0

the expected time window length of the first bar

de

a positive value for adjusting the expected window size, that is, de*E0T; default: 1

bkw_T

backward window length when using exponentially weighted average T

bkw_Pb1

backward window length when using exponentially weighted average P[b_t=1]

filter

whether used as a filter; default FALSE. If TRUE, then only i_feabar, the ending time index of feature bars, is returned

Value

If filter==FALSE, a list of vectors for tStamp (if returned), and HLOCV of tick runs bars. Note that the remaining data after the latest ending time point detected will be formed as a bar. If filter==TRUE, i_feabar a vector of integers for the time index.

Author(s)

Larry Lei Hua

Examples

1
2
3
4
set.seed(1)
dat <- data.frame(Price = c(rep(0.5, 4), runif(1000)), Size = rep(10,1004))
x1 <- bar_tick_runs(dat)
x2 <- bar_tick_runs(dat, filter=TRUE)

larryleihua/fmlr documentation built on Jan. 31, 2020, 8:55 a.m.