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

## webcab.lib.finance.futures
Class FuturesOnCommodities

    java.lang.Object
      |
      +--webcab.lib.finance.futures.FuturesOnCommodities

All Implemented Interfaces:
  Serializable

public class FuturesOnCommodities
extends Object
implements Serializable

Within this class we consider the evaluation of futures contracts on commodities of both investment and consumption type.

See Also:
  Serialized Form

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

Method Summary
`double` `consumptionCommodity(double commodityPrice, double storageCosts, double riskFree, Date evaluationDate, Date expiryDate, BusinessCalendar businessCalendar)` Returns the upper bound of the value for a futures contact on an consumption commodity when the present value of the storage cost are known.
`double` `consumptionCommodity(double commodityPrice, double storageCosts, double riskFree, double timeToExpiry)` Returns the upper bound of the value for a futures contact on an consumption commodity when the present value of the storage cost are known.
`double` `consumptionCommodityWithCarry(double commodityPrice, double convenienceYield, double costOfCarry, Date evaluationDate, Date expiryDate, BusinessCalendar businessCalendar)` Calculates the price of a consumption commodity.
`double` `consumptionCommodityWithCarry(double commodityPrice, double convenienceYield, double costOfCarry, double timeToExpiry)` Calculates the price of a consumption commodity.
`double` `consumptionCommodityWithProportionateCosts(double commodityPrice, double storageCosts, double riskFree, Date evaluationDate, Date maturityDate, BusinessCalendar businessCalendar)` Returns the upper bound of the value for a futures contact on an investment commodity when the storage cost as a proportion of the commodity price are known.
`double` `consumptionCommodityWithProportionateCosts(double commodityPrice, double storageCosts, double riskFree, double timeToExpiry)` Returns the upper bound of the value for a futures contact on an investment commodity when the storage cost as a proportion of the commodity price are known.
`double` `convenienceYield(double commodityPrice, double storageCosts, double riskFree, double futuresPrice, Date evaluationDate, Date expiryDate, BusinessCalendar businessCalendar)` This methods calculates the convenience yield of a consumption commodity when the present value of the cost of storage is known.
`double` `convenienceYield(double commodityPrice, double storageCosts, double riskFree, double futuresPrice, double timeToExpiry)` This methods calculates the convenience yield of a consumption commodity when the present value of the cost of storage is known.
`double` `convenienceYieldFromCarry(double commodityPrice, double futuresPrice, double costOfCarry, Date evaluationDate, Date expiryDate, BusinessCalendar businessCalendar)` Calculates the convenience yield from the cost of carry for a consumption commodity.
`double` `convenienceYieldFromCarry(double commodityPrice, double futuresPrice, double costOfCarry, double timeToExpiry)` Calculates the convenience yield from the cost of carry for a consumption commodity.
`double` `convenienceYieldWithProportionalCosts(double commodityPrice, double storageCosts, double riskFree, double futuresPrice, Date evaluationDate, Date expiryDate, BusinessCalendar businessCalendar)` Returns the convenience yield of a consumption commodity when the storage costs as a proportion of the commodity price is known.
`double` `convenienceYieldWithProportionalCosts(double commodityPrice, double storageCosts, double riskFree, double futuresPrice, double timeToExpiry)` Returns the convenience yield of a consumption commodity when the storage costs as a proportion of the commodity price is known.
`double` `costOfCarry(double commodityPrice, double futuresPrice, Date evaluationDate, Date expiryDate, BusinessCalendar businessCalendar)` Calculates the cost of carry of an investment commodity.
`double` `costOfCarry(double commodityPrice, double futuresPrice, double timeToExpiry)` Calculates the cost of carry of an investment commodity.
`double` `costOfCarryForConsumption(double commodityPrice, double futuresPrice, double convenienceYield, Date evaluationDate, Date expiryDate, BusinessCalendar businessCalendar)` Calculates the cost of carry of a consumption commodity.
`double` `costOfCarryForConsumption(double commodityPrice, double futuresPrice, double convenienceYield, double timeToExpiry)` Calculates the cost of carry of a consumption commodity.
`double` `investmentCommodity(double commodityPrice, double storageCosts, double riskFree, Date evaluationDate, Date maturityDate, BusinessCalendar businessCalendar)` Returns the value for a futures contact on an investment commodity when the present value of the storage cost are known.
`double` `investmentCommodity(double commodityPrice, double storageCosts, double riskFree, double timeToExpiry)` Returns the value for a futures contact on an investment commodity when the present value of the storage cost are known.
`double` `investmentCommodityWithCarry(double commodityPrice, double costOfCarry, Date evaluationDate, Date expiryDate, BusinessCalendar businessCalendar)` Calculates the price of an investment commodity.
`double` `investmentCommodityWithCarry(double commodityPrice, double costOfCarry, double timeToExpiry)` Calculates the price of an investment commodity.
`double` `investmentCommodityWithProportionateCosts(double commodityPrice, double storageCosts, double riskFree, Date evaluationDate, Date maturityDate, BusinessCalendar businessCalendar)` Returns the value for a futures contact on an investment commodity when the storage cost as a proportion of the commodity price are known.
`double` `investmentCommodityWithProportionateCosts(double commodityPrice, double storageCosts, double riskFree, double timeToExpiry)` Returns the value for a futures contact on an investment commodity when the storage cost as a proportion of the commodity price are known.

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

