How long runs of same-side trades last and how often the side flips.
Consecutive same-direction trade run lengths, imbalance, flip rate, and price change on direction flip.
All 11,692 trades from 14:38 to 14:39 UTC on 11 June 2025, Binance BTC-USDT perpetual, from the free raw-trades preview.
Step 1
A run is a streak of consecutive trades with the same taker side. This minute had 1,200 runs, 600 of taker sells and 600 of taker buys.
Step 2
The longest, 339 taker sells in a row, started at 14:38:19.1. The price moved -1.36 bps from its first trade to its last.
Step 3
Step 4
BTC-USDT perpetual on Binance, 5m bars, 1 to 31 May 2025, from the free preview.
Bars by flip rate, fewest flips to most. Basis points.
Sorted by flip rate, the tenth of bars with the fewest flips had a median move of 8.37 bps, the tenth with the most 3.02 bps. Across all bars, flip rate and the size of the move correlated -0.27. The median bar flipped side on 10.9% of its trades.
The longest run in a typical bar was 342 trades in a row on one side, and the longest in May 5,482.
A run is a streak of consecutive trades on the same side. buy_run_max_len and sell_run_max_len are the longest streaks in the bar, the _mean_len fields their averages.
flip_rate is the share of trades that switched side from the one before. Near 1, buys and sells alternate. Low means one side kept trading.
run_imbalance compares buy runs with sell runs, from -1 to 1. price_change_on_flip is the average price move when the side flipped.
Here's a microstructure concept that rarely gets discussed outside market-making desks: trade runs — consecutive sequences of same-direction trades. Their statistical properties reveal the hidden structure of order flow in ways that aggregate volume metrics completely miss.
Lillo & Farmer (2004) made a striking empirical discovery: order flow in equity markets exhibits long-range autocorrelation, with a Hurst exponent significantly above 0.5. Buys tend to follow buys, and sells follow sells, at horizons far longer than can be explained by individual order splitting. They attributed this to the herding behavior of institutional investors and the mechanical persistence of algorithmic execution.
Earlier, Hasbrouck (1991) showed that the autocorrelation structure of trade signs (buy/sell sequences) carries information about the permanent price impact of trades. Trades that cluster into runs tend to have higher permanent impact than isolated trades — because runs are the signature of informed order flow that the market hasn't yet fully absorbed.
Bouchaud et al. (2004) formalized this in their propagator model, showing that the long memory of order flow, combined with a power-law decay in individual trade impact, produces a market that is approximately efficient despite highly predictable order flow.
The flip rate is directly related to the Roll (1984) model of the bid-ask bounce: in a pure noise-trading world with constant spreads, every trade should alternate between bid and ask, producing a flip rate near 1.0 and negative first-order return autocorrelation exactly equal to the squared half-spread. Deviations from this benchmark — particularly low flip rates — indicate that something beyond the mechanical bid-ask bounce is driving the tape.
Run imbalance is particularly powerful: if buy runs average 8 trades but sell runs average 3, buyers are sustaining pressure longer. This asymmetry often precedes continued price movement — it's the microstructure expression of the order flow autocorrelation that Lillo & Farmer documented at daily horizons, compressed into intrabar timescales.
References:
# Install the Aperiodic CLI into ~/.local/bin
mkdir -p "$HOME/.local/bin"
curl -fsSL https://raw.githubusercontent.com/aperiodic-io/cli/main/install.sh | INSTALL_DIR="$HOME/.local/bin" bash
export PATH="$HOME/.local/bin:$PATH"
# Free preview — no API key required
aperiodic run_structure --preview \
--exchange binance-futures \
--symbol perpetual-BTC-USDT:USDT \
--interval 5m \
--timestamp exchange \
--start-date 2025-05-01 \
--end-date 2025-05-31 \
--output-dir ./data && echo "Saved to $PWD/data"