Tstar_vib: Tstar index for Volume Imbalance Bars (bar_vib)

Description Usage Arguments Value Author(s) Examples

View source: R/bars.R

Description

Tstar index for Volume Imbalance Bars (bar_vib)

Usage

1
Tstar_vib(dat, w0 = 10, bkw_T = 5, bkw_b = 5)

Arguments

dat

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

w0

the expected time window length of the first bar

bkw_T

backward window length when using exponentially weighted average T

bkw_b

backward window length when using exponentially weighted average b_tv_t

Value

a vector for the lengths of the tick imbalance bars. For example, if the return is c(10,26), then the 2 tick imbalance bars are (0,10] and (10, 36]

Author(s)

Larry Lei Hua

Examples

1
2
3
4
5
set.seed(1)
dat <- data.frame(Price = c(rep(0.5, 4), runif(50)), Size = rep(10,54))
T_vib <- Tstar_vib(dat)
b_tv_t <- imbalance_volume(dat)
cumsum(b_tv_t)[cumsum(T_vib)] # check the accumulated b_tv_t's where the imbalances occur

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