24#ifndef quantlib_forward_hpp
25#define quantlib_forward_hpp
116 ext::shared_ptr<Payoff>
payoff,
117 const Date& valueDate,
118 const Date& maturityDate,
155 std::string
name()
const override {
return "Forward"; }
190 std::ostringstream result;
191 result <<
name() <<
", " <<
strike() <<
" strike";
202 QL_FAIL(
"unknown/illegal position type");
Abstract base forward class.
virtual Real spotValue() const =0
returns spot value/price of an underlying financial instrument
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_
Handle< YieldTermStructure > discountCurve() const
term structure relevant to the contract (e.g. repo curve)
const Calendar & calendar() const
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
BusinessDayConvention businessDayConvention() const
Date maturityDate_
maturityDate of the forward contract or delivery date of underlying
Handle< YieldTermStructure > incomeDiscountCurve() const
term structure that discounts the underlying's income cash flows
Handle< YieldTermStructure > incomeDiscountCurve_
BusinessDayConvention businessDayConvention_
Class for forward type payoffs.
Real operator()(Real price) const override
std::string description() const override
std::string name() const override
Position::Type forwardType() const
ForwardTypePayoff(Position::Type type, Real strike)
Shared handle to an observable.
Abstract instrument class.
Concrete interest rate class.
Abstract base class for option payoffs.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
Globally accessible relinkable pointer.
Abstract instrument class.
ext::shared_ptr< QuantLib::Payoff > payoff
Compounding
Interest rate coumpounding rule.
Interest-rate term structure.