Class SwingOption

java.lang.Object
net.finmath.finitedifference.assetderivativevaluation.products.SwingOption
All Implemented Interfaces:
FiniteDifferenceEquityProduct, FiniteDifferenceProduct<FiniteDifferenceEquityModel>, Product

public class SwingOption extends Object implements FiniteDifferenceEquityProduct
Fixed-strike generalized swing option.

A swing option is a multiple-exercise contract with volume constraints. At each decision time ti, the holder chooses an exercised quantity qi subject to local bounds

qi ∈ [qimin, qimax],

and global cumulative constraints

Qmin ≤ ∑i=0n-1 qi ≤ Qmax.

For a fixed strike K, the immediate payoff at decision time ti is

qi max(ω(S(ti) - K), 0),

where ω = 1 for a call and ω = -1 for a put.

The valuation is performed by dynamic programming over an auxiliary state variable representing cumulative consumed quantity Qi = ∑k=0i-1 qk. Between decision dates, continuation values are propagated backward by the finite- difference solver of the underlying model. At each decision date the value is obtained from the Bellman step

Vi(S,Q) = supq ∈ A(i,Q) { q max(ω(S-K),0) + Ci(S,Q+q) },

where A(i,Q) denotes the admissible set induced by local and global quantity constraints.

The quantity control may be either bang-bang, where only local extrema are admissible, or based on a discretized quantity grid. The implementation supports one- and two-dimensional finite-difference equity models. Since cumulative consumed quantity is an additional path state not contained in the model space grid, a full value surface independent of this state is not well defined. Therefore getValues(FiniteDifferenceEquityModel) is intentionally unsupported in this implementation, while getValue(double, FiniteDifferenceEquityModel) is provided at evaluation time 0.

