Class BookAnalytics
java.lang.Object
com.quantfinlib.orderbook.BookAnalytics
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult of simulating a sweep: what a marketable order of that size would pay. -
Method Summary
Modifier and TypeMethodDescriptionstatic longdepthWithinBps(OrderBook book, Side side, double bps) Resting quantity on a side priced withinbpsof the mid.static doubleDepth imbalance in [-1, 1] over the toplevels: +1 = all bid.static doublemicroprice(double bid, double ask, double bidSize, double askSize) static doublemicroprice(OrderBook book) Size-weighted microprice:I*ask + (1-I)*bidwithI = bidSize / (bidSize + askSize)— a better short-horizon fair value than the mid when the book is imbalanced.static doublestatic BookAnalytics.SweepResultSimulates (without mutating the book) sweepingquantitywith a marketable order ontakerSide: returns achievable fill, VWAP fill price, and impact versus the pre-sweep mid.
-
Method Details
-
spreadBps
-
microprice
Size-weighted microprice:I*ask + (1-I)*bidwithI = bidSize / (bidSize + askSize)— a better short-horizon fair value than the mid when the book is imbalanced. -
microprice
public static double microprice(double bid, double ask, double bidSize, double askSize) -
imbalance
Depth imbalance in [-1, 1] over the toplevels: +1 = all bid. -
depthWithinBps
-
sweep
Simulates (without mutating the book) sweepingquantitywith a marketable order ontakerSide: returns achievable fill, VWAP fill price, and impact versus the pre-sweep mid.
-