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

## webcab.lib.finance.options
Class EuropeanGamma

    java.lang.Object
      |
      +--webcab.lib.finance.options.EuropeanGamma

All Implemented Interfaces:
  Serializable

public class EuropeanGamma
extends Object
implements Serializable

Within this class we consider the evaluation of the Gamma of European options on equities, equity indexes, currencies and futures contracts in accordance with the classical Black-Scholes model.

Recall that the Gamma of an option contract is the rate of change of the rate of change (i.e. the second derivative) of the option price with respect to changes of the underlying asset price.

See Also:
  Serialized Form

Constructor Summary
`EuropeanGamma()` Creates a new instance.

Method Summary
`double` `gammaFromThetaDelta(double delta, double theta, double assetPrice, double riskFreeRate, double volatility, double totalValue)` We derive the gamma from the delta, theta and some other market variables.
`double` `optionGamma(double stockPrice, double strike, double riskFreeRate, double volatility, Date evaluatioDate, Date maturityDate, BusinessCalendar businessCalendar)` Evaluates the gamma of a European call or put option on a non-dividend paying stock.
`double` `optionGamma(double stockPrice, double strike, double riskFreeRate, double volatility, double timeToMaturity)` Evaluates the gamma of a European call or put option on a non-dividend paying stock.
`double` `optionGammaOnCurrency(double foreignRate, double exchangeRate, double strike, double riskFreeRate, double volatility, Date evaluatioDate, Date maturityDate, BusinessCalendar businessCalendar)` Evaluates the gamma of a European call or put option on a currency.
`double` `optionGammaOnCurrency(double foreignRate, double exchangeRate, double strike, double riskFreeRate, double volatility, double timeToMaturity)` Evaluates the gamma of a European call or put option on a currency.
`double` `optionGammaOnFutures(double futuresPrice, double strike, double riskFreeRate, double volatility, Date evaluatioDate, Date maturityDate, BusinessCalendar businessCalendar)` Evaluates the gamma of a European call or put option of a futures contract.
`double` `optionGammaOnFutures(double futuresPrice, double strike, double riskFreeRate, double volatility, double timeToMaturity)` Evaluates the gamma of a European call or put option of a futures contract.
`double` `optionGammaOnIndex(double yield, double indexValue, double strike, double riskFreeRate, double volatility, Date evaluatioDate, Date maturityDate, BusinessCalendar businessCalendar)` Evaluates the gamma of a European call or put option on an index.
`double` `optionGammaOnIndex(double yield, double indexValue, double strike, double riskFreeRate, double volatility, double timeToMaturity)` Evaluates the gamma of a European call or put option on an index.
`double` `optionGammaWithYield(double yield, double stockPrice, double strike, double riskFreeRate, double volatility, Date evaluatioDate, Date maturityDate, BusinessCalendar businessCalendar)` Returns the gamma of a European call or put option on a stock which has a continuous yield.
`double` `optionGammaWithYield(double yield, double stockPrice, double strike, double riskFreeRate, double volatility, double timeToMaturity)` Returns the gamma of a European call or put option on a stock which has a continuous yield.

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

Constructor Detail

### EuropeanGamma

    public EuropeanGamma()

  Creates a new instance.

Method Detail

### optionGamma

    public double optionGamma(double stockPrice,
                              double strike,
                              double riskFreeRate,
                              double volatility,
                              Date evaluatioDate,
                              Date maturityDate,
                              BusinessCalendar businessCalendar)
                       throws EuropeanGammaDemoException

  Evaluates the gamma of a European call or put option on a non-dividend paying stock.

  Parameters:
    `stockPrice` - the price of the underlying security
    `strike` - the strike (or exercise price) of the (call or put) option
    `riskFreeRate` - the continuously compounded risk free interest rate in decimal format (1 percent = 0.01)
    `volatility` - volatility of the futures contract
    `maturityDate` - the date when the option contract matures
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `EuropeanGammaDemoException`

### optionGamma

    public double optionGamma(double stockPrice,
                              double strike,
                              double riskFreeRate,
                              double volatility,
                              double timeToMaturity)
                       throws EuropeanGammaDemoException

  Evaluates the gamma of a European call or put option on a non-dividend paying stock.

  Parameters:
    `stockPrice` - the price of the underlying security
    `strike` - the strike (or exercise price) of the (call or put) option
    `riskFreeRate` - the continuously compounded risk free interest rate in decimal format (1 percent = 0.01)
    `volatility` - volatility of the futures contract
    `timeToMaturity` - the time (in years) until the option contract expires
    `EuropeanGammaDemoException`

### optionGammaWithYield

    public double optionGammaWithYield(double yield,
                                       double stockPrice,
                                       double strike,
                                       double riskFreeRate,
                                       double volatility,
                                       Date evaluatioDate,
                                       Date maturityDate,
                                       BusinessCalendar businessCalendar)
                                throws EuropeanGammaDemoException

  Returns the gamma of a European call or put option on a stock which has a continuous yield.

  Parameters:
    `yield` - the continuous yield of the underlying stock
    `stockPrice` - the price of the underlying stock or index
    `strike` - value at which the option is exercised
    `riskFreeRate` - the risk free interest rate in decimal format (i.e. 1 percent = 0.01)
    `volatility` - the volatility of the underlying stock
    `maturityDate` - the date when the option contract matures
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `EuropeanGammaDemoException`

