Tstar_tib: Tstar index for Tick Imbalance Bars (bar_tib)

Description Usage Arguments Value Author(s) Examples

View source: R/bars.R

Description

Tstar index for Tick Imbalance Bars (bar_tib)

Usage

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

Arguments

dat

dat input with at least the following columns: Price

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_t

Value

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

Author(s)

Larry Lei Hua

Examples

1
2
3
4
5
set.seed(1)
dat <- data.frame(Price = c(rep(0.5, 4), runif(1000)))
T_tib <- Tstar_tib(dat)
b_t <- imbalance_tick(dat)
cumsum(b_t)[cumsum(T_tib)] # check the accumulated b_t's where the imbalances occur

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