24#ifndef quantlib_forward_hpp
25#define quantlib_forward_hpp
27#include <ql/instrument.hpp>
28#include <ql/position.hpp>
29#include <ql/time/calendar.hpp>
30#include <ql/time/daycounter.hpp>
31#include <ql/interestrate.hpp>
32#include <ql/types.hpp>
33#include <ql/handle.hpp>
34#include <ql/payoff.hpp>
35#include <ql/termstructures/yieldtermstructure.hpp>
116 ext::shared_ptr<Payoff> payoff,
117 const Date& valueDate,
118 const Date& maturityDate,
149 QL_REQUIRE(
strike >= 0.0,
"negative strike given");
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.
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
Compounding
Interest rate coumpounding rule.