25 const std::vector<QuantLib::ext::shared_ptr<InstrumentWrapper>>& wrappers,
const std::vector<Handle<Quote>>& fxRates,
26 const Date& valuationDate)
27 :
InstrumentWrapper(), wrappers_(wrappers), fxRates_(fxRates), valuationDate_(valuationDate) {
29 QL_REQUIRE(wrappers.size() > 0,
"no instrument wrappers provided");
33 auto tmp = w->additionalInstruments();
34 auto tmp2 = w->additionalMultipliers();
52 Date today = Settings::instance().evaluationDate();
54 QL_REQUIRE(today ==
valuationDate_,
"today must be the expected valuation date for this trade");
57 for (Size i = 0; i <
wrappers_.size(); i++) {
63 w->resetPricingStats();
71 additionalResults_.insert(w->additionalResults().begin(), w->additionalResults().end());
78 w->updateQlInstruments();
bool isOption() override
is it an Option?
QuantLib::Real NPV() const override
Return the NPV of this instrument.
std::map< std::string, boost::any > additionalResults_
const std::map< std::string, boost::any > & additionalResults() const override
Return the additional results of this instrument.
void updateQlInstruments() override
call update on enclosed instrument(s)
CompositeInstrumentWrapper(const std::vector< QuantLib::ext::shared_ptr< InstrumentWrapper > > &wrappers, const std::vector< Handle< Quote > > &fxRates={}, const Date &valuationDate=Date())
std::vector< QuantLib::Handle< Quote > > fxRates_
void initialise(const std::vector< QuantLib::Date > &dates) override
Initialise with the given date grid.
std::vector< QuantLib::ext::shared_ptr< InstrumentWrapper > > wrappers_
void reset() override
reset is called every time a new path is about to be priced.
std::size_t numberOfPricings_
std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > additionalInstruments_
boost::timer::nanosecond_type cumulativePricingTime_
std::vector< Real > additionalMultipliers_
used to store multiple trade wrappers
Serializable Credit Default Swap.