Class FillProbabilityModel

java.lang.Object
com.quantfinlib.microstructure.FillProbabilityModel

public final class FillProbabilityModel extends Object
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:
  1. The price reaches the level — under a driftless diffusion with volatility σ, the probability the price travels a distance d within horizon T is the reflection-principle barrier-touch probability 2·Φ(−d/(σ√T)) (1 when you're already at/through the level);
  2. The queue at the level clears to youQueueModel'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 Type
    Method
    Description
    static double
    passiveFillProbability(double distance, double volPerSqrtSecond, double horizonSeconds, double price, long qtyAhead, long orderQty, double expectedTradedQty)
    Probability a passive order distance from the current price fills within the horizon: touch × queue-clear (independence approximation, mildly conservative — see the class doc).
    static double
    touchProbability(double distance, double volPerSqrtSecond, double horizonSeconds, double price)
    Probability the price touches a level distance away (in price units, ≥ 0) within horizonSeconds, given volatility volPerSqrtSecond (return per √second) at price. 1 at/through the level; 0 for degenerate inputs (no vol, no time, no price — a dead market never reaches anything).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • touchProbability

      public static double touchProbability(double distance, double volPerSqrtSecond, double horizonSeconds, double price)
      Probability the price touches a level distance away (in price units, ≥ 0) within horizonSeconds, given volatility volPerSqrtSecond (return per √second) at price. 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 order distance from 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 (from L3BookBuilder.sharesAhead, QueuePositionEstimator, or displayed size before joining)
      orderQty - our order size
      expectedTradedQty - volume expected to execute at the level over the horizon (e.g. from VolumeCurve)