Companion demo to On a Simple Relationship Between Order Imbalance, Skew and Width in Over-The-Counter Trading (Cotton; work completed around 2015).
A dealer faces sealed-bid enquiries that are sellers with probability q and buyers with probability 1−q. The theorem states that the imbalanced problem is the balanced one in disguise: solve the balanced problem with carrying cost multiplied by M(q) = 1/(2√(q(1−q))), tilt the indifference cost by δ = (w/2) log(q/(1−q)) per unit, and widen the non-discretionary width by γ. Below, both problems are solved numerically and independently. The dots land on the line; that coincidence is the theorem.
The skew no longer vanishes at zero inventory: S(0) = δ. A dealer with a flat book still shades her quotes toward the flow. Inventory dependence, the slope of the curve, is inherited entirely from the balanced problem at the multiplied carrying cost.
Near balance the skew shift is linear in the imbalance while the widening is quadratic, which is why practitioners skew before they widen. The vertical hairline marks the current slider value of q.
Model and solver: exponential best-competitor with width w = 1, grid x = −10…10, Levenberg–Marquardt on the steady-state consistency equation (mm_core.js). Source: github.com/microprediction/inventory.