20#include <ql/option.hpp>
21#include <ql/settings.hpp>
30 const std::vector<Date>& exerciseDate,
const bool isPhysicalDelivery,
31 const std::vector<QuantLib::ext::shared_ptr<Instrument>>& undInst,
const Real multiplier,
32 const Real undMultiplier,
33 const std::vector<QuantLib::ext::shared_ptr<QuantLib::Instrument>>& additionalInstruments,
34 const std::vector<Real>& additionalMultipliers)
35 :
InstrumentWrapper(inst, multiplier, additionalInstruments, additionalMultipliers), isLong_(isLongOption),
36 isPhysicalDelivery_(isPhysicalDelivery), contractExerciseDates_(exerciseDate),
37 effectiveExerciseDates_(exerciseDate), underlyingInstruments_(undInst),
38 activeUnderlyingInstrument_(undInst.at(0)), undMultiplier_(undMultiplier), exercised_(false), exercisable_(true),
39 exerciseDate_(Date()) {
40 QL_REQUIRE(
exerciseDate.size() == undInst.size(),
"number of exercise dates ("
42 <<
") must be equal to underlying instrument vector size ("
43 << undInst.size() <<
")");
50 Date today = Settings::instance().evaluationDate();
73 Date today = Settings::instance().evaluationDate();
105 static std::map<std::string, boost::any> emptyMap;
144 Date today = Settings::instance().evaluationDate();
bool exercise() const override
bool exercise() const override
bool exercise() const override
QuantLib::Real additionalInstrumentsNPV() const
Real getTimedNPV(const QuantLib::ext::shared_ptr< QuantLib::Instrument > &instr) const
QuantLib::ext::shared_ptr< QuantLib::Instrument > instrument_
const QuantLib::Date & exerciseDate() const
the (actual) date the option was exercised
QuantLib::Real NPV() const override
Return the NPV of this instrument.
QuantLib::Date exerciseDate_
OptionWrapper(const QuantLib::ext::shared_ptr< QuantLib::Instrument > &inst, const bool isLongOption, const std::vector< QuantLib::Date > &exerciseDate, const bool isPhysicalDelivery, const std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > &undInst, const Real multiplier=1.0, const Real undMultiplier=1.0, const std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > &additionalInstruments=std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > >(), const std::vector< Real > &additionalMultipliers=std::vector< Real >())
Constructor.
virtual bool exercise() const =0
const std::map< std::string, boost::any > & additionalResults() const override
Return the additional results of this instrument.
std::vector< QuantLib::Date > effectiveExerciseDates_
void initialise(const std::vector< QuantLib::Date > &dates) override
Initialise with the given date grid.
QuantLib::ext::shared_ptr< QuantLib::Instrument > activeUnderlyingInstrument_
Real multiplier2() const override
void reset() override
reset is called every time a new path is about to be priced.
std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > underlyingInstruments_
std::vector< QuantLib::Date > contractExerciseDates_
Serializable Credit Default Swap.
Wrapper for option instruments, tracks whether option has been exercised or not.