Class OptionsBook

java.lang.Object
com.quantfinlib.hedging.OptionsBook

public final class OptionsBook extends Object
An options book on one underlying: aggregate Greeks across positions, spot×vol scenario grids, and delta-gamma-vega-theta Pinvalid input: '&L' explain — the risk view a desk runs, not a single option.

Positions carry their own implied vols (smile-aware if fed from VolSurface); quantities are signed (negative = short). The underlying hedge position is part of the book, so net delta reflects the hedged residual.

  • Constructor Details

    • OptionsBook

      public OptionsBook(double spot, double rate, double carry)
  • Method Details

    • addOption

      public OptionsBook addOption(OptionsBook.OptionPosition position)
    • addOption

      public OptionsBook addOption(String label, BlackScholes.OptionType type, double strike, double expiryYears, double quantity, double impliedVol)
    • addUnderlying

      public OptionsBook addUnderlying(double quantity)
      Adds (or hedges with) the underlying; negative = short.
    • spot

      public double spot()
    • positions

      public List<OptionsBook.OptionPosition> positions()
    • underlyingQuantity

      public double underlyingQuantity()
    • value

      public double value()
      Book value at current market (options MTM + underlying).
    • greeks

      public OptionsBook.BookGreeks greeks()
      Aggregated Greeks: options plus the underlying (delta 1 per unit).
    • valueAt

      public double valueAt(double newSpot, double volShift, double timeDecayYears)
      Full revaluation at a shifted market (parallel vol shift, time decay).
    • scenarioGrid

      public double[][] scenarioGrid(double[] spotShiftsPct, double[] volShiftsAbs)
      Spot×vol scenario Pinvalid input: '&L' grid (full revaluation, no time decay): grid[i][j] = Pinvalid input: '&L' at spot shifted by spotShiftsPct[i] (fraction, 0.05 = +5%) and vol shifted by volShiftsAbs[j] (absolute, 0.02 = +2 vol points).
    • pnlExplain

      public OptionsBook.PnlExplain pnlExplain(double newSpot, double volShift, double timeDecayYears)
      Delta-gamma-vega-theta Pinvalid input: '&L' explain versus full revaluation: how much of the actual move the Greeks account for, and what is left unexplained (higher-order and cross terms).