#include <qle/instruments/multilegoption.hpp>
Definition at line 36 of file multilegoption.hpp.
◆ MultiLegOption()
MultiLegOption |
( |
const std::vector< Leg > & |
legs, |
|
|
const std::vector< bool > & |
payer, |
|
|
const std::vector< Currency > & |
currency, |
|
|
const QuantLib::ext::shared_ptr< Exercise > & |
exercise = QuantLib::ext::shared_ptr<Exercise>() , |
|
|
const Settlement::Type |
settlementType = Settlement::Physical , |
|
|
Settlement::Method |
settlementMethod = Settlement::PhysicalOTC |
|
) |
| |
exercise = nullptr means that the instrument is identical to the underlying itself (i.e. a swap)
Definition at line 25 of file multilegoption.cpp.
30
31 QL_REQUIRE(
legs_.size() > 0,
"MultiLegOption: No legs are given");
33 "MultiLegOption: payer size (" <<
payer.size() <<
") does not match legs size (" <<
legs_.size() <<
")");
35 << ") does not match legs size ("
36 <<
legs_.size() <<
")");
37
38
40 for (
auto const& l :
legs_) {
41 if (!l.empty())
43 }
44
45
46
47 for (
auto const& l :
legs_) {
48 for (auto const& c : l) {
49 registerWith(c);
50 if (auto lazy = QuantLib::ext::dynamic_pointer_cast<LazyObject>(c))
51 lazy->alwaysForwardNotifications();
52 }
53 }
54
55}
const Settlement::Method settlementMethod_
const std::vector< Leg > & legs() const
const QuantLib::ext::shared_ptr< Exercise > exercise_
const Settlement::Type settlementType() const
const Settlement::Method settlementMethod() const
const Settlement::Type settlementType_
const std::vector< bool > payer_
const std::vector< Leg > legs_
const QuantLib::ext::shared_ptr< Exercise > exercise() const
const std::vector< Currency > & currency() const
const std::vector< Currency > currency_
const std::vector< bool > & payer() const
◆ legs()
const std::vector< Leg > & legs |
( |
| ) |
const |
◆ payer()
const std::vector< bool > & payer |
( |
| ) |
const |
◆ currency()
const std::vector< Currency > & currency |
( |
| ) |
const |
◆ exercise()
const QuantLib::ext::shared_ptr< Exercise > exercise |
( |
| ) |
const |
◆ settlementType()
const Settlement::Type settlementType |
( |
| ) |
const |
◆ settlementMethod()
const Settlement::Method settlementMethod |
( |
| ) |
const |
◆ deepUpdate()
Definition at line 57 of file multilegoption.cpp.
57 {
58 for (
auto& l :
legs_) {
59 for (auto& c : l) {
60 if (auto lazy = QuantLib::ext::dynamic_pointer_cast<LazyObject>(c))
61 lazy->deepUpdate();
62 }
63 }
64 update();
65}
◆ isExpired()
Definition at line 67 of file multilegoption.cpp.
67 {
68 Date today = Settings::instance().evaluationDate();
71 } else {
72
73 return today >=
exercise_->dates().back();
74 }
75}
const Date & maturityDate() const
◆ setupArguments()
void setupArguments |
( |
PricingEngine::arguments * |
args | ) |
const |
|
override |
Definition at line 83 of file multilegoption.cpp.
83 {
84 MultiLegOption::arguments* tmp = dynamic_cast<MultiLegOption::arguments*>(args);
85 QL_REQUIRE(tmp != nullptr, "MultiLegOption: wrong pricing engine argument type");
92}
◆ fetchResults()
void fetchResults |
( |
const PricingEngine::results * |
r | ) |
const |
|
override |
Definition at line 94 of file multilegoption.cpp.
94 {
95 Instrument::fetchResults(r);
96 const MultiLegOption::results* results = dynamic_cast<const MultiLegOption::results*>(r);
97 if (results) {
99 } else {
101 }
102}
◆ maturityDate()
const Date & maturityDate |
( |
| ) |
const |
◆ underlyingNpv()
Real underlyingNpv |
( |
| ) |
const |
◆ legs_
const std::vector<Leg> legs_ |
|
private |
◆ payer_
const std::vector<bool> payer_ |
|
private |
◆ currency_
const std::vector<Currency> currency_ |
|
private |
◆ exercise_
const QuantLib::ext::shared_ptr<Exercise> exercise_ |
|
private |
◆ settlementType_
const Settlement::Type settlementType_ |
|
private |
◆ settlementMethod_
const Settlement::Method settlementMethod_ |
|
private |
◆ maturity_
◆ underlyingNpv_