Class WhalleyWilmott
java.lang.Object
com.quantfinlib.hedging.WhalleyWilmott
Whalley-Wilmott OPTIMAL hedge bands — the answer to the question
every band hedger otherwise guesses: how wide should the no-trade
band around delta be? Hedging continuously is bankruptcy by
transaction costs; hedging never is a naked option. The asymptotic
optimum (Whalley & Wilmott 1997, small proportional costs) puts the
half-width at
band = ( (3/2) · k · S · Γ² / λ )^{1/3}
— wider when trading is expensive (k, the proportional cost) and
when gamma churns the delta (Γ²), narrower when you are more risk
averse (λ). The cube root is the interesting part: costs must move
by 8x to move the band by 2x, which is why band width is remarkably
stable across venues.
The POLICY is as important as the width: when the hedge drifts outside the band, trade back to the NEAREST EDGE, not to the center — hedging to delta itself throws away the band's whole point (you would pay the spread again on the next tick's drift). Zero gamma degenerates honestly: zero band, always hedge exactly to delta.
Pairs with the band executors: trading.AutoHedger and
crb.CrbAutoHedger take a band as configuration — this class
is where that number should come from. Asymptotic result: for very
large costs or tiny risk aversion the expansion degrades (stated,
not hidden). Static, deterministic, research lane.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe rebalancing decision: trade (to the nearest edge) or hold. -
Method Summary
Modifier and TypeMethodDescriptionstatic doublebandHalfWidth(double spot, double gamma, double costRate, double riskAversion) The optimal no-trade half-width around delta.static WhalleyWilmott.Actionrebalance(double currentHedge, double delta, double bandHalfWidth) The hedge-to-the-edge policy: hold inside the band, trade to the NEAREST edge outside it.
-
Method Details
-
bandHalfWidth
public static double bandHalfWidth(double spot, double gamma, double costRate, double riskAversion) The optimal no-trade half-width around delta.- Parameters:
spot- underlying price, > 0gamma- book gamma (signed; only |Γ| matters), finitecostRate- proportional transaction cost k (e.g. 0.0005 = 5 bps), > 0riskAversion- λ > 0 (bigger = tighter hedging)
-
rebalance
public static WhalleyWilmott.Action rebalance(double currentHedge, double delta, double bandHalfWidth) The hedge-to-the-edge policy: hold inside the band, trade to the NEAREST edge outside it.- Parameters:
currentHedge- the position currently held against the bookdelta- the book's current delta (the band's center)bandHalfWidth- frombandHalfWidth(double, double, double, double), ≥ 0
-