### optionGammaWithYield

    public double optionGammaWithYield(double yield,
                                       double stockPrice,
                                       double strike,
                                       double riskFreeRate,
                                       double volatility,
                                       double timeToMaturity)
                                throws EuropeanGammaDemoException

  Returns the gamma of a European call or put option on a stock which has a continuous yield.

  Parameters:
    `yield` - the continuous yield of the underlying stock
    `stockPrice` - the price of the underlying stock or index
    `strike` - value at which the option is exercised
    `riskFreeRate` - the risk free interest rate in decimal format (i.e. 1 percent = 0.01)
    `volatility` - the volatility of the underlying stock
    `timeToMaturity` - time period until the option expires
    `EuropeanGammaDemoException`

### optionGammaOnIndex

    public double optionGammaOnIndex(double yield,
                                     double indexValue,
                                     double strike,
                                     double riskFreeRate,
                                     double volatility,
                                     Date evaluatioDate,
                                     Date maturityDate,
                                     BusinessCalendar businessCalendar)
                              throws EuropeanGammaDemoException

  Evaluates the gamma of a European call or put option on an index.

  Parameters:
    `yield` - the average continuous yield of the constituents of the index
    `indexValue` - the value of index
    `strike` - value at which the option is exercised
    `riskFreeRate` - the risk free interest rate
    `volatility` - the volatility of the underlying stock
    `maturityDate` - the date when the option contract matures
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `EuropeanGammaDemoException`

### optionGammaOnIndex

    public double optionGammaOnIndex(double yield,
                                     double indexValue,
                                     double strike,
                                     double riskFreeRate,
                                     double volatility,
                                     double timeToMaturity)
                              throws EuropeanGammaDemoException

  Evaluates the gamma of a European call or put option on an index.

  Parameters:
    `yield` - the average continuous yield of the constituents of the index
    `indexValue` - the value of index
    `strike` - value at which the option is exercised
    `riskFreeRate` - the risk free interest rate
    `volatility` - the volatility of the underlying stock
    `timeToMaturity` - time period until the option expires
    `EuropeanGammaDemoException`

### optionGammaOnCurrency

    public double optionGammaOnCurrency(double foreignRate,
                                        double exchangeRate,
                                        double strike,
                                        double riskFreeRate,
                                        double volatility,
                                        Date evaluatioDate,
                                        Date maturityDate,
                                        BusinessCalendar businessCalendar)
                                 throws EuropeanGammaDemoException

  Evaluates the gamma of a European call or put option on a currency.

  Parameters:
    `foreignRate` - the continuously compounded risk free interest rate in the foreign currency
    `exchangeRate` - the present exchange rate
    `strike` - the exchange rate at which the option can be exercised
    `riskFreeRate` - the risk free interest rate in the base currency
    `volatility` - the volatility of the exchange rate
    `maturityDate` - the date when the option contract matures
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `EuropeanGammaDemoException`

### optionGammaOnCurrency

    public double optionGammaOnCurrency(double foreignRate,
                                        double exchangeRate,
                                        double strike,
                                        double riskFreeRate,
                                        double volatility,
                                        double timeToMaturity)
                                 throws EuropeanGammaDemoException

  Evaluates the gamma of a European call or put option on a currency.

  Parameters:
    `foreignRate` - the continuously compounded risk free interest rate in the foreign currency
    `exchangeRate` - the present exchange rate
    `strike` - the exchange rate at which the option can be exercised
    `riskFreeRate` - the risk free interest rate in the base currency
    `volatility` - the volatility of the exchange rate
    `timeToMaturity` - the time until the option expires
    `EuropeanGammaDemoException`

### optionGammaOnFutures

    public double optionGammaOnFutures(double futuresPrice,
                                       double strike,
                                       double riskFreeRate,
                                       double volatility,
                                       Date evaluatioDate,
                                       Date maturityDate,
                                       BusinessCalendar businessCalendar)
                                throws EuropeanGammaDemoException

  Evaluates the gamma of a European call or put option of a futures contract.

  Parameters:
    `futuresPrice` - the futures price at time zero
    `strike` - the value of the futures contract at which option can be exercised
    `riskFreeRate` - the risk free interest rate
    `volatility` - volatility of the futures contract
    `maturityDate` - the date when the option contract matures
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `EuropeanGammaDemoException`

### optionGammaOnFutures

    public double optionGammaOnFutures(double futuresPrice,
                                       double strike,
                                       double riskFreeRate,
                                       double volatility,
                                       double timeToMaturity)
                                throws EuropeanGammaDemoException

  Evaluates the gamma of a European call or put option of a futures contract.

  Parameters:
    `futuresPrice` - the futures price at time zero
    `strike` - the value of the futures contract at which option can be exercised
    `riskFreeRate` - the risk free interest rate
    `volatility` - volatility of the futures contract
    `timeToMaturity` - the time period until the option contract expires
    `EuropeanGammaDemoException`

### gammaFromThetaDelta

    public double gammaFromThetaDelta(double delta,
                                      double theta,
                                      double assetPrice,
                                      double riskFreeRate,
                                      double volatility,
                                      double totalValue)
                               throws EuropeanGammaDemoException

  We derive the gamma from the delta, theta and some other market variables. Note that for a delta neutral portfolio of derivatives on an underlying asset this expression relates the gamma and theta functions.

  Parameters:
    `theta` - the theta of the portfolio
    `totalValue` - the value of the whole portfolio
    `assetPrice` - the underlying asset price
    `volatility` - the volatility of the underlying asset price
    `riskFreeRate` - the continuously compounded risk free interest rate
    `EuropeanGammaDemoException`

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