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

Discounting Equity Forward Engine. More...

#include <qle/pricingengines/discountingequityforwardengine.hpp>

+ Inheritance diagram for DiscountingEquityForwardEngine:
+ Collaboration diagram for DiscountingEquityForwardEngine:

Public Member Functions

 DiscountingEquityForwardEngine (const Handle< YieldTermStructure > &equityInterestRateCurve, const Handle< YieldTermStructure > &dividendYieldCurve, const Handle< Quote > &equitySpot, const Handle< YieldTermStructure > &discountCurve, boost::optional< bool > includeSettlementDateFlows=boost::none, const Date &settlementDate=Date(), const Date &npvDate=Date())
 
void calculate () const override
 
const Handle< YieldTermStructure > & equityReferenceRateCurve () const
 
const Handle< YieldTermStructure > & divYieldCurve () const
 
const Handle< YieldTermStructure > & discountCurve () const
 
const Handle< Quote > & equitySpot () const
 

Private Attributes

Handle< YieldTermStructure > equityRefRateCurve_
 
Handle< YieldTermStructure > divYieldCurve_
 
Handle< Quote > equitySpot_
 
Handle< YieldTermStructure > discountCurve_
 
boost::optional< boolincludeSettlementDateFlows_
 
Date settlementDate_
 
Date npvDate_
 

Detailed Description

Discounting Equity Forward Engine.

This class implements pricing of Equity Forwards by discounting the future nominal cash flows using the respective yield curves. The forward price is estimated using reference rate and dividend yield curves as input. The cashflows are discounted using a separate discounting curve input.

    \ingroup engines

Definition at line 43 of file discountingequityforwardengine.hpp.

Constructor & Destructor Documentation

◆ DiscountingEquityForwardEngine()

DiscountingEquityForwardEngine ( const Handle< YieldTermStructure > &  equityInterestRateCurve,
const Handle< YieldTermStructure > &  dividendYieldCurve,
const Handle< Quote > &  equitySpot,
const Handle< YieldTermStructure > &  discountCurve,
boost::optional< bool includeSettlementDateFlows = boost::none,
const Date &  settlementDate = Date(),
const Date &  npvDate = Date() 
)
Parameters
equityInterestRateCurveThe IR rate curve for estimating forward price.
dividendYieldCurveThe dividend yield term structure for estimating forward price.
equitySpotThe market spot rate quote.
discountCurveThe discount curve
includeSettlementDateFlows,settlementDateIf includeSettlementDateFlows is true (false), cashflows on the settlementDate are (not) included in the NPV. If not given the settlement date is set to the npv date.
npvDateDiscount to this date. If not given the npv date is set to the evaluation date

Definition at line 25 of file discountingequityforwardengine.cpp.

29 : equityRefRateCurve_(equityInterestRateCurve), divYieldCurve_(dividendYieldCurve), equitySpot_(equitySpot),
30 discountCurve_(discountCurve), includeSettlementDateFlows_(includeSettlementDateFlows),
31 settlementDate_(settlementDate), npvDate_(npvDate) {
32
33 registerWith(equityRefRateCurve_);
34 registerWith(divYieldCurve_);
35 registerWith(equitySpot_);
36 registerWith(discountCurve_);
37}
const Handle< YieldTermStructure > & discountCurve() const

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 39 of file discountingequityforwardengine.cpp.

39 {
40
41 Date npvDate = npvDate_;
42 if (npvDate == Null<Date>()) {
43 npvDate = divYieldCurve_->referenceDate();
44 }
45 Date settlementDate = settlementDate_;
46 if (settlementDate == Null<Date>()) {
47 settlementDate = npvDate;
48 }
49
50 results_.value = 0.0;
51
52 if (!detail::simple_event(arguments_.maturityDate).hasOccurred(settlementDate, includeSettlementDateFlows_)) {
53 Real lsInd = ((arguments_.longShort == Position::Long) ? 1.0 : -1.0);
54 Real qty = arguments_.quantity;
55 Date maturity = arguments_.maturityDate;
56 Real strike = arguments_.strike;
57 Real forwardPrice =
58 equitySpot_->value() * divYieldCurve_->discount(maturity) / equityRefRateCurve_->discount(maturity);
59 DiscountFactor df = discountCurve_->discount(maturity);
60 results_.value = (lsInd * qty) * (forwardPrice - strike) * df;
61
62 results_.additionalResults["forwardPrice"] = forwardPrice;
63 results_.additionalResults["currentNotional"] = forwardPrice * strike;
64 }
65} // calculate
const Instrument::results * results_
Definition: cdsoption.cpp:81
Swap::arguments * arguments_

◆ equityReferenceRateCurve()

const Handle< YieldTermStructure > & equityReferenceRateCurve ( ) const

Definition at line 71 of file discountingequityforwardengine.hpp.

71{ return equityRefRateCurve_; }

◆ divYieldCurve()

const Handle< YieldTermStructure > & divYieldCurve ( ) const

Definition at line 72 of file discountingequityforwardengine.hpp.

72{ return divYieldCurve_; }

◆ discountCurve()

const Handle< YieldTermStructure > & discountCurve ( ) const

Definition at line 73 of file discountingequityforwardengine.hpp.

73{ return discountCurve_; }

◆ equitySpot()

const Handle< Quote > & equitySpot ( ) const

Definition at line 75 of file discountingequityforwardengine.hpp.

75{ return equitySpot_; }

Member Data Documentation

◆ equityRefRateCurve_

Handle<YieldTermStructure> equityRefRateCurve_
private

Definition at line 78 of file discountingequityforwardengine.hpp.

◆ divYieldCurve_

Handle<YieldTermStructure> divYieldCurve_
private

Definition at line 79 of file discountingequityforwardengine.hpp.

◆ equitySpot_

Handle<Quote> equitySpot_
private

Definition at line 80 of file discountingequityforwardengine.hpp.

◆ discountCurve_

Handle<YieldTermStructure> discountCurve_
private

Definition at line 81 of file discountingequityforwardengine.hpp.

◆ includeSettlementDateFlows_

boost::optional<bool> includeSettlementDateFlows_
private

Definition at line 82 of file discountingequityforwardengine.hpp.

◆ settlementDate_

Date settlementDate_
private

Definition at line 83 of file discountingequityforwardengine.hpp.

◆ npvDate_

Date npvDate_
private

Definition at line 84 of file discountingequityforwardengine.hpp.