What does Liquidation Cascades and Cointegration conclude, in numbers, about “Practice and a Pre-Registered Test”?
Answer: The meaning of "90 % power" needs stating (consistent with Book 33): it is the probability, when the true difference exactly equals the smallest effect of interest, of reaching some verdict that "the Kalman filter is better"; the strongest verdict in the decision rule, "better by at least 1 percentage point", then has only about a 2.5 % chance. The program below computes all these probabilities.
Scope of the numbers: This book presents mathematical models for teaching and research and is not investment, trading, tax or legal advice; leverage and derivatives can lose all of the money put in and more, and backtests and simulations do not represent future returns. Marked boxes separate published evidence, runnable Python calculations (16 programs, all checked), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.26, 0.78, 1.3, 1.50, 1.7, 35
| 1. leverage and distance to liquidation (long, isolated, m | 0.5 %) |
| distance 6.20% | 1.7 daily sd; P(touch) 1 day 8.1%, 3 days 31.3% |
| -> FLAG (rule: distance > | 3 daily sd) |
| 2. order-book depth and impact cost (square-root rule, Y between 0.5 and 1.5) | |
| order 2.0% of daily volume: impact 0.26% to 0.78% | |
| order / visible depth within 1 % | 1.3x -> FLAG (rule: order <= depth within 1 %) |
| 3. cointegration stability (fictional pair, three 250-day windows) | |
| window 1: EG t | -3.27 (5 % value -3.36), hedge 1.17, half-life 8.0 d -> FLAG |
| window 2: EG t | -3.42 (5 % value -3.36), hedge 1.25, half-life 7.6 d -> ok |
| window 3: EG t | -1.42 (5 % value -3.36), hedge 1.50, half-life 41.3 d -> FLAG |
| 4. hedge-ratio update and exits | |
| hedge ratio moved +9.2% since entry -> FLAG: re-hedge or close | |
| held 35 days vs time stop 3 x half-life | 27 days -> FLAG: close |
| stop at |z| > 4 written down before entry: yes |
Show the full program
# Four-step checklist applied to a FICTIONAL book: one leveraged perpetual long and one
# pairs position. All numbers invented; thresholds are the author's illustrative choices.
import math, random
from statistics import NormalDist
N = NormalDist(); rng = random.Random(39)
print("1. leverage and distance to liquidation (long, isolated, m = 0.5 %)")
L, m, vol = 15, 0.005, 0.70 # leverage, maintenance rate, annual vol
dist = 1 - (1 - 1 / L) / (1 - m); sd1 = vol / math.sqrt(365)
p1 = 2 * N.cdf(math.log(1 - dist) / sd1)
p3 = 2 * N.cdf(math.log(1 - dist) / (sd1 * 3 ** .5))
print(f" distance {dist:.2%} = {dist / sd1:.1f} daily sd; P(touch) 1 day {p1:.1%},"
f" 3 days {p3:.1%}")
print(f" -> {'FLAG' if dist / sd1 < 3 else 'ok'} (rule: distance >= 3 daily sd)")
print("2. order-book depth and impact cost (square-root rule, Y between 0.5 and 1.5)")
Q, V, depth1 = 4e6, 2e8, 3e6 # order, daily volume, visible depth within 1 %
lo, hi = (Y * sd1 * math.sqrt(Q / V) for Y in (0.5, 1.5))
print(f" order {Q / V:.1%} of daily volume: impact {lo:.2%} to {hi:.2%}")
print(f" order / visible depth within 1 % = {Q / depth1:.1f}x"
f" -> {'FLAG' if Q > depth1 else 'ok'} (rule: order <= depth within 1 %)")
print("3. cointegration stability (fictional pair, three 250-day windows)")
def eg_t(y, x): # Engle-Granger, no augmentation lag
n = len(x); mx, my = sum(x) / n, sum(y) / n
b = sum((u - mx) * (v - my) for u, v in zip(x, y)) / sum((u - mx) ** 2 for u in x)
e = [v - (my - b * mx) - b * u for u, v in zip(x, y)]
d = [e[i] - e[i - 1] for i in range(1, n)]
g = sum(a * c for a, c in zip(e[:-1], d)) / sum(a * a for a in e[:-1])
r = [c - g * a for a, c in zip(e[:-1], d)]
se = math.sqrt(sum(v * v for v in r) / (n - 2) / sum(a * a for a in e[:-1]))
hl = math.log(2) / -math.log(1 + g) if -1 < g < 0 else float("inf")
return g / se, b, hl
x, s, xs, ys = 50.0, 0.0, [], []
for t in range(750):
x += rng.gauss(0, 1)
s = (s + rng.gauss(0, 0.3)) if t >= 500 else 0.93 * s + rng.gauss(0, 0.37)
xs.append(x); ys.append(1.2 * x + s)
for k in range(3):
tt, b, hl = eg_t(ys[250 * k:250 * (k + 1)], xs[250 * k:250 * (k + 1)])
print(f" window {k + 1}: EG t = {tt:6.2f} (5 % value -3.36), hedge {b:.2f},"
f" half-life {hl:5.1f} d -> {'ok' if tt < -3.36 else 'FLAG'}")
print("4. hedge-ratio update and exits")
b_entry, b_now, hl_est, held = 1.20, 1.31, 9.0, 35
print(f" hedge ratio moved {b_now / b_entry - 1:+.1%} since entry"
f" -> {'FLAG: re-hedge or close' if abs(b_now / b_entry - 1) > 0.05 else 'ok'}")
print(f" held {held} days vs time stop 3 x half-life = {3 * hl_est:.0f} days"
f" -> {'FLAG: close' if held > 3 * hl_est else 'ok'}")
print(" stop at |z| > 4 written down before entry: yes")Single source and citation
Fan, Y. (2026). Liquidation Cascades, Order-Book Depth Depletion and Cointegrated Statistical Arbitrage (Version 1.0.0), Chapter 8: Practice and a Pre-Registered Test. 5D Library. https://doi.org/10.5281/zenodo.23796776
DOI: 10.5281/zenodo.23796776 · Read the monograph · 5DL-B-039 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026039,
author = {Fan, Yafu},
title = {Liquidation Cascades, Order-Book Depth Depletion and Cointegrated Statistical Arbitrage},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.23796776},
url = {https://doi.org/10.5281/zenodo.23796776}
}Other chapter answers in this book
- Chapter 1 · Order-Book Depth and Price Impact
- Chapter 2 · Perpetual Contracts, Funding and Forced Liquidation
- Chapter 3 · Liquidation Cascades, Branching Processes and Hawkes Self-Exciting Point Processes
- Chapter 4 · The Ornstein–Uhlenbeck Process: Mean Reversion and Its Estimation
- Chapter 5 · Cointegration, Pairs Trading and Broken Relationships
- Chapter 6 · The Kalman Filter and Dynamic Hedge Ratios