Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
commodityapo.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 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
23
37
38using namespace QuantExt;
39using namespace QuantLib;
40using std::map;
41using std::set;
42using std::string;
43
44namespace ore {
45namespace data {
46
48 const Envelope& envelope, const OptionData& optionData, Real quantity, Real strike, const string& currency,
49 const string& name, CommodityPriceType priceType, const string& startDate, const string& endDate,
50 const string& paymentCalendar, const string& paymentLag, const string& paymentConvention,
51 const string& pricingCalendar, const string& paymentDate, Real gearing, Spread spread,
52 CommodityQuantityFrequency commodityQuantityFrequency, CommodityPayRelativeTo commodityPayRelativeTo,
53 QuantLib::Natural futureMonthOffset, QuantLib::Natural deliveryRollDays, bool includePeriodEnd,
54 const BarrierData& barrierData, const std::string& fxIndex)
55 : Trade("CommodityAveragePriceOption", envelope), optionData_(optionData), barrierData_(barrierData),
56 quantity_(quantity), strike_(strike), currency_(currency), name_(name), priceType_(priceType),
57 startDate_(startDate), endDate_(endDate), paymentCalendar_(paymentCalendar), paymentLag_(paymentLag),
58 paymentConvention_(paymentConvention), pricingCalendar_(pricingCalendar), paymentDate_(paymentDate),
59 gearing_(gearing), spread_(spread), commodityQuantityFrequency_(commodityQuantityFrequency),
60 commodityPayRelativeTo_(commodityPayRelativeTo), futureMonthOffset_(futureMonthOffset),
61 deliveryRollDays_(deliveryRollDays), includePeriodEnd_(includePeriodEnd), fxIndex_(fxIndex), allAveraging_(false) {}
62
63void CommodityAveragePriceOption::build(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory) {
64
65 reset();
66
67
68 DLOG("CommodityAveragePriceOption::build() called for trade " << id());
69
70 // ISDA taxonomy, assuming Commodity follows the Equity template
71 additionalData_["isdaAssetClass"] = std::string("Commodity");
72 additionalData_["isdaBaseProduct"] = std::string("Option");
73 additionalData_["isdaSubProduct"] = std::string("Price Return Basic Performance");
74 // skip the transaction level mapping for now
75 additionalData_["isdaTransaction"] = std::string();
76
77 QL_REQUIRE(gearing_ > 0.0, "Gearing (" << gearing_ << ") should be positive.");
78 QL_REQUIRE(spread_ < strike_ || QuantLib::close_enough(spread_, strike_),
79 "Spread (" << spread_ << ") should be less than strike (" << strike_ << ").");
80
81 additionalData_["quantity"] = quantity_;
82 additionalData_["strike"] = strike_;
83 additionalData_["strikeCurrency"] = currency_;
84
85 // Notional = effective_quantity * effective_strike = (G x Q) x ((K - s) / G) = Q x (K - s)
86 notional_ = quantity_ * (strike_ - spread_);
87 notionalCurrency_ = npvCurrency_ = currency_;
88
89 // Allow exercise dates not to be specified for an APO. In this case, the exercise date is deduced below when
90 // building the APO or a standard option.
91 Date exDate;
92 if (!optionData_.exerciseDates().empty()) {
93 QL_REQUIRE(optionData_.exerciseDates().size() == 1, "Commodity average price option must be European");
94 exDate = parseDate(optionData_.exerciseDates().front());
95 }
96
97 // Just to get the configuration string for now
98 QuantLib::ext::shared_ptr<EngineBuilder> builder = engineFactory->builder(
99 barrierData_.initialized() ? "CommodityAveragePriceBarrierOption" : "CommodityAveragePriceOption");
100 string configuration = builder->configuration(MarketContext::pricing);
101
102 // Build the leg. In this method the allAveraging_ flag is set to true if the future itself is averaging and we
103 // can then use a standard commodity option pricer below.
104 Leg leg = buildLeg(engineFactory, configuration);
105
106 // Based on allAveraging_ flag, set up a standard or averaging commodity option
107 if (allAveraging_) {
108 buildStandardOption(engineFactory, leg, exDate);
109 } else {
110 buildApo(engineFactory, leg, exDate, builder);
111 }
112
113 // Add leg to legs_ so that fixings method can work.
114 legs_.push_back(leg);
115 legPayers_.push_back(false);
116 legCurrencies_.push_back(currency_);
117}
118
119std::map<AssetClass, std::set<std::string>> CommodityAveragePriceOption::underlyingIndices(
120 const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager) const {
121 return {{AssetClass::COM, std::set<std::string>({name_})}};
122}
123
124void CommodityAveragePriceOption::fromXML(XMLNode* node) {
125
126 Trade::fromXML(node);
127
128 XMLNode* apoNode = XMLUtils::getChildNode(node, "CommodityAveragePriceOptionData");
129 QL_REQUIRE(apoNode, "No CommodityAveragePriceOptionData Node");
130
131 optionData_.fromXML(XMLUtils::getChildNode(apoNode, "OptionData"));
132 if(auto b = XMLUtils::getChildNode(apoNode, "BarrierData")) {
133 barrierData_.fromXML(b);
134 }
135 name_ = XMLUtils::getChildValue(apoNode, "Name", true);
136 currency_ = XMLUtils::getChildValue(apoNode, "Currency", true);
137 quantity_ = XMLUtils::getChildValueAsDouble(apoNode, "Quantity", true);
138 strike_ = XMLUtils::getChildValueAsDouble(apoNode, "Strike", true);
139 priceType_ = parseCommodityPriceType(XMLUtils::getChildValue(apoNode, "PriceType", true));
140 startDate_ = XMLUtils::getChildValue(apoNode, "StartDate", true);
141 endDate_ = XMLUtils::getChildValue(apoNode, "EndDate", true);
142 paymentCalendar_ = XMLUtils::getChildValue(apoNode, "PaymentCalendar", true);
143 paymentLag_ = XMLUtils::getChildValue(apoNode, "PaymentLag", true);
144 paymentConvention_ = XMLUtils::getChildValue(apoNode, "PaymentConvention", true);
145 pricingCalendar_ = XMLUtils::getChildValue(apoNode, "PricingCalendar", true);
146
147 paymentDate_ = XMLUtils::getChildValue(apoNode, "PaymentDate", false);
148
149 gearing_ = 1.0;
150 if (XMLNode* n = XMLUtils::getChildNode(apoNode, "Gearing")) {
151 gearing_ = parseReal(XMLUtils::getNodeValue(n));
152 }
153
154 spread_ = XMLUtils::getChildValueAsDouble(apoNode, "Spread", false);
155
156 commodityQuantityFrequency_ = CommodityQuantityFrequency::PerCalculationPeriod;
157 if (XMLNode* n = XMLUtils::getChildNode(apoNode, "CommodityQuantityFrequency")) {
158 commodityQuantityFrequency_ = parseCommodityQuantityFrequency(XMLUtils::getNodeValue(n));
159 }
160
161 commodityPayRelativeTo_ = CommodityPayRelativeTo::CalculationPeriodEndDate;
162 if (XMLNode* n = XMLUtils::getChildNode(apoNode, "CommodityPayRelativeTo")) {
163 commodityPayRelativeTo_ = parseCommodityPayRelativeTo(XMLUtils::getNodeValue(n));
164 }
165
166 futureMonthOffset_ = XMLUtils::getChildValueAsInt(apoNode, "FutureMonthOffset", false);
167 deliveryRollDays_ = XMLUtils::getChildValueAsInt(apoNode, "DeliveryRollDays", false);
168
169 includePeriodEnd_ = true;
170 if (XMLNode* n = XMLUtils::getChildNode(apoNode, "IncludePeriodEnd")) {
171 includePeriodEnd_ = parseBool(XMLUtils::getNodeValue(n));
172 }
173
174 if (XMLNode* n = XMLUtils::getChildNode(apoNode, "FXIndex")){
175 fxIndex_ = XMLUtils::getNodeValue(n);
176 }
177}
178
179XMLNode* CommodityAveragePriceOption::toXML(XMLDocument& doc) const {
180
181 XMLNode* node = Trade::toXML(doc);
182
183 XMLNode* apoNode = doc.allocNode("CommodityAveragePriceOptionData");
184 XMLUtils::appendNode(node, apoNode);
185
186 XMLUtils::appendNode(apoNode, optionData_.toXML(doc));
187 if (barrierData_.initialized())
188 XMLUtils::appendNode(apoNode, barrierData_.toXML(doc));
189 XMLUtils::addChild(doc, apoNode, "Name", name_);
190 XMLUtils::addChild(doc, apoNode, "Currency", currency_);
191 XMLUtils::addChild(doc, apoNode, "Quantity", quantity_);
192 XMLUtils::addChild(doc, apoNode, "Strike", strike_);
193 XMLUtils::addChild(doc, apoNode, "PriceType", to_string(priceType_));
194 XMLUtils::addChild(doc, apoNode, "StartDate", startDate_);
195 XMLUtils::addChild(doc, apoNode, "EndDate", endDate_);
196 XMLUtils::addChild(doc, apoNode, "PaymentCalendar", paymentCalendar_);
197 XMLUtils::addChild(doc, apoNode, "PaymentLag", paymentLag_);
198 XMLUtils::addChild(doc, apoNode, "PaymentConvention", paymentConvention_);
199 XMLUtils::addChild(doc, apoNode, "PricingCalendar", pricingCalendar_);
200 XMLUtils::addChild(doc, apoNode, "PaymentDate", paymentDate_);
201 XMLUtils::addChild(doc, apoNode, "Gearing", gearing_);
202 XMLUtils::addChild(doc, apoNode, "Spread", spread_);
203 XMLUtils::addChild(doc, apoNode, "CommodityQuantityFrequency", to_string(commodityQuantityFrequency_));
204 XMLUtils::addChild(doc, apoNode, "CommodityPayRelativeTo", to_string(commodityPayRelativeTo_));
205 XMLUtils::addChild(doc, apoNode, "FutureMonthOffset", static_cast<int>(futureMonthOffset_));
206 XMLUtils::addChild(doc, apoNode, "DeliveryRollDays", static_cast<int>(deliveryRollDays_));
207 XMLUtils::addChild(doc, apoNode, "IncludePeriodEnd", includePeriodEnd_);
208 if(!fxIndex_.empty()){
209 XMLUtils::addChild(doc, apoNode, "FXIndex", fxIndex_);
210 }
211
212 return node;
213}
214
215Leg CommodityAveragePriceOption::buildLeg(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
216 const string& configuration) {
217
218 // Create the ScheduleData for use in the LegData. Tenor is not needed.
219 ScheduleData scheduleData(ScheduleDates("NullCalendar", "Unadjusted", "", {startDate_, endDate_}));
220
221 // Create the CommodityFloatingLegData. Want to generate a single averaging commodity coupon.
222 vector<Real> quantities{quantity_};
223 vector<string> quantityDates;
224 vector<Real> spreads{spread_};
225 vector<string> spreadDates;
226 vector<Real> gearings{gearing_};
227 vector<string> gearingDates;
228 vector<string> pricingDates;
229 bool isAveraged = true;
230 bool isInArrears = false;
231 QuantLib::ext::shared_ptr<CommodityFloatingLegData> commLegData = QuantLib::ext::make_shared<CommodityFloatingLegData>(
232 name_, priceType_, quantities, quantityDates, commodityQuantityFrequency_, commodityPayRelativeTo_, spreads,
233 spreadDates, gearings, gearingDates, CommodityPricingDateRule::FutureExpiryDate, pricingCalendar_, 0,
234 pricingDates, isAveraged, isInArrears, futureMonthOffset_, deliveryRollDays_, includePeriodEnd_, true,
235 QuantLib::Null<QuantLib::Natural>(), true, "", QuantLib::Null<QuantLib::Natural>(), false, QuantLib::Null<QuantLib::Natural>(),
236 fxIndex_);
237
238 // Create the LegData. All defaults are as in the LegData ctor.
239 vector<string> paymentDates = paymentDate_.empty() ? vector<string>() : vector<string>(1, paymentDate_);
240 LegData legData(commLegData, true, currency_, scheduleData, "", vector<Real>(), vector<string>(),
241 paymentConvention_, false, false, false, true, "", 0, "", vector<AmortizationData>(),
242 paymentLag_, "", paymentCalendar_, paymentDates);
243
244 // Get the leg builder, set the allAveraging_ flag and build the leg
245 auto legBuilder = engineFactory->legBuilder(legData.legType());
246 QuantLib::ext::shared_ptr<CommodityFloatingLegBuilder> cflb =
247 QuantLib::ext::dynamic_pointer_cast<CommodityFloatingLegBuilder>(legBuilder);
248 QL_REQUIRE(cflb, "Expected a CommodityFloatingLegBuilder for leg type " << legData.legType());
249 Leg leg = cflb->buildLeg(legData, engineFactory, requiredFixings_, configuration);
250 allAveraging_ = cflb->allAveraging();
251
252 return leg;
253}
254
255void CommodityAveragePriceOption::buildStandardOption(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
256 const Leg& leg, Date exerciseDate) {
257
258 QL_REQUIRE(!barrierData_.initialized(), "Commodity APO: standard option does not support barriers");
259
260 // Expect the leg to hold a single commodity averaging cashflow on which the option is written
261 QL_REQUIRE(leg.size() == 1, "Single flow expected but found " << leg.size());
262 auto flow = QuantLib::ext::dynamic_pointer_cast<CommodityIndexedCashFlow>(leg[0]);
263 QL_REQUIRE(flow, "Expected a cashflow of type CommodityIndexedCashFlow");
264
265 // If exercise date is given use it. If not given, take the cashflow's pricing date.
266 if (exerciseDate != Date()) {
267 QL_REQUIRE(exerciseDate >= flow->pricingDate(),
268 "Exercise date, " << io::iso_date(exerciseDate) << ", should be on or after the pricing date, "
269 << io::iso_date(flow->pricingDate()));
270 DLOG("buildStandardOption: explicit exercise date given for APO " << io::iso_date(exerciseDate) << ".");
271 } else {
272 exerciseDate = flow->pricingDate();
273 optionData_.setExerciseDates({to_string(exerciseDate)});
274 DLOG("buildStandardOption: set exercise date on APO to cashflow's pricing date " << io::iso_date(exerciseDate)
275 << ".");
276 }
277 DLOG("buildStandardOption: pricing date on APO is " << io::iso_date(flow->pricingDate()) << ".");
278
279 // Update the optionData_ if necessary
280 if (!optionData_.automaticExercise()) {
281 optionData_.setAutomaticExercise(true);
282 DLOG("buildStandardOption: setting automatic exercise to true on APO.");
283 }
284
285 if (!optionData_.paymentData()) {
286 QL_REQUIRE(exerciseDate <= flow->date(), "Exercise date, " << io::iso_date(exerciseDate)
287 << ", should be on or before payment date, "
288 << io::iso_date(flow->date()));
289 string strDate = to_string(flow->date());
290 optionData_.setPaymentData(OptionPaymentData({strDate}));
291 DLOG("buildStandardOption: setting payment date to " << strDate << " on APO.");
292 } else {
293 DLOG("buildStandardOption: using explicitly provided payment data on APO.");
294 }
295
296 // Build the commodity option.
297 TradeStrike effectiveStrike((strike_ - spread_) / gearing_, currency_);
298 Real effectiveQuantity = gearing_ * quantity_;
299 CommodityOption commOption(envelope(), optionData_, name_, currency_, effectiveQuantity, effectiveStrike,
300 flow->index()->isFuturesIndex(), flow->pricingDate());
301 commOption.build(engineFactory);
302 setSensitivityTemplate(commOption.sensitivityTemplate());
303 instrument_ = commOption.instrument();
304 maturity_ = commOption.maturity();
305}
306
307void CommodityAveragePriceOption::buildApo(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory, const Leg& leg,
308 Date exerciseDate, const QuantLib::ext::shared_ptr<EngineBuilder>& builder) {
309
310 // Expect the leg to hold a single commodity averaging cashflow on which the option is written
311 QL_REQUIRE(leg.size() == 1, "Single flow expected but found " << leg.size());
312 auto apoFlow = QuantLib::ext::dynamic_pointer_cast<CommodityIndexedAverageCashFlow>(leg[0]);
313 QL_REQUIRE(apoFlow, "Expected a cashflow of type CommodityIndexedAverageCashFlow");
314
315 // Populate relevant Trade members
316 maturity_ = std::max(optionData_.premiumData().latestPremiumDate(), apoFlow->date());
317
318 Date lastApoFixingDate = apoFlow->indices().rbegin()->first;
319
320 // If exercise date is given use it. If not given, take the cashflow's last pricing date.
321 if (exerciseDate != Date()) {
322 QL_REQUIRE(exerciseDate >= lastApoFixingDate, "Exercise date, "
323 << io::iso_date(exerciseDate)
324 << ", should be on or after the last APO fixing date, "
325 << io::iso_date(lastApoFixingDate));
326 DLOG("buildApo: explicit exercise date given for APO " << io::iso_date(exerciseDate) << ".");
327 } else {
328 exerciseDate = lastApoFixingDate;
329 string strDate = to_string(lastApoFixingDate);
330 optionData_.setExerciseDates({strDate});
331 DLOG("buildApo: set exercise date on APO to cashflow's last pricing date " << io::iso_date(lastApoFixingDate)
332 << ".");
333 }
334 DLOG("buildApo: pricing date on APO is " << io::iso_date(lastApoFixingDate) << ".");
335
336 QL_REQUIRE(exerciseDate <= apoFlow->date(), "Exercise date, " << io::iso_date(exerciseDate)
337 << ", should be on or before payment date, "
338 << io::iso_date(apoFlow->date()));
339
340 // If the apo is payout and the underlying are quoted in different currencies, handle the fxIndex
341 QuantLib::ext::shared_ptr<FxIndex> fxIndex;
342 if(!fxIndex_.empty()) {
343 auto underlyingCcy =
344 QuantLib::ext::dynamic_pointer_cast<CommodityIndexedAverageCashFlow>(leg[0])->index()->priceCurve()->currency();
345 // check currencies consistency
346 QL_REQUIRE(npvCurrency_ == underlyingCcy.code() || npvCurrency_ == currency_, "Commodity cross-currency APO: inconsistent currencies in trade.");
347
348 // only add an fx index if underlying currency differs from trade currency
349 if (npvCurrency_ != underlyingCcy.code()) {
350 fxIndex = buildFxIndex(fxIndex_, npvCurrency_, underlyingCcy.code(), engineFactory->market(),
351 engineFactory->configuration(MarketContext::pricing));
352 for (auto cf : leg) { // request appropriate fixings
353 auto cacf = QuantLib::ext::dynamic_pointer_cast<CommodityIndexedAverageCashFlow>(cf);
354 for (auto kv : cacf->indices()) {
355 if (!fxIndex->fixingCalendar().isBusinessDay(
356 kv.first)) { // If fx index is not available for the commodity pricing day,
357 // this ensures to require the previous valid one which will be used in pricing
358 // from fxIndex()->fixing(...)
359 Date adjustedFixingDate = fxIndex->fixingCalendar().adjust(kv.first, Preceding);
360 requiredFixings_.addFixingDate(adjustedFixingDate, fxIndex_);
361
362 } else {
363 requiredFixings_.addFixingDate(kv.first, fxIndex_);
364 }
365 }
366 }
367 }
368 }
369
370 // get barrier info
371 Real barrierLevel = Null<Real>();
372 Barrier::Type barrierType = Barrier::DownIn;
373 Exercise::Type barrierStyle = Exercise::American;
374 if (barrierData_.initialized()) {
375 QL_REQUIRE(barrierData_.levels().size() == 1, "Commodity APO: Expected exactly one barrier level.");
376 barrierLevel = barrierData_.levels().front().value();
377 barrierType = parseBarrierType(barrierData_.type());
378 if (!barrierData_.style().empty()) {
379 barrierStyle = parseExerciseType(barrierData_.style());
380 QL_REQUIRE(barrierStyle == Exercise::European || barrierStyle == Exercise::American,
381 "Commodity APO: Expected 'European' or 'American' as barrier style");
382 }
383 }
384
385 // Create the APO instrument
386 QuantLib::ext::shared_ptr<QuantLib::Exercise> exercise = QuantLib::ext::make_shared<EuropeanExercise>(exerciseDate);
387 auto apo = QuantLib::ext::make_shared<QuantExt::CommodityAveragePriceOption>(
388 apoFlow, exercise, apoFlow->periodQuantity(), strike_, parseOptionType(optionData_.callPut()),
389 Settlement::Physical, Settlement::PhysicalOTC, barrierLevel, barrierType, barrierStyle, fxIndex);
390
391 // Set the pricing engine
392 Currency ccy = parseCurrency(currency_);
393 auto engineBuilder = QuantLib::ext::dynamic_pointer_cast<CommodityApoBaseEngineBuilder>(builder);
394 QuantLib::ext::shared_ptr<PricingEngine> engine = engineBuilder->engine(ccy, name_, id(), apo);
395 apo->setPricingEngine(engine);
396 setSensitivityTemplate(*engineBuilder);
397
398 // position type and trade multiplier
399 Position::Type positionType = parsePositionType(optionData_.longShort());
400 Real multiplier = positionType == Position::Long ? 1.0 : -1.0;
401
402 // Take care of fees
403 vector<QuantLib::ext::shared_ptr<Instrument>> additionalInstruments;
404 vector<Real> additionalMultipliers;
405 addPremiums(additionalInstruments, additionalMultipliers, multiplier, optionData_.premiumData(),
406 positionType == Position::Long ? -1.0 : 1.0, ccy, engineFactory,
407 engineBuilder->configuration(MarketContext::pricing));
408
409 // Populate instrument wrapper
410 instrument_ = QuantLib::ext::make_shared<VanillaInstrument>(apo, multiplier, additionalInstruments, additionalMultipliers);
411}
412
413} // namespace data
414} // namespace ore
Engine builder for commodity average price options.
const boost::shared_ptr< FxIndex > & fxIndex() const
Exercise::Type barrierStyle() const
boost::shared_ptr< FxIndex > fxIndex_
Commodity option trade representation.
void build(const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory) override
Build underlying instrument and link pricing engine.
Serializable object holding leg data.
Definition: legdata.hpp:844
const string & legType() const
Definition: legdata.hpp:890
Serializable schedule data.
Definition: schedule.hpp:202
Serializable object holding schedule Dates data.
Definition: schedule.hpp:110
const std::string & sensitivityTemplate() const
Definition: trade.cpp:305
const Date & maturity() const
Definition: trade.hpp:157
const QuantLib::ext::shared_ptr< InstrumentWrapper > & instrument() const
Definition: trade.hpp:141
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
Commodity Average Price Option data model and serialization.
Commodity fixed and floating leg builders.
Commodity option representation.
Pricing Engine Factory.
Logic for calculating required fixing dates on legs.
Exercise::Type parseExerciseType(const std::string &s)
Convert text to QuantLib::Exercise::Type.
Definition: parsers.cpp:466
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
Definition: parsers.cpp:51
Currency parseCurrency(const string &s)
Convert text to QuantLib::Currency.
Definition: parsers.cpp:290
Position::Type parsePositionType(const std::string &s)
Convert text to QuantLib::Position::Type.
Definition: parsers.cpp:404
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
Barrier::Type parseBarrierType(const std::string &s)
Convert std::string to QuantLib::BarrierType.
Definition: parsers.cpp:1042
Real parseReal(const string &s)
Convert text to Real.
Definition: parsers.cpp:112
Option::Type parseOptionType(const std::string &s)
Convert text to QuantLib::Option::Type.
Definition: parsers.cpp:481
SimpleQuote & spread_
Classes and functions for log message handling.
@ data
Definition: log.hpp:77
#define DLOG(text)
Logging Macro (Level = Debug)
Definition: log.hpp:554
market data related utilties
CommodityQuantityFrequency
set< Date > pricingDates(const Date &s, const Date &e, const Calendar &pricingCalendar, bool excludeStart, bool includeEnd, bool useBusinessDays)
CommodityPriceType parseCommodityPriceType(const string &s)
CommodityPayRelativeTo parseCommodityPayRelativeTo(const string &s)
void reset(const ASTNodePtr root)
Definition: astresetter.cpp:44
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
CommodityQuantityFrequency parseCommodityQuantityFrequency(const string &s)
Convert text to QuantExt::CommodityQuantityFrequency.
Definition: parsers.cpp:1192
QuantLib::ext::shared_ptr< QuantExt::FxIndex > buildFxIndex(const string &fxIndex, const string &domestic, const string &foreign, const QuantLib::ext::shared_ptr< Market > &market, const string &configuration, bool useXbsCurves)
Definition: marketdata.cpp:137
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Wrapper for option instruments, tracks whether option has been exercised or not.
Map text representations to QuantLib/QuantExt types.
trade schedule data model and serialization
string conversion utilities
string name