31 ext::shared_ptr<Payoff>
payoff,
32 const Date& valueDate,
33 const Date& maturityDate,
35 : dayCounter_(
std::move(dayCounter)), calendar_(
std::move(calendar)),
36 businessDayConvention_(businessDayConvention), settlementDays_(settlementDays),
37 payoff_(
std::move(
payoff)), valueDate_(valueDate), maturityDate_(maturityDate),
86 "null term structure set to Forward");
88 ext::shared_ptr<ForwardTypePayoff> ftpayoff =
89 ext::dynamic_pointer_cast<ForwardTypePayoff>(
payoff_);
const YieldTermStructure & discountCurve_
Date adjust(const Date &, BusinessDayConvention convention=Following) const
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
virtual bool hasOccurred(const Date &refDate=Date(), ext::optional< bool > includeRefDate=ext::nullopt) const
returns true if an event has already occurred before a date
Forward(DayCounter dayCounter, Calendar calendar, BusinessDayConvention businessDayConvention, Natural settlementDays, ext::shared_ptr< Payoff > payoff, const Date &valueDate, const Date &maturityDate, Handle< YieldTermStructure > discountCurve=Handle< YieldTermStructure >())
void performCalculations() const override
Real underlyingSpotValue_
Handle< YieldTermStructure > discountCurve_
bool isExpired() const override
returns whether the instrument is still tradable.
const DayCounter & dayCounter() const
ext::shared_ptr< Payoff > payoff_
InterestRate impliedYield(Real underlyingSpotValue, Real forwardValue, Date settlementDate, Compounding compoundingConvention, const DayCounter &dayCounter)
virtual Real forwardValue() const
forward value/price of underlying, discounting income/dividends
virtual Real spotIncome(const Handle< YieldTermStructure > &incomeDiscountCurve) const =0
NPV of income/dividends/storage-costs etc. of underlying instrument.
virtual Date settlementDate() const
Date maturityDate_
maturityDate of the forward contract or delivery date of underlying
Handle< YieldTermStructure > incomeDiscountCurve_
BusinessDayConvention businessDayConvention_
Shared handle to an observable.
void calculate() const override
Concrete interest rate class.
static InterestRate impliedRate(Real compound, const DayCounter &resultDC, Compounding comp, Frequency freq, Time t)
implied interest rate for a given compound factor at a given time.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
static Settings & instance()
access to the unique instance
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Base class for events associated with a given date.
const ext::shared_ptr< Payoff > payoff_
BusinessDayConvention
Business Day conventions.
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer
ext::shared_ptr< QuantLib::Payoff > payoff
Compounding
Interest rate coumpounding rule.
Interest-rate term structure.