Building a Linear Order Book Imbalance Strategy with Tick Replay
Summary
This tutorial uses historical tick-level replay to explore order book imbalance and develop a simple short-horizon crypto strategy. It describes replaying market data at adjustable speeds, inspecting trades and multiple levels of depth, and using replay as a way to study market behavior outside exchange hours. The proposed signal compares weighted bid and ask quantities: levels nearer the best quotes receive greater weight, and a second linear weighting smooths the ratio across recent ticks. Thresholds then govern simulated entry and exit decisions.
The example is based on replaying one month of Bitcoin trading data and observing that displayed depth appeared asymmetric during sharp moves. The author presents the pattern as a source of strategy ideas, not as established predictive evidence. The sample is limited, and the article reports no out-of-sample results, transaction costs, or robust profitability analysis. It also uses a simplified virtual position variable, so actual fills, inventory, and exchange constraints require more complete handling before live use.
Key ideas
- Tick-level replay can help traders inspect historical order book and trade activity at adjustable speeds.
- The example weights depth levels by proximity, giving the best quotes more influence than distant orders.
- It smooths the bid-to-ask quantity ratio over recent ticks before comparing it with entry and exit thresholds.
- The strategy idea comes from an observed association in a month of Bitcoin data, not a validated performance study.
- The simplified virtual position and lack of cost analysis limit conclusions about live execution and profitability.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.