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

Discounting Bond Repo Engine. More...

#include <qle/pricingengines/discountingbondrepoengine.hpp>

+ Inheritance diagram for DiscountingBondRepoEngine:
+ Collaboration diagram for DiscountingBondRepoEngine:

Public Member Functions

 DiscountingBondRepoEngine (const Handle< YieldTermStructure > &repoCurve, const bool includeSecurityLeg=true)
 
void calculate () const override
 
const Handle< YieldTermStructure > & repoCurve () const
 

Private Attributes

const Handle< YieldTermStructure > repoCurve_
 
const bool includeSecurityLeg_
 

Detailed Description

Discounting Bond Repo Engine.

Definition at line 30 of file discountingbondrepoengine.hpp.

Constructor & Destructor Documentation

◆ DiscountingBondRepoEngine()

DiscountingBondRepoEngine ( const Handle< YieldTermStructure > &  repoCurve,
const bool  includeSecurityLeg = true 
)

Definition at line 25 of file discountingbondrepoengine.cpp.

27 : repoCurve_(repoCurve), includeSecurityLeg_(includeSecurityLeg) {}
const Handle< YieldTermStructure > & repoCurve() const
const Handle< YieldTermStructure > repoCurve_

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 29 of file discountingbondrepoengine.cpp.

29 {
30 QL_REQUIRE(!repoCurve_.empty(), "DiscountingBondRepoEngine::calculate(): repoCurve_ is empty()");
31 Real multiplier = arguments_.cashLegPays ? -1.0 : 1.0;
32 Real cashLegNpv = multiplier * CashFlows::npv(arguments_.cashLeg, **repoCurve_, false);
33 Real securityLegNpv = -multiplier * arguments_.security->NPV() * arguments_.securityMultiplier;
34 results_.additionalResults["CashLegNPV"] = cashLegNpv;
35 results_.additionalResults["SecurityLegNPV"] = securityLegNpv;
36 results_.value = cashLegNpv + (includeSecurityLeg_ ? securityLegNpv : 0.0);
37}
const Instrument::results * results_
Definition: cdsoption.cpp:81
Swap::arguments * arguments_

◆ repoCurve()

const Handle< YieldTermStructure > & repoCurve ( ) const

Definition at line 36 of file discountingbondrepoengine.hpp.

36{ return repoCurve_; }

Member Data Documentation

◆ repoCurve_

const Handle<YieldTermStructure> repoCurve_
private

Definition at line 39 of file discountingbondrepoengine.hpp.

◆ includeSecurityLeg_

const bool includeSecurityLeg_
private

Definition at line 40 of file discountingbondrepoengine.hpp.