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

Equity Position instrument wrapper. More...

#include <ored/portfolio/equityposition.hpp>

+ Inheritance diagram for EquityPositionInstrumentWrapper:
+ Collaboration diagram for EquityPositionInstrumentWrapper:

Classes

class  arguments
 
class  engine
 
class  results
 

Public Member Functions

 EquityPositionInstrumentWrapper (const Real quantity, const std::vector< QuantLib::ext::shared_ptr< QuantExt::EquityIndex2 > > &equities, const std::vector< Real > &weights, const std::vector< Handle< Quote > > &fxConversion={})
 

Instrument interface

Real quantity_
 
std::vector< QuantLib::ext::shared_ptr< QuantExt::EquityIndex2 > > equities_
 
std::vector< Real > weights_
 
std::vector< Handle< Quote > > fxConversion_
 
Handle< Quote > npvCcyConversion_
 
bool isExpired () const override
 
void setupArguments (QuantLib::PricingEngine::arguments *) const override
 
void fetchResults (const QuantLib::PricingEngine::results *) const override
 
void setNpvCurrencyConversion (const Handle< Quote > &npvCcyConversion)
 
void setupExpired () const override
 

Detailed Description

Equity Position instrument wrapper.

Definition at line 84 of file equityposition.hpp.

Constructor & Destructor Documentation

◆ EquityPositionInstrumentWrapper()

EquityPositionInstrumentWrapper ( const Real  quantity,
const std::vector< QuantLib::ext::shared_ptr< QuantExt::EquityIndex2 > > &  equities,
const std::vector< Real > &  weights,
const std::vector< Handle< Quote > > &  fxConversion = {} 
)

Definition at line 127 of file equityposition.cpp.

130 : quantity_(quantity), equities_(equities), weights_(weights), fxConversion_(fxConversion) {
131 QL_REQUIRE(equities_.size() == weights_.size(), "EquityPositionInstrumentWrapper: equities size ("
132 << equities_.size() << ") must match weights size ("
133 << weights_.size() << ")");
134 QL_REQUIRE(fxConversion_.empty() || fxConversion_.size() == equities_.size(),
135 "EquityPositionInstrumentWrapper: fxConversion size ("
136 << fxConversion_.size() << ") must match equities size (" << equities_.size() << ")");
137 for (auto const& i : equities_)
138 registerWith(i);
139 for (auto const& f : fxConversion_)
140 registerWith(f);
141 registerWith(npvCcyConversion_);
142}
std::vector< QuantLib::ext::shared_ptr< QuantExt::EquityIndex2 > > equities_
std::vector< Handle< Quote > > fxConversion_

Member Function Documentation

◆ isExpired()

bool isExpired ( ) const
override

Definition at line 148 of file equityposition.cpp.

148{ return false; }

◆ setupArguments()

void setupArguments ( QuantLib::PricingEngine::arguments ) const
override

Definition at line 152 of file equityposition.cpp.

152 {
153 EquityPositionInstrumentWrapper::arguments* a = dynamic_cast<EquityPositionInstrumentWrapper::arguments*>(args);
154 QL_REQUIRE(a != nullptr, "wrong argument type in EquityPositionInstrumentWrapper");
155 a->quantity_ = quantity_;
156 a->equities_ = equities_;
157 a->weights_ = weights_;
158 a->fxConversion_ = fxConversion_;
159 a->npvCcyConversion_ = npvCcyConversion_;
160}

◆ fetchResults()

void fetchResults ( const QuantLib::PricingEngine::results *  ) const
override

Definition at line 162 of file equityposition.cpp.

162 {
163 Instrument::fetchResults(r);
164}

◆ setNpvCurrencyConversion()

void setNpvCurrencyConversion ( const Handle< Quote > &  npvCcyConversion)

Definition at line 144 of file equityposition.cpp.

144 {
145 npvCcyConversion_ = npvCcyConversion;
146}

◆ setupExpired()

void setupExpired ( ) const
overrideprivate

Definition at line 150 of file equityposition.cpp.

150{ Instrument::setupExpired(); }

Member Data Documentation

◆ quantity_

Real quantity_
private

Definition at line 105 of file equityposition.hpp.

◆ equities_

std::vector<QuantLib::ext::shared_ptr<QuantExt::EquityIndex2> > equities_
private

Definition at line 106 of file equityposition.hpp.

◆ weights_

std::vector<Real> weights_
private

Definition at line 107 of file equityposition.hpp.

◆ fxConversion_

std::vector<Handle<Quote> > fxConversion_
private

Definition at line 108 of file equityposition.hpp.

◆ npvCcyConversion_

Handle<Quote> npvCcyConversion_
private

Definition at line 109 of file equityposition.hpp.