WebCab Options and Futures Demo v2.5 (J2SE Edition)

## webcab.lib.finance.options.exotic
Class SpreadStrategyPayoff

    java.lang.Object
      |
      +--webcab.lib.finance.options.exotic.SpreadStrategyPayoff

All Implemented Interfaces:
  PayoffFunction, Serializable

public class SpreadStrategyPayoff
extends Object
implements PayoffFunction

This class gives an implementation of the PayoffFunction for a standard spread option strategy. The portfolio consists of one short and one long position with options of the same type.

See Also:
  Serialized Form

Constructor Summary
`SpreadStrategyPayoff(int bull_bear, double strike_price1, double strike_price2)` Creates new SpreadStrategyPayoff function.

Method Summary
`double` `getValueAt(double t, double[] x, double[] path_dependent_values, int n)` Computes the value of the function in the point x.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SpreadStrategyPayoff

    public SpreadStrategyPayoff(int bull_bear,
                                double strike_price1,
                                double strike_price2)
                         throws Exception

  Creates new SpreadStrategyPayoff function.

Parameters:
  `bull_bear` - Set this to ExoticOptionsConstants.BULL or ExoticOptionsConstants.BEAR. A bull spread benefits from a bull (rising) market. A bear spread benefits from a bear (falling) market.
  `strike_price1` - The strike (exercise) price of the put option.
  `strike_price2` - The strike (exercise) price of the call option.

Method Detail

### getValueAt

    public double getValueAt(double t,
                             double[] x,
                             double[] path_dependent_values,
                             int n)

  Computes the value of the function in the point x.

  Specified by:
    `getValueAt` in interface `PayoffFunction`
  Parameters:
    `x` - the point at which the function is evaluated.
    `t` - The time, used only for Bermudan options.
    `path_dependent_values` - a vector containing the path dependent values. associated with the asset prices. Used only for strongly path dependent options.
    `n` - the total number of assets.
  Returns:
    the value of the function in the point x

WebCab Options and Futures Demo v2.5 (J2SE Edition)