Class MidPegTracker
java.lang.Object
com.quantfinlib.execution.MidPegTracker
Mid-rate pegging model: tracks the target price of a mid-pegged order with
an offset and optional limit cap, and decides when the peg has drifted far
enough to justify a reprice (each reprice costs queue priority and a
message, so small moves are ignored).
-
Constructor Summary
ConstructorsConstructorDescriptionMidPegTracker(Side side, double offset, double limitPrice, double repriceThreshold) -
Method Summary
Modifier and TypeMethodDescriptiondoubleCurrent working price (NaN before the first quote).doubleonQuote(double bid, double ask) Feed a top-of-book update.
-
Constructor Details
-
MidPegTracker
- Parameters:
offset- signed offset from the mid (negative = more passive for a buy)limitPrice- hard cap: never price through this (NaN to disable)repriceThreshold- minimum absolute peg move before repricing
-
-
Method Details
-
onQuote
public double onQuote(double bid, double ask) Feed a top-of-book update. Returns the new order price when a reprice is warranted, or NaN when the current price should be left alone. -
currentPrice
public double currentPrice()Current working price (NaN before the first quote).
-