Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
ForwardBond Class Reference

Forward Bond class. More...

#include <qle/instruments/forwardbond.hpp>

+ Inheritance diagram for ForwardBond:
+ Collaboration diagram for ForwardBond:

Classes

class  arguments
 
class  engine
 
class  results
 

Public Member Functions

 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. More...
 
 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. More...
 
Instrument interface
bool isExpired () const override
 
void setupArguments (PricingEngine::arguments *) const override
 
void fetchResults (const PricingEngine::results *) const override
 

Inspectors

QuantLib::ext::shared_ptr< QuantLib::Bond > underlying_
 
QuantLib::ext::shared_ptr< Payoffpayoff_
 
Real lockRate_
 
DayCounter lockRateDayCounter_
 
boost::optional< boollongInForward_
 
Date fwdMaturityDate_
 
Date fwdSettlementDate_
 
bool isPhysicallySettled_
 
bool settlementDirty_
 
Real compensationPayment_
 
Date compensationPaymentDate_
 
Real bondNotional_
 
Real dv01_
 
Real underlyingIncome_
 
Real underlyingSpotValue_
 
Real forwardValue_
 
const QuantLib::ext::shared_ptr< QuantLib::Bond > & underlying ()
 

Detailed Description

Forward Bond class.

Definition at line 41 of file forwardbond.hpp.

Constructor & Destructor Documentation

◆ ForwardBond() [1/2]

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() [2/2]

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.

Member Function Documentation

◆ isExpired()

bool isExpired ( ) const
override

Definition at line 46 of file forwardbond.cpp.

46{ return detail::simple_event(fwdMaturityDate_).hasOccurred(); }

◆ setupArguments()

void setupArguments ( PricingEngine::arguments *  args) const
override

Definition at line 48 of file forwardbond.cpp.

48 {
49 ForwardBond::arguments* arguments = dynamic_cast<ForwardBond::arguments*>(args);
50 QL_REQUIRE(arguments != 0, "wrong argument type in forward bond");
51 arguments->underlying = underlying_;
52 arguments->payoff = payoff_;
53 arguments->lockRate = lockRate_;
54 arguments->lockRateDayCounter = lockRateDayCounter_;
55 arguments->longInForward = longInForward_;
56 arguments->fwdMaturityDate = fwdMaturityDate_;
57 arguments->fwdSettlementDate = fwdSettlementDate_;
58 arguments->isPhysicallySettled = isPhysicallySettled_;
59 arguments->settlementDirty = settlementDirty_;
60 arguments->compensationPayment = compensationPayment_;
61 arguments->compensationPaymentDate = compensationPaymentDate_;
62 arguments->bondNotional = bondNotional_;
63 arguments->dv01 = dv01_;
64}
DayCounter lockRateDayCounter_
Definition: forwardbond.hpp:74
boost::optional< bool > longInForward_
Definition: forwardbond.hpp:75
QuantLib::ext::shared_ptr< Payoff > payoff_
Definition: forwardbond.hpp:72
QuantLib::ext::shared_ptr< QuantLib::Bond > underlying_
Definition: forwardbond.hpp:71

◆ fetchResults()

void fetchResults ( const PricingEngine::results *  r) const
override

Definition at line 73 of file forwardbond.cpp.

73 {
74 Instrument::fetchResults(r);
75 const ForwardBond::results* results = dynamic_cast<const ForwardBond::results*>(r);
76 QL_REQUIRE(results, "wrong result type");
77 forwardValue_ = results->forwardValue;
78 underlyingSpotValue_ = results->underlyingSpotValue;
79 underlyingIncome_ = results->underlyingIncome;
80}

◆ underlying()

const QuantLib::ext::shared_ptr< QuantLib::Bond > & underlying ( )

Definition at line 67 of file forwardbond.hpp.

67{ return underlying_; }

Member Data Documentation

◆ underlying_

QuantLib::ext::shared_ptr<QuantLib::Bond> underlying_
private

Definition at line 71 of file forwardbond.hpp.

◆ payoff_

QuantLib::ext::shared_ptr<Payoff> payoff_
private

Definition at line 72 of file forwardbond.hpp.

◆ lockRate_

Real lockRate_
private

Definition at line 73 of file forwardbond.hpp.

◆ lockRateDayCounter_

DayCounter lockRateDayCounter_
private

Definition at line 74 of file forwardbond.hpp.

◆ longInForward_

boost::optional<bool> longInForward_
private

Definition at line 75 of file forwardbond.hpp.

◆ fwdMaturityDate_

Date fwdMaturityDate_
private

Definition at line 76 of file forwardbond.hpp.

◆ fwdSettlementDate_

Date fwdSettlementDate_
private

Definition at line 77 of file forwardbond.hpp.

◆ isPhysicallySettled_

bool isPhysicallySettled_
private

Definition at line 78 of file forwardbond.hpp.

◆ settlementDirty_

bool settlementDirty_
private

Definition at line 79 of file forwardbond.hpp.

◆ compensationPayment_

Real compensationPayment_
private

Definition at line 80 of file forwardbond.hpp.

◆ compensationPaymentDate_

Date compensationPaymentDate_
private

Definition at line 81 of file forwardbond.hpp.

◆ bondNotional_

Real bondNotional_
private

Definition at line 82 of file forwardbond.hpp.

◆ dv01_

Real dv01_
private

Definition at line 83 of file forwardbond.hpp.

◆ underlyingIncome_

Real underlyingIncome_
mutableprivate

Definition at line 84 of file forwardbond.hpp.

◆ underlyingSpotValue_

Real underlyingSpotValue_
mutableprivate

Definition at line 85 of file forwardbond.hpp.

◆ forwardValue_

Real forwardValue_
mutableprivate

Definition at line 86 of file forwardbond.hpp.