Class PovTracker
java.lang.Object
com.quantfinlib.execution.PovTracker
POV (percentage-of-volume) execution tracker: the streaming counterpart of
the precomputed
TwapScheduler/VwapScheduler schedules.
POV cannot be prescheduled — 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 target is executed ≈ participation × marketVolume, where
marketVolume excludes our own fills (participation is measured
against other people's trading, else the algo chases itself:
p/(1+p) instead of p). Child sizes are clamped to
[minSlice, maxSlice] — the minimum suppresses dribble orders, the
maximum caps signaling risk.
Primitives only, zero allocation, single-writer.
-
Constructor Summary
ConstructorsConstructorDescriptionPovTracker(long parentQty, double participation, long minSlice, long maxSlice) -
Method Summary
Modifier and TypeMethodDescriptionbooleandone()longShares to send now to restore the target participation: the behind- schedule quantity, clamped to the slice bounds and the parent remainder.longexecuted()longvoidonExecuted(long qty) Our own child fill (do not also feed it toonMarketVolume(long)).voidonMarketVolume(long qty) A market trade print that was NOT our fill.doubleRealized participation so far vs other-flow volume (NaN before any print).long
-
Constructor Details
-
PovTracker
public PovTracker(long parentQty, double participation, long minSlice, long maxSlice) - Parameters:
parentQty- total shares to executeparticipation- target participation rate 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 toonMarketVolume(long)). -
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 withinminSliceof schedule (or when done) — poll it on every print, act when it's positive. -
realizedParticipation
public double realizedParticipation()Realized participation so far vs other-flow volume (NaN before any print). -
executed
public long executed() -
remaining
public long remaining() -
marketVolume
public long marketVolume() -
done
public boolean done()
-