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

webcab.lib.finance.futures
Class FuturesEvaluation

java.lang.Object
  |
  +--webcab.lib.finance.futures.FuturesEvaluation
All Implemented Interfaces:
Serializable

public class FuturesEvaluation
extends Object
implements Serializable

Within this class we consider evaluation of futures contracts on stocks, bonds and indexes.

See Also:
Serialized Form

Constructor Summary
FuturesEvaluation()
          Creates a new instance.
 
Method Summary
 int aggregatePosition(int shortContracts, int longConctracts)
          Calculates the aggregate number of futures contract held.
 double futureOnCurrencies(double exchangeRate, double riskFreeForeign, double riskFreeBase, Date evaluationDate, Date maturityDate, BusinessCalendar businessCalendar)
          Calculates the price of a futures contract on currencies.
 double futureOnCurrencies(double exchangeRate, double riskFreeForeign, double riskFreeBase, double timeToMaturity)
          Calculates the price of a futures contract on currencies.
 double futureOnIndex(double indexValue, double yield, double riskFree, Date evaluationDate, Date maturityDate, BusinessCalendar businessCalendar)
          Calculates the price of a index future.
 double futureOnIndex(double indexValue, double yield, double riskFree, double timeToMaturity)
          Calculates the price of a index future.
 double futuresPriceNoIncome(double price, double riskFree, Date evaluationDate, Date maturityDate, BusinessCalendar businessCalendar)
          Evaluates the futures price on an asset which does not pay an income.
 double futuresPriceNoIncome(double price, double riskFree, double timeToMaturity)
          Evaluates the futures price on an asset which does not pay an income.
 double futuresPriceWithDividend(double price, double yield, double riskFree, Date evaluationDate, Date maturityDate, BusinessCalendar businessCalendar)
          Evaluates the future price on an asset which has a continuous yield.
 double futuresPriceWithDividend(double price, double yield, double riskFree, double timeToMaturity)
          Evaluates the future price on an asset which has a continuous yield.
 double futuresPriceWithIncome(double price, double income, double riskFree, Date evaluationDate, Date maturityDate, BusinessCalendar businessCalendar)
          Evaluates the futures price on an asset which pays a known income during the life of the contract.
 double futuresPriceWithIncome(double price, double income, double riskFree, double timeToMaturity)
          Evaluates the futures price on an asset which pays a known income during the life of the contract.
 double gearing(double margin)
          Calculates the effective gearing factor from holding an exchange traded futures contract.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FuturesEvaluation

public FuturesEvaluation()
Creates a new instance.

Method Detail

aggregatePosition

public int aggregatePosition(int shortContracts,
                             int longConctracts)
                      throws FuturesEvaluationDemoException
Calculates the aggregate number of futures contract held.

Parameters:
shortContracts - the number of future contracts sold short
FuturesEvaluationDemoException

futuresPriceNoIncome

public double futuresPriceNoIncome(double price,
                                   double riskFree,
                                   Date evaluationDate,
                                   Date maturityDate,
                                   BusinessCalendar businessCalendar)
                            throws FuturesEvaluationDemoException
Evaluates the futures price on an asset which does not pay an income.

Parameters:
price - the present price of an asset
riskFree - the continuously compounded risk free interest rate during the life of the futures contract
evaluationDate - the date when the futures contract is evaluated
maturityDate - the date when the futures contract matures
businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
FuturesEvaluationDemoException

futuresPriceNoIncome

public double futuresPriceNoIncome(double price,
                                   double riskFree,
                                   double timeToMaturity)
                            throws FuturesEvaluationDemoException
Evaluates the futures price on an asset which does not pay an income.

Parameters:
price - the present price of an asset
riskFree - the continuously compounded risk free interest rate during the life of the futures contract
timeToMaturity - the time period (in years) until the futures contract expires
FuturesEvaluationDemoException

futuresPriceWithIncome

public double futuresPriceWithIncome(double price,
                                     double income,
                                     double riskFree,
                                     Date evaluationDate,
                                     Date maturityDate,
                                     BusinessCalendar businessCalendar)
                              throws FuturesEvaluationDemoException
Evaluates the futures price on an asset which pays a known income during the life of the contract. This could be a futures contract on a bond or dividend paying stock.

Parameters:
price - the present price of an asset
income - the present value of the income from the underlying asset during the life of the future contract
riskFree - the continuously compounded risk free interest rate during the life of the future contract
evaluationDate - the date when the futures contract is evaluated
maturityDate - the date when the futures contract matures
businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
FuturesEvaluationDemoException

