Class SwingOption
- All Implemented Interfaces:
FiniteDifferenceEquityProduct, FiniteDifferenceProduct<FiniteDifferenceEquityModel>, Product
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 Summary
ConstructorsConstructorDescriptionSwingOption(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.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.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.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. -
Method Summary
Modifier and TypeMethodDescriptionReturns the call/put indicator.double[]Returns the decision times.doubleReturns the global maximum total quantity.doubleReturns the global minimum total quantity.double[]Returns the local maximum quantities.double[]Returns the local minimum quantities.doubleReturns the maturity.doubleReturns the quantity grid step.Returns the quantity control mode.doubleReturns the strike.Returns the underlying name.double[]getValue(double evaluationTime, FiniteDifferenceEquityModel model) Returns the value at the given evaluation time.double[][]Returns the full value surface.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FiniteDifferenceEquityProduct
getModelClassMethods inherited from interface FiniteDifferenceProduct
getValue
-
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 benull.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 forSwingQuantityMode.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 forSwingQuantityMode.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 benull.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 forSwingQuantityMode.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 forSwingQuantityMode.DISCRETE_QUANTITY_GRID.
-
-
Method Details
-
getValue
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:
getValuein interfaceFiniteDifferenceProduct<FiniteDifferenceEquityModel>- Parameters:
evaluationTime- Evaluation time.model- The finite-difference model.- Returns:
- The value on the model space grid.
-
getValues
Returns the full value surface.This operation is intentionally unsupported, since the contract value depends on the additional cumulative-quantity state.
- Specified by:
getValuesin interfaceFiniteDifferenceProduct<FiniteDifferenceEquityModel>- Parameters:
model- The finite-difference model.- Returns:
- Never returns normally.
-
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
-
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.
-