Class PovTracker

java.lang.Object
com.quantfinlib.execution.PovTracker

public final class PovTracker extends Object
POV (percentage-of-volume) execution tracker: the streaming counterpart of the precomputed TwapScheduler/VwapScheduler schedules. POV cannot be prescheduled because it chases realized market volume, so this class maintains the participation ledger live: feed it market prints and own fills, and it answers "how many shares am I allowed to send right now" (dueQuantity()).

The participation rate p is a share of total traded volume, ours included (the industry definition). With V the volume printed by others (onMarketVolume(long), which must exclude our fills), executing x gives a share x / (x + V); solving x / (x + V) = p gives the target x = p / (1 - p) * V. The naive target p * V realises only p / (1 + p).

Sent-but-unfilled children count against the target: report them with onChildSent(long) and their unfilled remainders with onChildDone(long), so a resting child is not re-sent. Child sizes are clamped to [minSlice, maxSlice]: the minimum suppresses dribble orders, the maximum caps signalling.

Primitives only, zero allocation, single-writer.

  • Constructor Details

    • PovTracker

      public PovTracker(long parentQty, double participation, long minSlice, long maxSlice)
      Parameters:
      parentQty - total shares to execute
      participation - target share of total volume in (0, 1), e.g. 0.1 = 10%
      minSlice - smallest child worth sending (0 = no minimum)
      maxSlice - largest child ever sent (caps information leakage)
  • Method Details

    • onMarketVolume

      public void onMarketVolume(long qty)
      A market trade print that was not our fill.
    • onExecuted

      public void onExecuted(long qty)
      Our own child fill (do not also feed it to onMarketVolume(long)).
    • onChildSent

      public void onChildSent(long qty)
      A child of qty was sent and is working.
    • onChildDone

      public void onChildDone(long unfilledQty)
      A child ended with unfilledQty never executed.
    • openQuantity

      public long openQuantity()
      Sent child quantity not yet filled or reported done.
    • targetQuantity

      public long targetQuantity()
      Target executed quantity for the volume seen so far: p / (1 - p) * V.
    • dueQuantity

      public long dueQuantity()
      Shares to send now to restore the target participation: the behind- schedule quantity, clamped to the slice bounds and the parent remainder. Returns 0 while within minSlice of schedule (or when done) — poll it on every print, act when it's positive.
    • realizedParticipation

      public double realizedParticipation()
      Realised share of total volume, executed / (executed + V); NaN before any volume.
    • executed

      public long executed()
    • remaining

      public long remaining()
    • marketVolume

      public long marketVolume()
    • done

      public boolean done()