|
WebCab Options and Futures Demo v2.5 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--webcab.lib.finance.futures.Forwards
Within this class we consider the evaluation of forward contracts and the cash flow implications.
| Constructor Summary | |
Forwards()
Creates a new instance. |
|
| Method Summary | |
int |
aggregatePosition(int shortContracts,
int longContracts)
Calculates the aggregate number of futures contract held. |
double |
forwardLongPayOff(double deliveryPrice,
double price,
double contractSize,
double numberHeld)
This function calculates the pay-off from a long forward position at expiry. |
double |
forwardOnCurrencies(double exchangeRate,
double deliveryFX,
double riskFreeForeign,
double riskFreeBase,
Date evaluationDate,
Date maturity,
BusinessCalendar businessCalendar)
Returns the value of a forward foreign exchange contract. |
double |
forwardOnCurrencies(double exchangeRate,
double deliveryFX,
double riskFreeForeign,
double riskFreeBase,
double timeToMaturity)
Returns the value of a forward foreign exchange contract. |
double |
forwardShortPayOff(double deliveryPrice,
double price,
double contractSize,
double numberHeld)
This function calculates the pay-off from a short forward position at expiry. |
double |
longForward(double price,
double deliveryPrice,
double yield,
double riskFree,
Date evaluationDate,
Date maturity,
BusinessCalendar businessCalendar)
Evaluates the value of an long forward contract. |
double |
longForward(double price,
double deliveryPrice,
double yield,
double riskFree,
double timeToMaturity)
Evaluates the value of an long forward contract. |
double |
shortForward(double price,
double deliveryPrice,
double yield,
double riskFree,
Date evaluationDate,
Date maturity,
BusinessCalendar businessCalendar)
Evaluates the value of an short forward contract. |
double |
shortForward(double price,
double deliveryPrice,
double yield,
double riskFree,
double timeToMaturity)
Evaluates the value of an short forward contract. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Forwards()
| Method Detail |
public int aggregatePosition(int shortContracts,
int longContracts)
throws ForwardsDemoException
shortContracts - the number of future contracts sold shortlongContracts - the number of future contracts bought
ForwardsDemoException
public double forwardLongPayOff(double deliveryPrice,
double price,
double contractSize,
double numberHeld)
throws ForwardsDemoException
deliveryPrice - the price at which the asset is deliveredprice - the price of the futures contract at expirycontractSize - the number of underlying assets which are brought by exercising a futures contractnumberHeld - the number of futures held by the investor at expiry
ForwardsDemoException
public double forwardShortPayOff(double deliveryPrice,
double price,
double contractSize,
double numberHeld)
throws ForwardsDemoException
deliveryPrice - the price at which the asset is deliveredprice - the price when the futures contract expirescontractSize - the number of underlying assets which are brought by exercising a futures contractnumberHeld - the number of futures held by the investor at expiry
ForwardsDemoException
public double longForward(double price,
double deliveryPrice,
double yield,
double riskFree,
Date evaluationDate,
Date maturity,
BusinessCalendar businessCalendar)
throws ForwardsDemoException
price - the price of the underlying assetdeliveryPrice - the delivery price at which the underlying asset must be deliveredyield - the yield of the underlying assetriskFree - the risk free interest rateevaluationDate - the date when the forward contracts value is evaluatedmaturity - the date when the forward contract maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ForwardsDemoException
public double longForward(double price,
double deliveryPrice,
double yield,
double riskFree,
double timeToMaturity)
throws ForwardsDemoException
price - the price of the underlying assetdeliveryPrice - the delivery price at which the underlying asset must be deliveredyield - the yield of the underlying assetriskFree - the risk free interest ratetimeToMaturity - the time until the futures contract expires
ForwardsDemoException
public double shortForward(double price,
double deliveryPrice,
double yield,
double riskFree,
Date evaluationDate,
Date maturity,
BusinessCalendar businessCalendar)
throws ForwardsDemoException
price - the price of the underlying assetdeliveryPrice - the delivery price at which the underlying asset must be deliveredyield - the yield of the underlying assetriskFree - the risk free interest rateevaluationDate - the date when the forward contract's value is evaluatedmaturity - the date when the forward contract maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ForwardsDemoException
public double shortForward(double price,
double deliveryPrice,
double yield,
double riskFree,
double timeToMaturity)
throws ForwardsDemoException
price - the price of the underlying assetdeliveryPrice - the delivery price at which the underlying asset must be deliveredyield - the yield of the underlying assetriskFree - the risk free interest ratetimeToMaturity - the time until the futures contract expires
ForwardsDemoException
public double forwardOnCurrencies(double exchangeRate,
double deliveryFX,
double riskFreeForeign,
double riskFreeBase,
Date evaluationDate,
Date maturity,
BusinessCalendar businessCalendar)
throws ForwardsDemoException
exchangeRate - the exchange rate between the two currenciesdeliveryFX - the exchange rate at which the forward contract will be settledriskFreeBase - the risk free interest rate in the domestic currencyriskFreeForeign - the risk free interest rate in the foreign currencyevaluationDate - the date when the forward foreign exchange contract's value is evaluatedmaturity - the date when the forward foreign exchange contract maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ForwardsDemoException
public double forwardOnCurrencies(double exchangeRate,
double deliveryFX,
double riskFreeForeign,
double riskFreeBase,
double timeToMaturity)
throws ForwardsDemoException
exchangeRate - the exchange rate between the two currenciesdeliveryFX - the exchange rate at which the forward contract will be settledriskFreeBase - the risk free interest rate in the domestic currencyriskFreeForeign - the risk free interest rate in the foreign currencytimeToMaturity - the time to maturity of the futures contract
ForwardsDemoException
|
WebCab Options and Futures Demo v2.5 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||