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

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

#include <qle/pricingengines/analyticdoublebarrierengine.hpp>

+ Inheritance diagram for AnalyticDoubleBarrierEngine:
+ Collaboration diagram for AnalyticDoubleBarrierEngine:

Public Member Functions

 AnalyticDoubleBarrierEngine (ext::shared_ptr< GeneralizedBlackScholesProcess > process, const Date &paymentDate, int series=5)
 
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 analyticdoublebarrierengine.hpp.

Constructor & Destructor Documentation

◆ AnalyticDoubleBarrierEngine()

AnalyticDoubleBarrierEngine ( ext::shared_ptr< GeneralizedBlackScholesProcess >  process,
const Date &  paymentDate,
int  series = 5 
)

Definition at line 27 of file analyticdoublebarrierengine.cpp.

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

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 33 of file analyticdoublebarrierengine.cpp.

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

Member Data Documentation

◆ process_

ext::shared_ptr<GeneralizedBlackScholesProcess> process_
private

Definition at line 43 of file analyticdoublebarrierengine.hpp.

◆ paymentDate_

Date paymentDate_
private

Definition at line 44 of file analyticdoublebarrierengine.hpp.