Constructor Detail

### FuturesOnCommodities

    public FuturesOnCommodities()

  Creates a new instance.

Method Detail

### investmentCommodity

    public double investmentCommodity(double commodityPrice,
                                      double storageCosts,
                                      double riskFree,
                                      Date evaluationDate,
                                      Date maturityDate,
                                      BusinessCalendar businessCalendar)
                               throws FuturesOnCommoditiesDemoException

  Returns the value for a futures contact on an investment commodity when the present value of the storage cost are known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - the present value of the storage cost of the commodity during the life of the futures contract
    `riskFree` - continuously compounded risk free interest rate
    `evaluationDate` - the date when futures contract is evaluated
    `maturityDate` - the date when the contract matures
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### investmentCommodity

    public double investmentCommodity(double commodityPrice,
                                      double storageCosts,
                                      double riskFree,
                                      double timeToExpiry)
                               throws FuturesOnCommoditiesDemoException

  Returns the value for a futures contact on an investment commodity when the present value of the storage cost are known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - the present value of the storage cost of the commodity during the life of the futures contract
    `riskFree` - continuously compounded risk free interest rate
    `timeToExpiry` - the time period until the future contract expires
    `FuturesOnCommoditiesDemoException`

### investmentCommodityWithProportionateCosts

    public double investmentCommodityWithProportionateCosts(double commodityPrice,
                                                            double storageCosts,
                                                            double riskFree,
                                                            Date evaluationDate,
                                                            Date maturityDate,
                                                            BusinessCalendar businessCalendar)
                                                     throws FuturesOnCommoditiesDemoException

  Returns the value for a futures contact on an investment commodity when the storage cost as a proportion of the commodity price are known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - the storage costs as a proportion of the commodity price during the life of the contract
    `riskFree` - continuously compounded risk free interest rate
    `evaluationDate` - the date when futures contract is evaluated
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### investmentCommodityWithProportionateCosts

    public double investmentCommodityWithProportionateCosts(double commodityPrice,
                                                            double storageCosts,
                                                            double riskFree,
                                                            double timeToExpiry)
                                                     throws FuturesOnCommoditiesDemoException

  Returns the value for a futures contact on an investment commodity when the storage cost as a proportion of the commodity price are known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - the storage costs as a proportion of the commodity price during the life of the contract
    `riskFree` - continuously compounded risk free interest rate
    `timeToExpiry` - the time period until the future contract expires
    `FuturesOnCommoditiesDemoException`

### consumptionCommodity

    public double consumptionCommodity(double commodityPrice,
                                       double storageCosts,
                                       double riskFree,
                                       Date evaluationDate,
                                       Date expiryDate,
                                       BusinessCalendar businessCalendar)
                                throws FuturesOnCommoditiesDemoException

  Returns the upper bound of the value for a futures contact on an consumption commodity when the present value of the storage cost are known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - the present value of the storage costs of the commodity during the life of the futures contract
    `riskFree` - continuously compounded risk free interest rate
    `evaluationDate` - the date when futures contract is evaluated
    `expiryDate` - the date when the contract expires
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### consumptionCommodity

    public double consumptionCommodity(double commodityPrice,
                                       double storageCosts,
                                       double riskFree,
                                       double timeToExpiry)
                                throws FuturesOnCommoditiesDemoException

  Returns the upper bound of the value for a futures contact on an consumption commodity when the present value of the storage cost are known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - the present value of the storage costs of the commodity during the life of the futures contract
    `riskFree` - continuously compounded risk free interest rate
    `timeToExpiry` - the time period until the future contract expires
    `FuturesOnCommoditiesDemoException`

