23#ifndef quantext_forwardbond_hpp
24#define quantext_forwardbond_hpp
26#include <ql/handle.hpp>
27#include <ql/instrument.hpp>
28#include <ql/instruments/bond.hpp>
29#include <ql/interestrate.hpp>
30#include <ql/payoff.hpp>
31#include <ql/position.hpp>
32#include <ql/termstructures/yieldtermstructure.hpp>
33#include <ql/time/calendar.hpp>
34#include <ql/time/daycounter.hpp>
35#include <ql/types.hpp>
47 ForwardBond(
const QuantLib::ext::shared_ptr<QuantLib::Bond>&
underlying,
const QuantLib::ext::shared_ptr<Payoff>& payoff,
48 const Date& fwdMaturityDate,
const Date& fwdSettlementDate,
const bool isPhysicallySettled,
49 const bool settlementDirty,
const Real compensationPayment,
const Date compensationPaymentDate,
50 const Real bondNotional = 1.0);
53 const DayCounter& lockRateDayCounter,
const bool longInForward,
const Date& fwdMaturityDate,
54 const Date& fwdSettlementDate,
const bool isPhysicallySettled,
const bool settlementDirty,
55 const Real compensationPayment,
const Date compensationPaymentDate,
const Real bondNotional = 1.0,
56 const Real dv01 = Null<Real>());
62 void fetchResults(
const PricingEngine::results*)
const override;
72 QuantLib::ext::shared_ptr<Payoff>
payoff_;
93 QuantLib::ext::shared_ptr<Payoff>
payoff;
114 void reset()
override;
121 QL_REQUIRE(
strike >= 0.0,
"negative strike given");
127 std::string
name()
const override {
return "ForwardBond"; }
138 std::ostringstream result;
139 result <<
name() <<
", " <<
strike() <<
" strike";
147 case Position::Short:
150 QL_FAIL(
"unknown/illegal position type");
Date compensationPaymentDate
DayCounter lockRateDayCounter
boost::optional< bool > longInForward
QuantLib::ext::shared_ptr< Payoff > payoff
QuantLib::ext::shared_ptr< QuantLib::Bond > underlying
void validate() const override
Real underlyingSpotValue_
DayCounter lockRateDayCounter_
void setupArguments(PricingEngine::arguments *) const override
bool isExpired() const override
Date compensationPaymentDate_
bool isPhysicallySettled_
boost::optional< bool > longInForward_
Real compensationPayment_
QuantLib::ext::shared_ptr< Payoff > payoff_
void fetchResults(const PricingEngine::results *) const override
ForwardBond(const QuantLib::ext::shared_ptr< QuantLib::Bond > &underlying, const QuantLib::ext::shared_ptr< Payoff > &payoff, const Date &fwdMaturityDate, const Date &fwdSettlementDate, const bool isPhysicallySettled, const bool settlementDirty, const Real compensationPayment, const Date compensationPaymentDate, const Real bondNotional=1.0)
Constructor vanilla forward bond.
ForwardBond(const QuantLib::ext::shared_ptr< QuantLib::Bond > &underlying, const Real lockRate, const DayCounter &lockRateDayCounter, const bool longInForward, const Date &fwdMaturityDate, const Date &fwdSettlementDate, const bool isPhysicallySettled, const bool settlementDirty, const Real compensationPayment, const Date compensationPaymentDate, const Real bondNotional=1.0, const Real dv01=Null< Real >())
Constructor for tlocks with lock rate.
const QuantLib::ext::shared_ptr< QuantLib::Bond > & underlying()
QuantLib::ext::shared_ptr< QuantLib::Bond > underlying_
Class for forward type payoffs.
Real operator()(Real price) const override
std::string description() const override
ForwardBondTypePayoff(Position::Type type, Real strike)
std::string name() const override
Position::Type forwardType() const