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

Pricer for equity coupons. More...

#include <qle/cashflows/equitycouponpricer.hpp>

+ Inheritance diagram for EquityCouponPricer:
+ Collaboration diagram for EquityCouponPricer:

Classes

struct  AdditionalResultCache
 

Public Member Functions

virtual ~EquityCouponPricer ()
 
Interface
virtual Rate swapletRate ()
 
virtual void initialize (const EquityCoupon &coupon)
 
const AdditionalResultCacheadditionalResultCache () const
 

Observer interface

const EquityCouponcoupon_
 
QuantLib::ext::shared_ptr< QuantExt::EquityIndex2equityCurve_
 
QuantLib::ext::shared_ptr< FxIndexfxIndex_
 
EquityReturnType returnType_
 
Real dividendFactor_
 
AdditionalResultCache additionalResultCache_
 
virtual void update () override
 

Detailed Description

Pricer for equity coupons.

Definition at line 36 of file equitycouponpricer.hpp.

Constructor & Destructor Documentation

◆ ~EquityCouponPricer()

virtual ~EquityCouponPricer ( )
virtual

Definition at line 52 of file equitycouponpricer.hpp.

52{}

Member Function Documentation

◆ swapletRate()

Rate swapletRate ( )
virtual

Definition at line 35 of file equitycouponpricer.cpp.

35 {
37
38 // Start fixing shouldn't include dividends as the assumption of continuous dividends means they will have been paid
39 // as they accrued in the previous period (or at least at the end when performance is measured).
42
43 // fx rates at start and end, at start we only convert if the initial price is not already in target ccy
47
48 Real dividends = 0.0;
49
50 // Dividends that are already fixed dividends + yield accrued over remaining period.
51 // yield accrued = Forward without dividend yield - Forward with dividend yield
53 // projected dividends from today until the fixing end date
56 // subtract projected dividends from today until the fixing start date
57 if (coupon_->fixingStartDate() > Settings::instance().evaluationDate()) {
61 }
63 // add historical dividends
65 equityCurve_->dividendsBetweenDates(coupon_->fixingStartDate(), coupon_->fixingEndDate());
67 }
68
70 return dividends;
76 else
80}
bool initialPriceIsInTargetCcy() const
initial price is in target ccy (if applicable, i.e. if fxIndex != null, otherwise ignored)
Date fixingEndDate() const
The date at which performance is measured.
Date fixingStartDate() const
The date at which the starting equity price is fixed.
Real initialPrice() const
initial price
QuantLib::ext::shared_ptr< QuantExt::EquityIndex2 > equityCurve_
QuantLib::ext::shared_ptr< FxIndex > fxIndex_
AdditionalResultCache additionalResultCache_
+ Here is the call graph for this function:

◆ initialize()

void initialize ( const EquityCoupon coupon)
virtual

Definition at line 82 of file equitycouponpricer.cpp.

82 {
83
84 coupon_ = &coupon;
85
86 equityCurve_ = QuantLib::ext::dynamic_pointer_cast<QuantExt::EquityIndex2>(coupon.equityCurve());
87 fxIndex_ = QuantLib::ext::dynamic_pointer_cast<FxIndex>(coupon.fxIndex());
88 returnType_ = coupon.returnType();
89 dividendFactor_ = coupon.dividendFactor();
90}
+ Here is the call graph for this function:

◆ additionalResultCache()

const AdditionalResultCache & additionalResultCache ( ) const

Definition at line 57 of file equitycouponpricer.hpp.

57{ return additionalResultCache_; };

◆ update()

virtual void update ( )
overridevirtual

Definition at line 62 of file equitycouponpricer.hpp.

62{ notifyObservers(); }

Member Data Documentation

◆ coupon_

const EquityCoupon* coupon_
protected

Definition at line 65 of file equitycouponpricer.hpp.

◆ equityCurve_

QuantLib::ext::shared_ptr<QuantExt::EquityIndex2> equityCurve_
protected

Definition at line 66 of file equitycouponpricer.hpp.

◆ fxIndex_

QuantLib::ext::shared_ptr<FxIndex> fxIndex_
protected

Definition at line 67 of file equitycouponpricer.hpp.

◆ returnType_

EquityReturnType returnType_
protected

Definition at line 68 of file equitycouponpricer.hpp.

◆ dividendFactor_

Real dividendFactor_
protected

Definition at line 69 of file equitycouponpricer.hpp.

◆ additionalResultCache_

AdditionalResultCache additionalResultCache_
protected

Definition at line 70 of file equitycouponpricer.hpp.