### consumptionCommodityWithProportionateCosts

    public double consumptionCommodityWithProportionateCosts(double commodityPrice,
                                                             double storageCosts,
                                                             double riskFree,
                                                             Date evaluationDate,
                                                             Date maturityDate,
                                                             BusinessCalendar businessCalendar)
                                                      throws FuturesOnCommoditiesDemoException

  Returns the upper bound of the value for a futures contact on an investment commodity when the storage cost as a proportion of the commodity price are known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - the storage costs as a proportion of the commodity price during the life of the contract
    `riskFree` - continuously compounded risk free interest rate
    `evaluationDate` - the date when futures contract is evaluated
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### consumptionCommodityWithProportionateCosts

    public double consumptionCommodityWithProportionateCosts(double commodityPrice,
                                                             double storageCosts,
                                                             double riskFree,
                                                             double timeToExpiry)
                                                      throws FuturesOnCommoditiesDemoException

  Returns the upper bound of the value for a futures contact on an investment commodity when the storage cost as a proportion of the commodity price are known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - the storage costs as a proportion of the commodity price during the life of the contract
    `riskFree` - continuously compounded risk free interest rate
    `timeToExpiry` - the time period until the future contract expires
    `FuturesOnCommoditiesDemoException`

### convenienceYield

    public double convenienceYield(double commodityPrice,
                                   double storageCosts,
                                   double riskFree,
                                   double futuresPrice,
                                   Date evaluationDate,
                                   Date expiryDate,
                                   BusinessCalendar businessCalendar)
                            throws FuturesOnCommoditiesDemoException

  This methods calculates the convenience yield of a consumption commodity when the present value of the cost of storage is known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - present value of the storage cost of the commodity during the life of the futures contract
    `futuresPrice` - market price of a futures contract on the underlying commodity
    `riskFree` - average risk free interest rate during the life of the futures contract
    `evaluationDate` - the date when futures contract is evaluated
    `expiryDate` - the date when the contract matures
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### convenienceYield

    public double convenienceYield(double commodityPrice,
                                   double storageCosts,
                                   double riskFree,
                                   double futuresPrice,
                                   double timeToExpiry)
                            throws FuturesOnCommoditiesDemoException

  This methods calculates the convenience yield of a consumption commodity when the present value of the cost of storage is known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - present value of the storage cost of the commodity during the life of the futures contract
    `futuresPrice` - market price of a futures contract on the underlying commodity
    `timeToExpiry` - the time until the above future contract expires
    `riskFree` - average risk free interest rate during the life of the futures contract
    `FuturesOnCommoditiesDemoException`

### convenienceYieldWithProportionalCosts

    public double convenienceYieldWithProportionalCosts(double commodityPrice,
                                                        double storageCosts,
                                                        double riskFree,
                                                        double futuresPrice,
                                                        Date evaluationDate,
                                                        Date expiryDate,
                                                        BusinessCalendar businessCalendar)
                                                 throws FuturesOnCommoditiesDemoException

  Returns the convenience yield of a consumption commodity when the storage costs as a proportion of the commodity price is known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - storage costs as a proportion of the commodity price during the life of the contract
    `futuresPrice` - market price of a futures contract on the underlying commodity
    `riskFree` - continuously compounded risk free interest rate
    `evaluationDate` - the date when futures contract is evaluated
    `expiryDate` - the date when the contract expires
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### convenienceYieldWithProportionalCosts

    public double convenienceYieldWithProportionalCosts(double commodityPrice,
                                                        double storageCosts,
                                                        double riskFree,
                                                        double futuresPrice,
                                                        double timeToExpiry)
                                                 throws FuturesOnCommoditiesDemoException

  Returns the convenience yield of a consumption commodity when the storage costs as a proportion of the commodity price is known.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `storageCosts` - storage costs as a proportion of the commodity price during the life of the contract
    `futuresPrice` - market price of a futures contract on the underlying commodity
    `timeToExpiry` - the time until the above contract expires
    `riskFree` - continuously compounded risk free interest rate
    `FuturesOnCommoditiesDemoException`

### convenienceYieldFromCarry

    public double convenienceYieldFromCarry(double commodityPrice,
                                            double futuresPrice,
                                            double costOfCarry,
                                            Date evaluationDate,
                                            Date expiryDate,
                                            BusinessCalendar businessCalendar)
                                     throws FuturesOnCommoditiesDemoException

  Calculates the convenience yield from the cost of carry for a consumption commodity.

  Parameters:
    `commodityPrice` - the price of the underlying consumption commodity
    `futuresPrice` - price of a futures contract on the underlying commodity
    `costOfCarry` - the cost of carry of the commodity
    `evaluationDate` - the date when futures contract is evaluated
    `expiryDate` - the date when the contract expires
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### convenienceYieldFromCarry

    public double convenienceYieldFromCarry(double commodityPrice,
                                            double futuresPrice,
                                            double costOfCarry,
                                            double timeToExpiry)
                                     throws FuturesOnCommoditiesDemoException

  Calculates the convenience yield from the cost of carry for a consumption commodity.

  Parameters:
    `commodityPrice` - the price of the underlying consumption commodity
    `futuresPrice` - price of a futures contract on the underlying commodity
    `timeToExpiry` - the time to expiry of the futures contract
    `costOfCarry` - the cost of carry of the commodity
    `FuturesOnCommoditiesDemoException`