Author:
Alessandro Gnoatto
  • Constructor Details

    • SwingOption

      public SwingOption(String underlyingName, double[] decisionTimes, double strike, double[] localMinQuantity, double[] localMaxQuantity, double globalMinQuantity, double globalMaxQuantity, CallOrPut callOrPut, SwingQuantityMode quantityMode, double quantityGridStep)
      Creates a generalized swing option.
      Parameters:
      underlyingName - Name of the underlying. May be null.
      decisionTimes - Exercise decision times.
      strike - Fixed strike.
      localMinQuantity - Local minimum quantities.
      localMaxQuantity - Local maximum quantities.
      globalMinQuantity - Global minimum total quantity.
      globalMaxQuantity - Global maximum total quantity.
      callOrPut - Call/put indicator.
      quantityMode - Quantity control mode.
      quantityGridStep - Quantity discretization step for SwingQuantityMode.DISCRETE_QUANTITY_GRID.
    • SwingOption

      public SwingOption(double[] decisionTimes, double strike, double[] localMinQuantity, double[] localMaxQuantity, double globalMinQuantity, double globalMaxQuantity, CallOrPut callOrPut, SwingQuantityMode quantityMode, double quantityGridStep)
      Creates a generalized swing option with anonymous underlying.
      Parameters:
      decisionTimes - Exercise decision times.
      strike - Fixed strike.
      localMinQuantity - Local minimum quantities.
      localMaxQuantity - Local maximum quantities.
      globalMinQuantity - Global minimum total quantity.
      globalMaxQuantity - Global maximum total quantity.
      callOrPut - Call/put indicator.
      quantityMode - Quantity control mode.
      quantityGridStep - Quantity discretization step for SwingQuantityMode.DISCRETE_QUANTITY_GRID.
    • SwingOption

      public SwingOption(String underlyingName, double[] decisionTimes, double strike, double localMinQuantity, double localMaxQuantity, double globalMinQuantity, double globalMaxQuantity, CallOrPut callOrPut, SwingQuantityMode quantityMode, double quantityGridStep)
      Creates a generalized swing option with time-homogeneous local bounds.
      Parameters:
      underlyingName - Name of the underlying. May be null.
      decisionTimes - Exercise decision times.
      strike - Fixed strike.
      localMinQuantity - Constant local minimum quantity.
      localMaxQuantity - Constant local maximum quantity.
      globalMinQuantity - Global minimum total quantity.
      globalMaxQuantity - Global maximum total quantity.
      callOrPut - Call/put indicator.
      quantityMode - Quantity control mode.
      quantityGridStep - Quantity discretization step for SwingQuantityMode.DISCRETE_QUANTITY_GRID.
    • SwingOption

      public SwingOption(double[] decisionTimes, double strike, double localMinQuantity, double localMaxQuantity, double globalMinQuantity, double globalMaxQuantity, CallOrPut callOrPut, SwingQuantityMode quantityMode, double quantityGridStep)
      Creates a generalized swing option with anonymous underlying and time- homogeneous local bounds.
      Parameters:
      decisionTimes - Exercise decision times.
      strike - Fixed strike.
      localMinQuantity - Constant local minimum quantity.
      localMaxQuantity - Constant local maximum quantity.
      globalMinQuantity - Global minimum total quantity.
      globalMaxQuantity - Global maximum total quantity.
      callOrPut - Call/put indicator.
      quantityMode - Quantity control mode.
      quantityGridStep - Quantity discretization step for SwingQuantityMode.DISCRETE_QUANTITY_GRID.
  • Method Details

    • getValue

      public double[] getValue(double evaluationTime, FiniteDifferenceEquityModel model)
      Returns the value at the given evaluation time.

      In this implementation only evaluation time 0 is supported, since for later times the cumulative consumed quantity would have to be supplied explicitly.

      Specified by:
      getValue in interface FiniteDifferenceProduct<FiniteDifferenceEquityModel>
      Parameters:
      evaluationTime - Evaluation time.
      model - The finite-difference model.
      Returns:
      The value on the model space grid.
    • getValues

      public double[][] getValues(FiniteDifferenceEquityModel model)
      Returns the full value surface.

      This operation is intentionally unsupported, since the contract value depends on the additional cumulative-quantity state.

      Specified by:
      getValues in interface FiniteDifferenceProduct<FiniteDifferenceEquityModel>
      Parameters:
      model - The finite-difference model.
      Returns:
      Never returns normally.
    • getUnderlyingName

      public String getUnderlyingName()
      Returns the underlying name.
      Returns:
      The underlying name, possibly null.
    • getDecisionTimes

      public double[] getDecisionTimes()
      Returns the decision times.
      Returns:
      A defensive copy of the decision times.
    • getMaturity

      public double getMaturity()
      Returns the maturity.
      Returns:
      The maturity, equal to the last decision time.
    • getStrike

      public double getStrike()
      Returns the strike.
      Returns:
      The fixed strike.
    • getLocalMinQuantity

      public double[] getLocalMinQuantity()
      Returns the local minimum quantities.
      Returns:
      A defensive copy of the local minimum quantities.
    • getLocalMaxQuantity

      public double[] getLocalMaxQuantity()
      Returns the local maximum quantities.
      Returns:
      A defensive copy of the local maximum quantities.
    • getGlobalMinQuantity

      public double getGlobalMinQuantity()
      Returns the global minimum total quantity.
      Returns:
      The global minimum total quantity.
    • getGlobalMaxQuantity

      public double getGlobalMaxQuantity()
      Returns the global maximum total quantity.
      Returns:
      The global maximum total quantity.
    • getCallOrPut

      public CallOrPut getCallOrPut()
      Returns the call/put indicator.
      Returns:
      The call/put indicator.
    • getQuantityMode

      public SwingQuantityMode getQuantityMode()
      Returns the quantity control mode.
      Returns:
      The quantity control mode.
    • getQuantityGridStep

      public double getQuantityGridStep()
      Returns the quantity grid step.
      Returns:
      The quantity grid step.