Class FillProbabilityModel
java.lang.Object
com.quantfinlib.microstructure.FillProbabilityModel
Passive-fill probability for a limit order resting AWAY from the touch —
the placement question
QueueModel alone can't answer. A resting
order fills only if two things happen:
- The price reaches the level — under a driftless diffusion
with volatility σ, the probability the price travels a distance
dwithin horizonTis the reflection-principle barrier-touch probability2·Φ(−d/(σ√T))(1 when you're already at/through the level); - The queue at the level clears to you —
QueueModel's territory:P = exp(−(qtyAhead + qty)/expectedTraded).
passiveFillProbability(double, double, double, double, long, long, double) composes the two under an independence
approximation — documented honestly: touch and queue-clearing are
positively correlated (the flow that moves price also eats queues), so
the composition is a mild UNDERestimate; treat it as a conservative
placement score, not a calibrated probability.
Volatility enters as return-per-√second (what
SignalEngine.volPerSqrtSecond emits), converted to price units
against the current price. Static, cross-asset, zero allocation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublepassiveFillProbability(double distance, double volPerSqrtSecond, double horizonSeconds, double price, long qtyAhead, long orderQty, double expectedTradedQty) Probability a passive orderdistancefrom the current price fills within the horizon: touch × queue-clear (independence approximation, mildly conservative — see the class doc).static doubletouchProbability(double distance, double volPerSqrtSecond, double horizonSeconds, double price) Probability the price touches a leveldistanceaway (in price units, ≥ 0) withinhorizonSeconds, given volatilityvolPerSqrtSecond(return per √second) atprice. 1 at/through the level; 0 for degenerate inputs (no vol, no time, no price — a dead market never reaches anything).
-
Method Details
-
touchProbability
public static double touchProbability(double distance, double volPerSqrtSecond, double horizonSeconds, double price) Probability the price touches a leveldistanceaway (in price units, ≥ 0) withinhorizonSeconds, given volatilityvolPerSqrtSecond(return per √second) atprice. 1 at/through the level; 0 for degenerate inputs (no vol, no time, no price — a dead market never reaches anything). -
passiveFillProbability
public static double passiveFillProbability(double distance, double volPerSqrtSecond, double horizonSeconds, double price, long qtyAhead, long orderQty, double expectedTradedQty) Probability a passive orderdistancefrom the current price fills within the horizon: touch × queue-clear (independence approximation, mildly conservative — see the class doc).- Parameters:
qtyAhead- shares ahead in the queue at the level (fromL3BookBuilder.sharesAhead,QueuePositionEstimator, or displayed size before joining)orderQty- our order sizeexpectedTradedQty- volume expected to execute at the level over the horizon (e.g. fromVolumeCurve)
-