### investmentCommodityWithCarry

    public double investmentCommodityWithCarry(double commodityPrice,
                                               double costOfCarry,
                                               Date evaluationDate,
                                               Date expiryDate,
                                               BusinessCalendar businessCalendar)
                                        throws FuturesOnCommoditiesDemoException

  Calculates the price of an investment commodity.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `costOfCarry` - the cost of carry of the underlying commodity
    `evaluationDate` - the date when futures contract is evaluated
    `expiryDate` - the date when the contract expires
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### investmentCommodityWithCarry

    public double investmentCommodityWithCarry(double commodityPrice,
                                               double costOfCarry,
                                               double timeToExpiry)
                                        throws FuturesOnCommoditiesDemoException

  Calculates the price of an investment commodity.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `costOfCarry` - the cost of carry of the underlying commodity
    `timeToExpiry` - the time period until the futures contract expires
    `FuturesOnCommoditiesDemoException`

### consumptionCommodityWithCarry

    public double consumptionCommodityWithCarry(double commodityPrice,
                                                double convenienceYield,
                                                double costOfCarry,
                                                Date evaluationDate,
                                                Date expiryDate,
                                                BusinessCalendar businessCalendar)
                                         throws FuturesOnCommoditiesDemoException

  Calculates the price of a consumption commodity.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `convenienceYield` - the convenience yield of the commodity
    `costOfCarry` - the cost of carry of the underlying commodity
    `evaluationDate` - the date when futures contract is evaluated
    `expiryDate` - the date when the contract expires
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### consumptionCommodityWithCarry

    public double consumptionCommodityWithCarry(double commodityPrice,
                                                double convenienceYield,
                                                double costOfCarry,
                                                double timeToExpiry)
                                         throws FuturesOnCommoditiesDemoException

  Calculates the price of a consumption commodity.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `convenienceYield` - the convenience yield of the commodity
    `costOfCarry` - the cost of carry of the underlying commodity
    `timeToExpiry` - the time period until the futures contract expires
    `FuturesOnCommoditiesDemoException`

### costOfCarry

    public double costOfCarry(double commodityPrice,
                              double futuresPrice,
                              Date evaluationDate,
                              Date expiryDate,
                              BusinessCalendar businessCalendar)
                       throws FuturesOnCommoditiesDemoException

  Calculates the cost of carry of an investment commodity.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `futuresPrice` - market price of a futures contract on the underlying commodity
    `evaluationDate` - the date when futures contract is evaluated
    `expiryDate` - the date when the contract expires
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### costOfCarry

    public double costOfCarry(double commodityPrice,
                              double futuresPrice,
                              double timeToExpiry)
                       throws FuturesOnCommoditiesDemoException

  Calculates the cost of carry of an investment commodity.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `futuresPrice` - market price of a futures contract on the underlying commodity
    `timeToExpiry` - the time until expiry of the futures contract
    `FuturesOnCommoditiesDemoException`

### costOfCarryForConsumption

    public double costOfCarryForConsumption(double commodityPrice,
                                            double futuresPrice,
                                            double convenienceYield,
                                            Date evaluationDate,
                                            Date expiryDate,
                                            BusinessCalendar businessCalendar)
                                     throws FuturesOnCommoditiesDemoException

  Calculates the cost of carry of a consumption commodity.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `futuresPrice` - the market price of a futures contract on the underlying commodity
    `convenienceYield` - the convenience yield of the commodity
    `evaluationDate` - the date when futures contract is evaluated
    `expiryDate` - the date when the contract expires
    `businessCalendar` - The instance of a `BusinessCalendar` interface implementation. Specify `null` to select the London business calendar.
    `FuturesOnCommoditiesDemoException`

### costOfCarryForConsumption

    public double costOfCarryForConsumption(double commodityPrice,
                                            double futuresPrice,
                                            double convenienceYield,
                                            double timeToExpiry)
                                     throws FuturesOnCommoditiesDemoException

  Calculates the cost of carry of a consumption commodity.

  Parameters:
    `commodityPrice` - the price of the underlying commodity
    `futuresPrice` - the market price of a futures contract on the underlying commodity
    `timeToExpiry` - the time until the expiry of the above futures contract
    `convenienceYield` - the convenience yield of the commodity
    `FuturesOnCommoditiesDemoException`

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