Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
optiondata.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
20
24
26
27using namespace QuantLib;
28
29namespace ore {
30namespace data {
31
33 XMLUtils::checkNode(node, "OptionData");
34 longShort_ = XMLUtils::getChildValue(node, "LongShort", true);
35 callPut_ = XMLUtils::getChildValue(node, "OptionType", false);
36 payoffType_ = XMLUtils::getChildValue(node, "PayoffType", false);
37 payoffType2_ = XMLUtils::getChildValue(node, "PayoffType2", false);
38 style_ = XMLUtils::getChildValue(node, "Style", false);
39 noticePeriod_ = XMLUtils::getChildValue(node, "NoticePeriod", false);
40 noticeCalendar_ = XMLUtils::getChildValue(node, "NoticeCalendar", false);
41 noticeConvention_ = XMLUtils::getChildValue(node, "NoticeConvention", false);
42 settlement_ = XMLUtils::getChildValue(node, "Settlement", false);
43 settlementMethod_ = XMLUtils::getChildValue(node, "SettlementMethod", false);
44 payoffAtExpiry_ = XMLUtils::getChildValueAsBool(node, "PayOffAtExpiry", false, true);
46 exerciseFeeTypes_.clear();
47 exerciseFeeDates_.clear();
48 vector<std::reference_wrapper<vector<string>>> attrs;
49 attrs.push_back(exerciseFeeTypes_);
50 attrs.push_back(exerciseFeeDates_);
51 exerciseFees_ = XMLUtils::getChildrenValuesWithAttributes<Real>(node, "ExerciseFees", "ExerciseFee",
52 {"type", "startDate"}, attrs, &parseReal);
53 exerciseFeeSettlementPeriod_ = XMLUtils::getChildValue(node, "ExerciseFeeSettlementPeriod", false);
54 exerciseFeeSettlementCalendar_ = XMLUtils::getChildValue(node, "ExerciseFeeSettlementCalendar", false);
55 exerciseFeeSettlementConvention_ = XMLUtils::getChildValue(node, "ExerciseFeeSettlementConvention", false);
56 exercisePrices_ = XMLUtils::getChildrenValuesAsDoubles(node, "ExercisePrices", "ExercisePrice", false);
57
58 XMLNode* exDatesNode = XMLUtils::getChildNode(node, "ExerciseDates");
59 XMLNode* exScheduleNode = XMLUtils::getChildNode(node, "ExerciseSchedule");
60 QL_REQUIRE(!(exDatesNode && exScheduleNode),
61 "Cannot specify both ExerciseDates and ExerciseSchedule. Only one must be used.");
62 if (exDatesNode) {
63 exerciseDates_ = XMLUtils::getChildrenValues(node, "ExerciseDates", "ExerciseDate");
64 }
65 if (exScheduleNode) {
66 exerciseDatesSchedule_.fromXML(exScheduleNode);
67 }
68
69 automaticExercise_ = boost::none;
70 if (XMLNode* n = XMLUtils::getChildNode(node, "AutomaticExercise"))
72
73 exerciseData_ = boost::none;
74 if (XMLNode* n = XMLUtils::getChildNode(node, "ExerciseData")) {
76 exerciseData_->fromXML(n);
77 }
78
79 paymentData_ = boost::none;
80 if (XMLNode* n = XMLUtils::getChildNode(node, "PaymentData")) {
82 paymentData_->fromXML(n);
83 }
84}
85
87 XMLNode* node = doc.allocNode("OptionData");
88 XMLUtils::addChild(doc, node, "LongShort", longShort_);
89 if (callPut_ != "")
90 XMLUtils::addChild(doc, node, "OptionType", callPut_);
91 if (payoffType_ != "")
92 XMLUtils::addChild(doc, node, "PayoffType", payoffType_);
93 if (payoffType2_ != "")
94 XMLUtils::addChild(doc, node, "PayoffType2", payoffType2_);
95 if (style_ != "")
96 XMLUtils::addChild(doc, node, "Style", style_);
97 XMLUtils::addChild(doc, node, "NoticePeriod", noticePeriod_);
98 if (noticeCalendar_ != "")
99 XMLUtils::addChild(doc, node, "NoticeCalendar", noticeCalendar_);
100 if (noticeConvention_ != "")
101 XMLUtils::addChild(doc, node, "NoticeConvention", noticeConvention_);
102 if (settlement_ != "")
103 XMLUtils::addChild(doc, node, "Settlement", settlement_);
104 if (settlementMethod_ != "")
105 XMLUtils::addChild(doc, node, "SettlementMethod", settlementMethod_);
106 XMLUtils::addChild(doc, node, "PayOffAtExpiry", payoffAtExpiry_);
108 XMLUtils::addChildrenWithOptionalAttributes(doc, node, "ExerciseFees", "ExerciseFee", exerciseFees_,
109 {"type", "startDate"}, {exerciseFeeTypes_, exerciseFeeDates_});
111 XMLUtils::addChild(doc, node, "ExerciseFeeSettlementPeriod", exerciseFeeSettlementPeriod_);
113 XMLUtils::addChild(doc, node, "ExerciseFeeSettlementCalendar", exerciseFeeSettlementCalendar_);
115 XMLUtils::addChild(doc, node, "ExerciseFeeSettlementConvention", exerciseFeeSettlementConvention_);
116 XMLUtils::addChildren(doc, node, "ExercisePrices", "ExercisePrice", exercisePrices_);
117
119 XMLNode* scheduleDataNode = exerciseDatesSchedule_.toXML(doc);
120 XMLUtils::setNodeName(doc, scheduleDataNode, "ExerciseSchedule");
121 XMLUtils::appendNode(node, scheduleDataNode);
122 } else {
123 XMLUtils::addChildren(doc, node, "ExerciseDates", "ExerciseDate", exerciseDates_);
124 }
125
127 XMLUtils::addChild(doc, node, "AutomaticExercise", *automaticExercise_);
128
129 if (exerciseData_) {
130 XMLUtils::appendNode(node, exerciseData_->toXML(doc));
131 }
132
133 if (paymentData_) {
134 XMLUtils::appendNode(node, paymentData_->toXML(doc));
135 }
136
137 return node;
138}
139
140ExerciseBuilder::ExerciseBuilder(const OptionData& optionData, const std::vector<Leg> legs,
141 bool removeNoticeDatesAfterLastAccrualStart) {
142
143 // for american style exercise, never remove notice dates after last accrual start
144
145 if (optionData.style() == "American")
146 removeNoticeDatesAfterLastAccrualStart = false;
147
148 // only keep a) future exercise dates and b) exercise dates that exercise into a whole
149 // accrual period of the underlying; TODO handle exercises into broken periods?
150
151 // determine last accrual start date present in the underlying legs
152
153 Date lastAccrualStartDate = Date::minDate();
154 for (auto const& l : legs) {
155 for (auto const& c : l) {
156 if (auto cpn = QuantLib::ext::dynamic_pointer_cast<Coupon>(c))
157 lastAccrualStartDate = std::max(lastAccrualStartDate, cpn->accrualStartDate());
158 }
159 }
160
161 // get notice period, calendar, bdc
162
163 Period noticePeriod = optionData.noticePeriod().empty() ? 0 * Days : parsePeriod(optionData.noticePeriod());
164 Calendar noticeCal =
165 optionData.noticeCalendar().empty() ? NullCalendar() : parseCalendar(optionData.noticeCalendar());
166 BusinessDayConvention noticeBdc =
167 optionData.noticeConvention().empty() ? Unadjusted : parseBusinessDayConvention(optionData.noticeConvention());
168
169 // build vector of sorted exercise dates
170
171 std::vector<QuantLib::Date> sortedExerciseDates;
172 if (optionData.exerciseDatesSchedule().hasData()) {
173 Schedule schedule = makeSchedule(optionData.exerciseDatesSchedule());
174 sortedExerciseDates = schedule.dates();
175 } else {
176 // For backward compatibility
177 for (auto const& d : optionData.exerciseDates())
178 sortedExerciseDates.push_back(parseDate(d));
179 }
180 std::sort(sortedExerciseDates.begin(), sortedExerciseDates.end());
181
182 // check that we have exactly two exercise dates for american style
183
184 QL_REQUIRE(optionData.style() != "American" || sortedExerciseDates.size() == 2,
185 "ExerciseBuilder: expected 2 exercise dates for style 'American', got " << sortedExerciseDates.size());
186
187 // build vector of alive exercise dates and corresponding notice dates
188
189 std::vector<bool> isExerciseDateAlive(sortedExerciseDates.size(), false);
190
191 Date today = Settings::instance().evaluationDate();
192
193 for (Size i = 0; i < sortedExerciseDates.size(); i++) {
194 Date noticeDate = noticeCal.advance(sortedExerciseDates[i], -noticePeriod, noticeBdc);
195 // keep two alive notice dates always for american style exercise
196 if (optionData.style() == "American" && i == 0) {
197 noticeDate = std::max(today + 1, noticeDate);
198 sortedExerciseDates[0] = std::max(today + 1, sortedExerciseDates[0]);
199 }
200 if (noticeDate > today && (noticeDate <= lastAccrualStartDate || !removeNoticeDatesAfterLastAccrualStart)) {
201 isExerciseDateAlive[i] = true;
202 noticeDates_.push_back(noticeDate);
203 exerciseDates_.push_back(sortedExerciseDates[i]);
204 DLOG("Got notice date " << QuantLib::io::iso_date(noticeDate) << " using notice period " << noticePeriod
205 << ", convention " << noticeBdc << ", calendar " << noticeCal.name()
206 << " from exercise date " << exerciseDates_.back());
207 }
208 if (noticeDate > lastAccrualStartDate && removeNoticeDatesAfterLastAccrualStart)
209 WLOG("Remove notice date " << ore::data::to_string(noticeDate) << " (exercise date "
210 << sortedExerciseDates[i] << ") after last accrual start date "
211 << ore ::data::to_string(lastAccrualStartDate));
212 }
213
214 // build exercise instance if we have alive notice dates
215
216 if (!noticeDates_.empty()) {
217 if (optionData.style() == "European") {
218 QL_REQUIRE(exerciseDates_.size() == 1, "Got 'European' option style, but "
219 << exerciseDates_.size()
220 << " exercise dates. Should the style be 'Bermudan'?");
221 exercise_ = QuantLib::ext::make_shared<EuropeanExercise>(noticeDates_.back());
222 } else if (optionData.style() == "Bermudan" || optionData.style().empty()) {
223 // Note: empty exercise style defaults to Bermudan for backwards compatibility
224 exercise_ = QuantLib::ext::make_shared<BermudanExercise>(noticeDates_);
225 } else if (optionData.style() == "American") {
226 QL_REQUIRE(noticeDates_.size() == 2, "ExerciseBuilder: internal error, style is american but got "
227 << noticeDates_.size() << " notice dates, expected 2.");
228 exercise_ = QuantLib::ext::make_shared<AmericanExercise>(noticeDates_.front(), noticeDates_.back(),
229 optionData.payoffAtExpiry());
230 } else {
231 QL_FAIL("ExerciseBuilder: style '"
232 << optionData.style() << "' not recognized. Expected one of 'European', 'Bermudan', 'American'");
233 }
234 }
235
236 // check if the exercise right was executed and if so set cash settlement amount
237
238 if (optionData.exerciseData()) {
239 Date d = optionData.exerciseData()->date();
240 Real p = optionData.exerciseData()->price();
241 auto nextDate = std::lower_bound(sortedExerciseDates.begin(), sortedExerciseDates.end(), d);
242 if (nextDate != sortedExerciseDates.end()) {
243 isExercised_ = true;
244 exerciseDateIndex_ = std::distance(sortedExerciseDates.begin(), nextDate);
245 // Note: we set the exercise date to the notification date here
246 exerciseDate_ = optionData.style() == "American" ? d : *nextDate;
247 DLOG("Option is exercised, exercise date = " << exerciseDate_);
248 if (optionData.settlement() == "Cash") {
249 Date cashSettlementDate = d; // default to exercise date
250 if (optionData.paymentData()) {
251 if (optionData.paymentData()->rulesBased()) {
252 cashSettlementDate = optionData.paymentData()->calendar().advance(
253 d, optionData.paymentData()->lag(), Days, optionData.paymentData()->convention());
254 } else {
255 auto const& dates = optionData.paymentData()->dates();
256 auto nextDate = std::lower_bound(dates.begin(), dates.end(), d);
257 if (nextDate != dates.end())
258 cashSettlementDate = *nextDate;
259 }
260 }
261 if (p != Null<Real>())
262 cashSettlement_ = QuantLib::ext::make_shared<QuantLib::SimpleCashFlow>(p, cashSettlementDate);
263 DLOG("Option is cash settled, amount " << p << " paid on " << cashSettlementDate);
264 }
265 }
266 }
267
268 // build fee and rebated exercise instance, if any fees are present
269
270 if (!optionData.exerciseFees().empty()) {
271
272 QL_REQUIRE(optionData.style() != "American" || optionData.exerciseFees().size() == 1,
273 "ExerciseBuilder: for style 'American' at most one exercise fee is allowed");
274
275 // build an exercise date "schedule" by adding the maximum possible date at the end
276
277 std::vector<Date> exDatesPlusInf(sortedExerciseDates);
278 exDatesPlusInf.push_back(Date::maxDate());
279 vector<double> allRebates = buildScheduledVectorNormalised(optionData.exerciseFees(),
280 optionData.exerciseFeeDates(), exDatesPlusInf, 0.0);
281
282 // flip the sign of the fee to get a rebate
283
284 for (auto& r : allRebates)
285 r = -r;
286
287 vector<string> feeType = buildScheduledVectorNormalised<string>(
288 optionData.exerciseFeeTypes(), optionData.exerciseFeeDates(), exDatesPlusInf, "");
289
290 // convert relative to absolute fees if required
291
292 for (Size i = 0; i < allRebates.size(); ++i) {
293
294 // default to Absolute
295
296 if (feeType[i].empty())
297 feeType[i] = "Absolute";
298
299 if (feeType[i] == "Percentage") {
300
301 // get next coupon after exercise to determine relevant notional
302
303 std::set<std::pair<Date, Real>> notionals;
304 for (auto const& l : legs) {
305 for (auto const& c : l) {
306 if (auto cpn = QuantLib::ext::dynamic_pointer_cast<Coupon>(c)) {
307 if (cpn->accrualStartDate() >= sortedExerciseDates[i])
308 notionals.insert(std::make_pair(cpn->accrualStartDate(), cpn->nominal()));
309 }
310 }
311 }
312
313 if (notionals.empty())
314 allRebates[i] = 0.0; // notional is zero
315 else {
316 Real feeNotional = notionals.begin()->second;
317 DLOG("Convert percentage rebate "
318 << allRebates[i] << " to absolute rebate " << allRebates[i] * feeNotional << " using nominal "
319 << feeNotional << " for exercise date " << QuantLib::io::iso_date(sortedExerciseDates[i]));
320 allRebates[i] *= feeNotional; // multiply percentage fee by relevant notional
321 }
322
323 } else {
324 QL_REQUIRE(feeType[i] == "Absolute", "fee type must be Absolute or Relative");
325 }
326 }
327
328 // set fee settlement conventions
329
330 Period feeSettlPeriod = optionData.exerciseFeeSettlementPeriod().empty()
331 ? 0 * Days
333
334 Calendar feeSettlCal = optionData.exerciseFeeSettlementCalendar().empty()
335 ? NullCalendar()
337
338 BusinessDayConvention feeSettlBdc =
339 optionData.exerciseFeeSettlementConvention().empty()
340 ? Unadjusted
342
343 // set fee settlement amount if option is exercised
344
345 if (isExercised_) {
346 feeSettlement_ = QuantLib::ext::make_shared<QuantLib::SimpleCashFlow>(
347 -allRebates[exerciseDateIndex_], feeSettlCal.advance(exerciseDate_, feeSettlPeriod, feeSettlBdc));
348 DLOG("Settlement fee for exercised option is " << feeSettlement_->amount() << " paid on "
349 << feeSettlement_->date() << ".");
350 }
351
352 // update exercise instance with rebate information
353
354 if (exercise_ != nullptr) {
355 vector<double> rebates;
356 for (Size i = 0; i < sortedExerciseDates.size(); ++i) {
357 if (isExerciseDateAlive[i])
358 rebates.push_back(allRebates[i]);
359 }
360 if (optionData.style() == "American") {
361 // Note: we compute the settl date relative to notification, not exercise here
362 exercise_ = QuantLib::ext::make_shared<QuantExt::RebatedExercise>(*exercise_, rebates.front(), feeSettlPeriod,
363 feeSettlCal, feeSettlBdc);
364 auto dbgEx = QuantLib::ext::static_pointer_cast<QuantExt::RebatedExercise>(exercise_);
365 DLOG("Got rebate " << dbgEx->rebate(0) << " for American exercise with fee settle period "
366 << feeSettlPeriod << ", cal " << feeSettlCal << ", bdc " << feeSettlBdc);
367 } else {
368 exercise_ = QuantLib::ext::make_shared<QuantExt::RebatedExercise>(*exercise_, exerciseDates_, rebates,
369 feeSettlPeriod, feeSettlCal, feeSettlBdc);
370 auto dbgEx = QuantLib::ext::static_pointer_cast<QuantExt::RebatedExercise>(exercise_);
371 for (Size i = 0; i < exerciseDates_.size(); ++i) {
372 DLOG("Got rebate " << dbgEx->rebate(i) << " with payment date "
373 << QuantLib::io::iso_date(dbgEx->rebatePaymentDate(i))
374 << " (exercise date=" << QuantLib::io::iso_date(exerciseDates_[i])
375 << ") using rebate settl period " << feeSettlPeriod << ", calendar "
376 << feeSettlCal << ", convention " << feeSettlBdc);
377 }
378 }
379 }
380 } // if exercise fees are given
381} // ExerciseBuilder()
382
383} // namespace data
384} // namespace ore
QuantLib::Date exerciseDate_
Definition: optiondata.hpp:179
ExerciseBuilder(const OptionData &optionData, const std::vector< QuantLib::Leg > legs, bool removeNoticeDatesAfterLastAccrualStart=true)
Definition: optiondata.cpp:140
QuantLib::ext::shared_ptr< QuantLib::Exercise > exercise_
Definition: optiondata.hpp:173
std::vector< QuantLib::Date > noticeDates_
Definition: optiondata.hpp:176
QuantLib::ext::shared_ptr< QuantLib::CashFlow > feeSettlement_
Definition: optiondata.hpp:181
QuantLib::ext::shared_ptr< QuantLib::CashFlow > cashSettlement_
Definition: optiondata.hpp:180
std::vector< QuantLib::Date > exerciseDates_
Definition: optiondata.hpp:175
Serializable object holding option data.
Definition: optiondata.hpp:42
vector< string > exerciseFeeDates_
Definition: optiondata.hpp:135
string exerciseFeeSettlementPeriod_
Definition: optiondata.hpp:137
const string & exerciseFeeSettlementPeriod() const
Definition: optiondata.hpp:87
boost::optional< OptionPaymentData > paymentData_
Definition: optiondata.hpp:143
boost::optional< OptionExerciseData > exerciseData_
Definition: optiondata.hpp:142
const string & noticeConvention() const
Definition: optiondata.hpp:80
string exerciseFeeSettlementCalendar_
Definition: optiondata.hpp:138
string exerciseFeeSettlementConvention_
Definition: optiondata.hpp:139
const string & exerciseFeeSettlementCalendar() const
Definition: optiondata.hpp:88
const string & style() const
Definition: optiondata.hpp:74
const string & noticeCalendar() const
Definition: optiondata.hpp:79
const string & settlement() const
Definition: optiondata.hpp:81
virtual void fromXML(XMLNode *node) override
Definition: optiondata.cpp:32
vector< string > exerciseFeeTypes_
Definition: optiondata.hpp:136
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: optiondata.cpp:86
const vector< string > & exerciseFeeTypes() const
Definition: optiondata.hpp:86
boost::optional< bool > automaticExercise_
Definition: optiondata.hpp:141
const ScheduleData & exerciseDatesSchedule() const
Definition: optiondata.hpp:77
const bool & payoffAtExpiry() const
Definition: optiondata.hpp:75
const boost::optional< OptionPaymentData > & paymentData() const
Definition: optiondata.hpp:93
const boost::optional< OptionExerciseData > & exerciseData() const
Definition: optiondata.hpp:92
vector< string > exerciseDates_
Definition: optiondata.hpp:127
const vector< string > & exerciseFeeDates() const
Definition: optiondata.hpp:85
PremiumData premiumData_
Definition: optiondata.hpp:133
ScheduleData exerciseDatesSchedule_
Definition: optiondata.hpp:126
vector< double > exercisePrices_
Definition: optiondata.hpp:140
const string & exerciseFeeSettlementConvention() const
Definition: optiondata.hpp:89
const vector< double > & exerciseFees() const
Definition: optiondata.hpp:84
const vector< string > & exerciseDates() const
Definition: optiondata.hpp:76
const string & noticePeriod() const
Definition: optiondata.hpp:78
vector< double > exerciseFees_
Definition: optiondata.hpp:134
virtual void fromXML(XMLNode *node) override
Definition: premiumdata.cpp:37
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: premiumdata.cpp:76
bool hasData() const
Check if has any dates/rules/derived schedules.
Definition: schedule.hpp:223
virtual void fromXML(XMLNode *node) override
Definition: schedule.cpp:179
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: schedule.cpp:198
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
static vector< Real > getChildrenValuesAsDoubles(XMLNode *node, const string &names, const string &name, bool mandatory=false)
Definition: xmlutils.cpp:319
static void addChildren(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values)
Definition: xmlutils.cpp:502
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
static bool getChildValueAsBool(XMLNode *node, const string &name, bool mandatory=false, bool defaultValue=true)
Definition: xmlutils.cpp:296
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
static void addChildrenWithOptionalAttributes(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values, const string &attrName, const vector< string > &attrs)
Definition: xmlutils.cpp:542
static string getNodeValue(XMLNode *node)
Get a node's value.
Definition: xmlutils.cpp:489
static vector< string > getChildrenValues(XMLNode *node, const string &names, const string &name, bool mandatory=false)
Definition: xmlutils.cpp:306
static void setNodeName(XMLDocument &doc, XMLNode *node, const string &name)
Definition: xmlutils.cpp:478
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
static void appendNode(XMLNode *parent, XMLNode *child)
Definition: xmlutils.cpp:406
Calendar parseCalendar(const string &s)
Convert text to QuantLib::Calendar.
Definition: parsers.cpp:157
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
Definition: parsers.cpp:51
BusinessDayConvention parseBusinessDayConvention(const string &s)
Convert text to QuantLib::BusinessDayConvention.
Definition: parsers.cpp:173
Period parsePeriod(const string &s)
Convert text to QuantLib::Period.
Definition: parsers.cpp:171
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
Real parseReal(const string &s)
Convert text to Real.
Definition: parsers.cpp:112
leg data model and serialization
@ data
Definition: log.hpp:77
#define DLOG(text)
Logging Macro (Level = Debug)
Definition: log.hpp:554
#define WLOG(text)
Logging Macro (Level = Warning)
Definition: log.hpp:550
vector< T > buildScheduledVectorNormalised(const vector< T > &values, const vector< string > &dates, const Schedule &schedule, const T &defaultValue, const bool checkAllValuesAppearInResult=false)
Definition: legdata.hpp:1139
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
Schedule makeSchedule(const ScheduleDates &data)
Definition: schedule.cpp:263
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization
Map text representations to QuantLib/QuantExt types.
string conversion utilities