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

Wrapper engine for the QuantLib engine to take settlement delay into account. More...

#include <qle/pricingengines/analyticbarrierengine.hpp>

+ Inheritance diagram for AnalyticBarrierEngine:
+ Collaboration diagram for AnalyticBarrierEngine:

Public Member Functions

 AnalyticBarrierEngine (ext::shared_ptr< GeneralizedBlackScholesProcess > process, const Date &paymentDate)
 
void calculate () const override
 

Private Attributes

ext::shared_ptr< GeneralizedBlackScholesProcess > process_
 
Date paymentDate_
 

Detailed Description

Wrapper engine for the QuantLib engine to take settlement delay into account.

Definition at line 36 of file analyticbarrierengine.hpp.

Constructor & Destructor Documentation

◆ AnalyticBarrierEngine()

AnalyticBarrierEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess >  process,
const Date &  paymentDate 
)

Definition at line 27 of file analyticbarrierengine.cpp.

28 : QuantLib::AnalyticBarrierEngine(process), process_(std::move(process)), paymentDate_(paymentDate) {
29 registerWith(process_);
30}
ext::shared_ptr< GeneralizedBlackScholesProcess > process_

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 32 of file analyticbarrierengine.cpp.

32 {
33 QuantLib::AnalyticBarrierEngine::calculate();
34
35 // If a payDate was provided (and is greater than the expiryDate)
36 if (paymentDate_ > arguments_.exercise->lastDate()) {
37 Rate payDateDiscount = process_->riskFreeRate()->discount(paymentDate_);
38 Rate expiryDateDiscount = process_->riskFreeRate()->discount(arguments_.exercise->lastDate());
39 Rate factor = payDateDiscount / expiryDateDiscount;
40 results_.value *= factor;
41 }
42
43 if (paymentDate_ != Date())
44 results_.additionalResults["settlementDate"] = paymentDate_;
45}
const Instrument::results * results_
Definition: cdsoption.cpp:81
Swap::arguments * arguments_

Member Data Documentation

◆ process_

ext::shared_ptr<GeneralizedBlackScholesProcess> process_
private

Definition at line 42 of file analyticbarrierengine.hpp.

◆ paymentDate_

Date paymentDate_
private

Definition at line 43 of file analyticbarrierengine.hpp.