Class PreTradeLimitChecker
java.lang.Object
com.quantfinlib.risk.PreTradeLimitChecker
Pre-trade risk gate: validates every order against configured limits before
it reaches the market — order size, notional, resulting position, price
collar versus a reference mid, restricted symbols, and counterparty credit
headroom. Designed to be evaluated synchronously on the order path.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheck(PreTradeLimitChecker.OrderRequest order, double referenceMid, long currentPositionQty, double counterpartyExposure) counterpartyLimit(String counterparty, double limit) maxOrderNotional(double notional) maxOrderQuantity(long qty) maxPositionQuantity(long qty) Cap on |position| after the order would fully fill.priceCollarPct(double pct) Reject prices more than this fraction away from the reference mid (fat-finger guard).restrictSymbol(String symbol)
-
Constructor Details
-
PreTradeLimitChecker
public PreTradeLimitChecker()
-
-
Method Details
-
maxOrderQuantity
-
maxOrderNotional
-
maxPositionQuantity
Cap on |position| after the order would fully fill. -
priceCollarPct
Reject prices more than this fraction away from the reference mid (fat-finger guard). -
counterpartyLimit
-
restrictSymbol
-
check
public PreTradeLimitChecker.CheckResult check(PreTradeLimitChecker.OrderRequest order, double referenceMid, long currentPositionQty, double counterpartyExposure) - Parameters:
referenceMid- current market mid for the collar check (NaN skips it)currentPositionQty- signed current position in the symbolcounterpartyExposure- current total exposure to the order's counterparty
-