Class FixingRisk
java.lang.Object
com.quantfinlib.fx.FixingRisk
Analytics for benchmark-fixing exposure — the risk concentrated in the
short calculation window of an official fix (WM/R 4pm London, the RBI
reference rate an NDF settles on, an equity closing auction).
A book that must trade at the fix (to hedge an NDF settlement or match a benchmarked mandate) cannot execute at a single instant: it works the order through the window and receives roughly the window TWAP/VWAP, while its liability references the fix print. These helpers quantify both sides:
windowTwap(double[])/windowVwap(double[], double[])— what execution across the window actually achieves;slippageVsFix(com.quantfinlib.fx.CurrencyPair, double, double)— realized tracking difference, in pips;trackingErrorStd(double, double)— the ex-ante 1σ of that difference from diffusion alone, the number a pre-trade check compares against limits;participationRate(double, double)— share of window volume, the standard impact red flag around fixes.
All methods are static and allocation-free — usable from a pre-trade gate as well as post-trade TCA.
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleparticipationRate(double orderQty, double expectedWindowVolume) Order size as a fraction of expected window volume — above ~20% the order moves the fix it is trying to match, and impact (not tracking noise) dominates.static doubleslippageVsFix(CurrencyPair pair, double achievedPrice, double fixPrice) Realized slippage of an achieved price vs the fix print, in pips (signed, buy side).static doubletrackingErrorStd(double volPerSqrtMinute, double windowMinutes) Ex-ante 1σ tracking error (price terms) between a fix print and a uniform execution across the window, from diffusion alone.static doublewindowTwap(double[] prices) Time-weighted average of window prices (equally spaced observations).static doublewindowVwap(double[] prices, double[] sizes) Volume-weighted average of window prices.
-
Method Details
-
windowTwap
public static double windowTwap(double[] prices) Time-weighted average of window prices (equally spaced observations). -
windowVwap
public static double windowVwap(double[] prices, double[] sizes) Volume-weighted average of window prices. -
slippageVsFix
Realized slippage of an achieved price vs the fix print, in pips (signed, buy side). -
trackingErrorStd
public static double trackingErrorStd(double volPerSqrtMinute, double windowMinutes) Ex-ante 1σ tracking error (price terms) between a fix print and a uniform execution across the window, from diffusion alone.For arithmetic Brownian motion with per-√minute vol σ, the variance of (fix − TWAP) over a window of length T minutes ending at the fix is σ²·T/3 — the classic TWAP-vs-close result. Multiply by notional for a P&L figure.
- Parameters:
volPerSqrtMinute- price vol per √minute (e.g. daily vol / √(24·60))windowMinutes- fix calculation window length
-
participationRate
public static double participationRate(double orderQty, double expectedWindowVolume) Order size as a fraction of expected window volume — above ~20% the order moves the fix it is trying to match, and impact (not tracking noise) dominates.
-