futuresPriceWithIncome

public double futuresPriceWithIncome(double price,
                                     double income,
                                     double riskFree,
                                     double timeToMaturity)
                              throws FuturesEvaluationDemoException
Evaluates the futures price on an asset which pays a known income during the life of the contract. This could be a futures contract on a bond or dividend paying stock.

Parameters:
price - the present price of an asset
income - the present value of the income from the underlying asset during the life of the future contract
riskFree - the continuously compounded risk free interest rate during the life of the future contract
timeToMaturity - the time period (in years) until the futures contract expires
FuturesEvaluationDemoException

futuresPriceWithDividend

public double futuresPriceWithDividend(double price,
                                       double yield,
                                       double riskFree,
                                       Date evaluationDate,
                                       Date maturityDate,
                                       BusinessCalendar businessCalendar)
                                throws FuturesEvaluationDemoException
Evaluates the future price on an asset which has a continuous yield.

Parameters:
price - the present price of the underlying asset
yield - the continuously compounded yield from the underlying asset
riskFree - the continuously compounded risk free interest rate during the life of the futures contract
evaluationDate - the date when the futures contract is evaluated
maturityDate - the date when the futures contract matures
businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
FuturesEvaluationDemoException

futuresPriceWithDividend

public double futuresPriceWithDividend(double price,
                                       double yield,
                                       double riskFree,
                                       double timeToMaturity)
                                throws FuturesEvaluationDemoException
Evaluates the future price on an asset which has a continuous yield.

Parameters:
price - the present price of the underlying asset
yield - the continuously compounded yield from the underlying asset
riskFree - the continuously compounded risk free interest rate during the life of the futures contract
timeToMaturity - the time until the futures contract expires
FuturesEvaluationDemoException

futureOnIndex

public double futureOnIndex(double indexValue,
                            double yield,
                            double riskFree,
                            Date evaluationDate,
                            Date maturityDate,
                            BusinessCalendar businessCalendar)
                     throws FuturesEvaluationDemoException
Calculates the price of a index future.

Parameters:
indexValue - the value of the index
riskFree - the continuously compounded risk free interest rate
yield - the average yield of the index during the life of the futures contract
evaluationDate - the date when the futures contract is evaluated
maturityDate - the date when the futures contract matures
businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
FuturesEvaluationDemoException

futureOnIndex

public double futureOnIndex(double indexValue,
                            double yield,
                            double riskFree,
                            double timeToMaturity)
                     throws FuturesEvaluationDemoException
Calculates the price of a index future.

Parameters:
indexValue - the value of the index
riskFree - the continuously compounded risk free interest rate
yield - the average yield of the index during the life of the futures contract
timeToMaturity - time to maturity of the futures contract
FuturesEvaluationDemoException

futureOnCurrencies

public double futureOnCurrencies(double exchangeRate,
                                 double riskFreeForeign,
                                 double riskFreeBase,
                                 Date evaluationDate,
                                 Date maturityDate,
                                 BusinessCalendar businessCalendar)
                          throws FuturesEvaluationDemoException
Calculates the price of a futures contract on currencies.

Parameters:
exchangeRate - the exchange rate between the two currencies
riskFreeBase - the risk free interest rate in the domestic currency
riskFreeForeign - the risk free interest rate in the foreign currency
evaluationDate - the date when the futures contract is evaluated
maturityDate - the date when the futures contract matures
businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
FuturesEvaluationDemoException

futureOnCurrencies

public double futureOnCurrencies(double exchangeRate,
                                 double riskFreeForeign,
                                 double riskFreeBase,
                                 double timeToMaturity)
                          throws FuturesEvaluationDemoException
Calculates the price of a futures contract on currencies.

Parameters:
exchangeRate - the exchange rate between the two currencies
riskFreeBase - the risk free interest rate in the domestic currency
riskFreeForeign - the risk free interest rate in the foreign currency
timeToMaturity - the time to maturity of the futures contract
FuturesEvaluationDemoException

gearing

public double gearing(double margin)
               throws FuturesEvaluationDemoException
Calculates the effective gearing factor from holding an exchange traded futures contract.

Parameters:
margin - the margin required in percent (i.e. 4% for FX positions) in order to hold the futures contract.
FuturesEvaluationDemoException

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