Class QueueModel
java.lang.Object
com.quantfinlib.microstructure.QueueModel
Queue positioning and priority analytics: how position in the price-time
queue — and small latency differences in reaching it — translate into fill
probability.
Model: executed volume at a price level over a horizon is treated as
exponentially distributed with mean expectedTradedQty; an order
fills when cumulative executions reach the quantity ahead of it plus its
own size, giving P(fill) = exp(-(qtyAhead + orderQty) / expectedTradedQty).
A deliberately simple, closed-form model — calibrate expectedTradedQty
from observed level turnover.
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublefillProbability(long qtyAhead, long orderQty, double expectedTradedQty) Probability the order fully fills within the horizon.static doublelatencyFillAdvantage(long qtyAhead, long orderQty, double expectedTradedQty, double joinRateQtyPerSec, long latencyAdvantageNanos) Fill-probability edge from beinglatencyAdvantageNanosfaster to the queue: P(fill | fast arrival) - P(fill | slow arrival).static doublequeueGrowth(double joinRateQtyPerSec, long latencyNanos) Extra quantity that joins the queue ahead of an order arrivinglatencyNanoslater, given the rate at which others join.
-
Method Details
-
fillProbability
public static double fillProbability(long qtyAhead, long orderQty, double expectedTradedQty) Probability the order fully fills within the horizon.- Parameters:
qtyAhead- resting quantity ahead in the queue (seeOrderBook.qtyAhead)orderQty- our order sizeexpectedTradedQty- expected volume to execute at this level over the horizon
-
queueGrowth
public static double queueGrowth(double joinRateQtyPerSec, long latencyNanos) Extra quantity that joins the queue ahead of an order arrivinglatencyNanoslater, given the rate at which others join. -
latencyFillAdvantage
public static double latencyFillAdvantage(long qtyAhead, long orderQty, double expectedTradedQty, double joinRateQtyPerSec, long latencyAdvantageNanos) Fill-probability edge from beinglatencyAdvantageNanosfaster to the queue: P(fill | fast arrival) - P(fill | slow arrival).
-