Class DeltaHedger

java.lang.Object
com.quantfinlib.hedging.DeltaHedger

public final class DeltaHedger extends Object
Dynamic delta hedging simulator: sell an option, then replicate it by trading the underlying along a price path, rebalancing whenever the delta drifts outside a band. Quantifies the trade-off every option desk lives with — tighter bands mean smaller replication error but more transaction costs.

The final P&L is the hedging error: zero in the Black-Scholes limit of continuous, costless rebalancing at the true volatility; in practice it spreads with rebalancing interval, transaction costs, and the gap between implied and realized volatility.

Accounting: the premium goes into a cash account that compounds at rate; the shares held earn the continuous carry (paid into cash), consistent with the Black-Scholes-Merton drift r − q used for pricing (Hull, Options, Futures and Other Derivatives, ch. 17). Without the carry leg a q = 3% hedge would show a mean loss of roughly ∫ Δ·S·q dt.

  • Method Details

    • simulateShortOption

      public static DeltaHedger.HedgeReport simulateShortOption(BlackScholes.OptionType type, double strike, double expiryYears, double rate, double carry, double hedgeVol, double[] path, double dtYears, DeltaHedger.Config config)
      Simulates a short option delta-hedged along the given path.
      Parameters:
      expiryYears - option expiry; should equal (path.length-1) * dtYears
      rate - continuously compounded cash rate (annual)
      carry - continuous yield paid by the underlying (dividend yield, or the foreign rate for FX), annual; it is credited to the hedge position each step
      hedgeVol - volatility used for pricing and hedging (implied vol)
      path - underlying prices; path[0] at inception, path[n-1] at expiry
      dtYears - time between path points (e.g. 1/252 for daily)