Class Forward
- java.lang.Object
-
- org.jquantlib.util.LazyObject
-
- org.jquantlib.instruments.Instrument
-
- org.jquantlib.instruments.Forward
-
- All Implemented Interfaces:
- Observable, Observer
- Direct Known Subclasses:
- ForwardRateAgreement
public abstract class Forward extends Instrument
Abstract base forward classDerived classes must implement the virtual functions spotValue() (NPV or spot price) and spotIncome() associated with the specific relevant underlying (e.g. bond, stock, commodity, loan/deposit). These functions must be used to set the protected member variables underlyingSpotValue_ and underlyingIncome_ within performCalculations() in the derived class before the base-class implementation is called.
spotIncome() refers generically to the present value of coupons, dividends or storage costs.
discountCurve_ is the curve used to discount forward contract cash flows back to the evaluation day, as well as to obtain forward values for spot values/prices.
incomeDiscountCurve_, which for generality is not automatically set to the discountCurve_, is the curve used to discount future income/dividends/storage-costs etc back to the evaluation date.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jquantlib.instruments.Instrument
Instrument.Arguments, Instrument.Results, Instrument.ResultsImpl
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description BusinessDayConventionbusinessDayConvention()Calendarcalendar()DayCounterdayCounter()Handle<YieldTermStructure>discountCurve()doubleforwardValue()InterestRateimpliedYield(double underlyingSpotValue, double forwardValue, Date settlementDate, Compounding compoundingConvention, DayCounter dayCounter)Simple yield calculation based on underlying spot and forward values, taking into account underlying income.Handle<YieldTermStructure>incomeDiscountCurve()booleanisExpired()voidperformCalculations()This method performs the actual calculations and set any needed results.DatesettlementDate()abstract doublespotIncome(Handle<YieldTermStructure> incomeDiscountCurve)abstract doublespotValue()-
Methods inherited from class org.jquantlib.instruments.Instrument
errorEstimate, NPV, setPricingEngine
-
Methods inherited from class org.jquantlib.util.LazyObject
addObserver, countObservers, deleteObserver, deleteObservers, freeze, getObservers, notifyObservers, notifyObservers, recalculate, unfreeze, update
-
-
-
-
Method Detail
-
spotValue
public abstract double spotValue()
-
spotIncome
public abstract double spotIncome(Handle<YieldTermStructure> incomeDiscountCurve)
-
forwardValue
public double forwardValue()
-
impliedYield
public InterestRate impliedYield(double underlyingSpotValue, double forwardValue, Date settlementDate, Compounding compoundingConvention, DayCounter dayCounter)
Simple yield calculation based on underlying spot and forward values, taking into account underlying income.When \f$ t>0 \f$, call with:
underlyingSpotValue=spotValue(t); forwardValue=strikePrice;
to get current yield. For a repo, if , impliedYield should reproduce the spot repo rate. For FRA's, this should reproduce the relevant zero rate at the FRA's maturity date;
-
businessDayConvention
public BusinessDayConvention businessDayConvention()
-
calendar
public Calendar calendar()
-
settlementDate
public Date settlementDate()
-
dayCounter
public DayCounter dayCounter()
-
discountCurve
public Handle<YieldTermStructure> discountCurve()
-
incomeDiscountCurve
public Handle<YieldTermStructure> incomeDiscountCurve()
-
performCalculations
public void performCalculations()
Description copied from class:InstrumentThis method performs the actual calculations and set any needed results.- See Also:
LazyObject.performCalculations()
-
isExpired
public boolean isExpired()
- Specified by:
isExpiredin classInstrument- Returns:
trueif the instrument is still tradeable.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG