QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | List of all members
EquityTotalReturnSwap Class Reference

Equity total return swap. More...

#include <ql/instruments/equitytotalreturnswap.hpp>

+ Inheritance diagram for EquityTotalReturnSwap:
+ Collaboration diagram for EquityTotalReturnSwap:

Public Member Functions

 EquityTotalReturnSwap (Type type, Real nominal, Schedule schedule, ext::shared_ptr< EquityIndex > equityIndex, const ext::shared_ptr< IborIndex > &interestRateIndex, DayCounter dayCounter, Rate margin, Real gearing=1.0, Calendar paymentCalendar=Calendar(), BusinessDayConvention paymentConvention=Unadjusted, Natural paymentDelay=0)
 
 EquityTotalReturnSwap (Type type, Real nominal, Schedule schedule, ext::shared_ptr< EquityIndex > equityIndex, const ext::shared_ptr< OvernightIndex > &interestRateIndex, DayCounter dayCounter, Rate margin, Real gearing=1.0, Calendar paymentCalendar=Calendar(), BusinessDayConvention paymentConvention=Unadjusted, Natural paymentDelay=0)
 
Inspectors
Type type () const
 
Real nominal () const
 
const ext::shared_ptr< EquityIndex > & equityIndex () const
 
const ext::shared_ptr< InterestRateIndex > & interestRateIndex () const
 
const Scheduleschedule () const
 
const DayCounterdayCounter () const
 
Rate margin () const
 
Real gearing () const
 
const CalendarpaymentCalendar () const
 
BusinessDayConvention paymentConvention () const
 
Natural paymentDelay () const
 
const LegequityLeg () const
 
const LeginterestRateLeg () const
 
- Public Member Functions inherited from Swap
void deepUpdate () override
 
Size numberOfLegs () const
 
const std::vector< Leg > & legs () const
 
virtual Date startDate () const
 
virtual Date maturityDate () const
 
Real legBPS (Size j) const
 
Real legNPV (Size j) const
 
DiscountFactor startDiscounts (Size j) const
 
DiscountFactor endDiscounts (Size j) const
 
DiscountFactor npvDateDiscount () const
 
const Legleg (Size j) const
 
bool payer (Size j) const
 
bool isExpired () const override
 returns whether the instrument might have value greater than zero. More...
 
void setupArguments (PricingEngine::arguments *) const override
 
void fetchResults (const PricingEngine::results *) const override
 
 Swap (const Leg &firstLeg, const Leg &secondLeg)
 
 Swap (const std::vector< Leg > &legs, const std::vector< bool > &payer)
 
- Public Member Functions inherited from Instrument
 Instrument ()
 
Real NPV () const
 returns the net present value of the instrument. More...
 
Real errorEstimate () const
 returns the error estimate on the NPV when available. More...
 
const DatevaluationDate () const
 returns the date the net present value refers to. More...
 
template<typename T >
result (const std::string &tag) const
 returns any additional result returned by the pricing engine. More...
 
const std::map< std::string, ext::any > & additionalResults () const
 returns all additional result returned by the pricing engine. More...
 
void setPricingEngine (const ext::shared_ptr< PricingEngine > &)
 set the pricing engine to be used. More...
 
- Public Member Functions inherited from LazyObject
 LazyObject ()
 
 ~LazyObject () override=default
 
void update () override
 
bool isCalculated () const
 
void forwardFirstNotificationOnly ()
 
void alwaysForwardNotifications ()
 
void recalculate ()
 
void freeze ()
 
void unfreeze ()
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 

Results

ext::shared_ptr< EquityIndexequityIndex_
 
ext::shared_ptr< InterestRateIndexinterestRateIndex_
 
Type type_
 
Real nominal_
 
Schedule schedule_
 
DayCounter dayCounter_
 
Rate margin_
 
Real gearing_
 
Calendar paymentCalendar_
 
BusinessDayConvention paymentConvention_
 
Natural paymentDelay_
 
Real equityLegNPV () const
 
Real interestRateLegNPV () const
 
Real fairMargin () const
 
 EquityTotalReturnSwap (ext::shared_ptr< EquityIndex > equityIndex, ext::shared_ptr< InterestRateIndex > interestRateIndex, Type type, Real nominal, Schedule schedule, DayCounter dayCounter, Rate margin, Real gearing=1.0, Calendar paymentCalendar=Calendar(), BusinessDayConvention paymentConvention=Unadjusted, Natural paymentDelay=0)
 

Additional Inherited Members

- Public Types inherited from Swap
enum  Type { Receiver = -1 , Payer = 1 }
 
- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from Swap
void setupExpired () const override
 
 Swap (Size legs)
 
- Protected Member Functions inherited from Instrument
void calculate () const override
 
void performCalculations () const override
 
- Protected Member Functions inherited from LazyObject
- Protected Attributes inherited from Swap
std::vector< Leglegs_
 
std::vector< Realpayer_
 
std::vector< ReallegNPV_
 
std::vector< ReallegBPS_
 
std::vector< DiscountFactorstartDiscounts_
 
std::vector< DiscountFactorendDiscounts_
 
DiscountFactor npvDateDiscount_
 
- Protected Attributes inherited from Instrument
Real NPV_
 
Real errorEstimate_
 
Date valuationDate_
 
std::map< std::string, ext::any > additionalResults_
 
ext::shared_ptr< PricingEngineengine_
 
- Protected Attributes inherited from LazyObject
bool calculated_ = false
 
bool frozen_ = false
 
bool alwaysForward_
 

Detailed Description

Equity total return swap.

It exchanges a total return of an equity index for a set of floating cash flows linked to either Ibor or overnight index. The equity leg future value (FV) is:

\[ FV^{equity} = N \left[ \frac{I(t, T_{M})}{I(T_{0})} -1 \right], \]

where \( N \) is the swap notional, \( I(T_{0}) \) is the value of the equity index on the start date and \( I(t, T_{M}) \) is the value of the equity index at maturity. The floating leg payments are linked to either an Ibor or an overnight index. In case of an overnight index the interest rate fixings are compounded over the accrual period.

Swap type (payer of receiver) refers to the equity leg.

Definition at line 54 of file equitytotalreturnswap.hpp.

Constructor & Destructor Documentation

◆ EquityTotalReturnSwap() [1/3]

EquityTotalReturnSwap ( Type  type,
Real  nominal,
Schedule  schedule,
ext::shared_ptr< EquityIndex equityIndex,
const ext::shared_ptr< IborIndex > &  interestRateIndex,
DayCounter  dayCounter,
Rate  margin,
Real  gearing = 1.0,
Calendar  paymentCalendar = Calendar(),
BusinessDayConvention  paymentConvention = Unadjusted,
Natural  paymentDelay = 0 
)

Definition at line 111 of file equitytotalreturnswap.cpp.

+ Here is the call graph for this function:

◆ EquityTotalReturnSwap() [2/3]

EquityTotalReturnSwap ( Type  type,
Real  nominal,
Schedule  schedule,
ext::shared_ptr< EquityIndex equityIndex,
const ext::shared_ptr< OvernightIndex > &  interestRateIndex,
DayCounter  dayCounter,
Rate  margin,
Real  gearing = 1.0,
Calendar  paymentCalendar = Calendar(),
BusinessDayConvention  paymentConvention = Unadjusted,
Natural  paymentDelay = 0 
)

Definition at line 140 of file equitytotalreturnswap.cpp.

+ Here is the call graph for this function:

◆ EquityTotalReturnSwap() [3/3]

EquityTotalReturnSwap ( ext::shared_ptr< EquityIndex equityIndex,
ext::shared_ptr< InterestRateIndex interestRateIndex,
Type  type,
Real  nominal,
Schedule  schedule,
DayCounter  dayCounter,
Rate  margin,
Real  gearing = 1.0,
Calendar  paymentCalendar = Calendar(),
BusinessDayConvention  paymentConvention = Unadjusted,
Natural  paymentDelay = 0 
)
private

Definition at line 72 of file equitytotalreturnswap.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ type()

Type type ( ) const

Definition at line 82 of file equitytotalreturnswap.hpp.

◆ nominal()

Real nominal ( ) const

Definition at line 83 of file equitytotalreturnswap.hpp.

◆ equityIndex()

const ext::shared_ptr< EquityIndex > & equityIndex ( ) const

Definition at line 84 of file equitytotalreturnswap.hpp.

◆ interestRateIndex()

const ext::shared_ptr< InterestRateIndex > & interestRateIndex ( ) const

Definition at line 85 of file equitytotalreturnswap.hpp.

+ Here is the caller graph for this function:

◆ schedule()

const Schedule & schedule ( ) const

Definition at line 86 of file equitytotalreturnswap.hpp.

◆ dayCounter()

const DayCounter & dayCounter ( ) const

Definition at line 87 of file equitytotalreturnswap.hpp.

◆ margin()

Rate margin ( ) const

Definition at line 88 of file equitytotalreturnswap.hpp.

+ Here is the caller graph for this function:

◆ gearing()

Real gearing ( ) const

Definition at line 89 of file equitytotalreturnswap.hpp.

◆ paymentCalendar()

const Calendar & paymentCalendar ( ) const

Definition at line 90 of file equitytotalreturnswap.hpp.

◆ paymentConvention()

BusinessDayConvention paymentConvention ( ) const

Definition at line 91 of file equitytotalreturnswap.hpp.

◆ paymentDelay()

Natural paymentDelay ( ) const

Definition at line 92 of file equitytotalreturnswap.hpp.

◆ equityLeg()

const Leg & equityLeg ( ) const

Definition at line 169 of file equitytotalreturnswap.cpp.

+ Here is the call graph for this function:

◆ interestRateLeg()

const Leg & interestRateLeg ( ) const

Definition at line 173 of file equitytotalreturnswap.cpp.

+ Here is the call graph for this function:

◆ equityLegNPV()

Real equityLegNPV ( ) const

Definition at line 177 of file equitytotalreturnswap.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ interestRateLegNPV()

Real interestRateLegNPV ( ) const

Definition at line 181 of file equitytotalreturnswap.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fairMargin()

Real fairMargin ( ) const

Definition at line 185 of file equitytotalreturnswap.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ equityIndex_

ext::shared_ptr<EquityIndex> equityIndex_
private

Definition at line 118 of file equitytotalreturnswap.hpp.

◆ interestRateIndex_

ext::shared_ptr<InterestRateIndex> interestRateIndex_
private

Definition at line 119 of file equitytotalreturnswap.hpp.

◆ type_

Type type_
private

Definition at line 120 of file equitytotalreturnswap.hpp.

◆ nominal_

Real nominal_
private

Definition at line 121 of file equitytotalreturnswap.hpp.

◆ schedule_

Schedule schedule_
private

Definition at line 122 of file equitytotalreturnswap.hpp.

◆ dayCounter_

DayCounter dayCounter_
private

Definition at line 123 of file equitytotalreturnswap.hpp.

◆ margin_

Rate margin_
private

Definition at line 124 of file equitytotalreturnswap.hpp.

◆ gearing_

Real gearing_
private

Definition at line 125 of file equitytotalreturnswap.hpp.

◆ paymentCalendar_

Calendar paymentCalendar_
private

Definition at line 126 of file equitytotalreturnswap.hpp.

◆ paymentConvention_

BusinessDayConvention paymentConvention_
private

Definition at line 127 of file equitytotalreturnswap.hpp.

◆ paymentDelay_

Natural paymentDelay_
private

Definition at line 128 of file equitytotalreturnswap.hpp.