Estimating Tick Imbalance Bar Thresholds and Initial Values
Summary
The document introduces tick imbalance bars, which group market ticks until the cumulative signed tick count crosses a threshold based on its expected magnitude. Tick direction is assigned by the tick rule: price upticks are buys, downticks are sells, and unchanged prices inherit the previous tick’s sign. The threshold uses an expected bar length and an estimate of directional imbalance, with both quantities described as exponentially weighted averages of prior bars or ticks.
The author asks how to initialize these estimates before any prior bars exist and whether the expected bar length determines bar size. The included answer does not resolve those implementation questions; it points readers to an open source project’s code and related discussions as practical examples. Thus the document outlines the bar construction concept but offers limited guidance on startup choices, parameter settings, or performance evidence.
Key ideas
- Tick imbalance bars close when cumulative signed tick flow reaches an expectation-based threshold.
- The tick rule carries the last nonzero price direction forward across unchanged prices.
- Threshold estimation uses expected bar length and expected directional imbalance from prior observations.
- The document leaves initialization of the estimates unanswered and directs readers to implementation examples.
Tags
Full text
# Tick Imbalance Bars - clarification on T index
# Tick Imbalance Bars - clarification on T index
I have been trying to learn quant related things on my own. I recently picked up a book called "Advances in Financial Machine Learning" by Marcos Lopez De Prado. I am having difficulty understanding some of the concepts in the book. I will explain whats written in the book followed my interpretation. Please let me know if I am right or wrong.
From textbook:
> Consider a sequence of ticks {($p_t,v_t$)}$_{t=1,..,T}$, where $p_t$ is the price associated with t and $v_t$ is the volume associated with tick t. The so-called tick rule defines a sequence {$b_t$}$_{t=1,...,T}$ where $b_t=\begin{cases}b_{t-1}, & \text{if}\ \Delta p_t = 0 \\ \frac{|\Delta p_t|}{\Delta p_t} ,& \text{if} \Delta p_t \neq 0 \end{cases}---(1)$ with $b_t\in${-1,1}, and the boundary condition $b_0$ is set to match the terminal value $b_T$ from the immediately preceding bar. The idea behind tick imbalance bars (TIBs) is to sample bars whenever tick imbalances exceed our expectations. We wish to determine the tick index, T, such that the accumulation of signed ticks (signed according to the tick rule) exceeds a given threshold. Next, let us discuss the procedure to determine T. First we define the tick imbalance at time T as $\theta_T = \sum_{t = 1}^{T}b_t---(2)$ Second, we compute the expected value of $\theta_T$ at the beginning of the bar, $E_o[T] = E_0[T](P[b_t = 1]-P[b_t = -1]---(3)$, where $E_0[T]$ is expected size of the tick bar, $P[b_t=1]$ is the unconditional probability that a tick is classified as a buy, $P[b_t = -1]$ is unconditional probability that a tick is classified as a sell. Since $P[b_t = 1] + P[b_t = -1] = 1$, then $E_0[\theta_T] = E_0[T](2P[b_t = 1] - 1)$. In practice we can estimate $E_0[T]$ as an exponentially weighted moving average of T values from prior bars, and ($2P[b_t = 1] - 1$) as an exponentially weighted moving average of $b_t$ values from prior bars. Third, we deine a tick imbalance bar (TIB) as a $T^*$ - contiguous subset of ticks such that the following condition is met: $T^* = \underset{T}{Argmin} (|\theta_T| \geq E_0[T]|2P[b_t = 1] - 1) ---(4)$
Question/Clarification:
- My understanding is that first we create $b_t$ matrix. Then we use equation (3) to understand the size of number of ticks in a bar (correct?)
- $E_0[T]$ is exponentially weighted average of T, how do we calculate the first $E_0[T]$ when we dont have record of any previous T?
- Similar to question 2, ($2P[b_t = 1] - 1$) how is the first weighted average of $b_t$ prior bar is cacluated?
I am trying to learn this on my own, I apologize in advance if I had made any mistakes or broke the community rules. If you can suggest me a place to learn these all, I would really appreciate it
## Answer by babelproofreader (score 3)
https://quant.stackexchange.com/a/44759
There is an open source hedge fund project which is implementing the ideas contained in the book and which has a github where you can see their code implementation of tick bars. Personally I always find it extremely enlightening to see code rather than mathematical symbolism, and maybe this will be the same for you. On the linked pages there are also links to discussion pages etc. which you might also find useful.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.