Meridian’s imbalance bars use signed price-tick direction and an adaptive threshold.
Tick direction
For each aggTrade price:
price increased → +1
price decreased → -1
price unchanged → carry the previous non-zero direction
The processor maintains an exponentially weighted average of tick signs:
alpha = 2 / (expected_ticks_per_bar + 1)
ema_tick_signs = alpha × tick + (1 - alpha) × previous_ema
Adaptive close threshold
After the warmup period, each signed tick is added to cumulative imbalance. The current threshold is:
dynamic_threshold = max(
expected_ticks_per_bar × abs(ema_tick_signs),
expected_ticks_per_bar × min_threshold_fraction
)
The bar closes when:
abs(cumulative_imbalance) >= dynamic_threshold
Parameters
| Parameter | Meaning |
|---|
expected_ticks_per_bar | Baseline expected bar length and EMA span |
warmup_ticks | Initial ticks used to establish directional expectation |
min_threshold_fraction | Lower bound preventing a zero or near-zero threshold |
Warmup defaults to expected_ticks_per_bar. No imbalance bar is emitted during warmup.
Continuous state
The checkpoint stores the EMA, cumulative imbalance, global tick counter, previous price and direction, pending trades, and emitted sequence. This prevents archive boundaries and process restarts from changing future bars.
The adaptive threshold is a sampling rule, not a directional forecast. Positive or negative ending imbalance does not by itself constitute a trading signal.