Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
parsers.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 Quaternion Risk Management Ltd
3 Copyright (C) 2021 Skandinaviska Enskilda Banken AB (publ)
4 All rights reserved.
5
6 This file is part of ORE, a free-software/open-source library
7 for transparent pricing and risk analysis - http://opensourcerisk.org
8
9 ORE is free software: you can redistribute it and/or modify it
10 under the terms of the Modified BSD License. You should have received a
11 copy of the license along with this program.
12 The license is also available online at <http://opensourcerisk.org>
13
14 This program is distributed on the basis that it will form a useful
15 contribution to risk analytics and model standardisation, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file ored/utilities/parsers.hpp
21 \brief Map text representations to QuantLib/QuantExt types
22 \ingroup utilities
23*/
24
25#pragma once
26
31
39#include <qle/termstructures/sabrparametricvolatility.hpp>
40
41#include <ql/cashflows/cpicoupon.hpp>
42#include <ql/compounding.hpp>
43#include <ql/currency.hpp>
44#include <ql/exercise.hpp>
45#include <ql/instruments/doublebarriertype.hpp>
46#include <ql/experimental/fx/deltavolquote.hpp>
47#include <ql/instruments/averagetype.hpp>
48#include <ql/instruments/barriertype.hpp>
49#include <ql/instruments/bond.hpp>
50#include <ql/instruments/capfloor.hpp>
51#include <ql/instruments/inflationcapfloor.hpp>
52#include <ql/instruments/overnightindexfuture.hpp>
53#include <ql/instruments/swaption.hpp>
54#include <ql/methods/finitedifferences/solvers/fdmbackwardsolver.hpp>
55#include <ql/methods/montecarlo/lsmbasissystem.hpp>
56#include <ql/position.hpp>
57#include <ql/termstructures/bootstraphelper.hpp>
58#include <ql/time/businessdayconvention.hpp>
59#include <ql/time/calendar.hpp>
60#include <ql/time/date.hpp>
61#include <ql/time/dategenerationrule.hpp>
62#include <ql/time/daycounter.hpp>
63#include <ql/time/period.hpp>
64#include <ql/types.hpp>
65
66#include <boost/algorithm/string/trim.hpp>
67#include <boost/tokenizer.hpp>
68#include <boost/variant.hpp>
69
70namespace ore {
71namespace data {
72using std::string;
73
74//! Convert std::string to QuantLib::Date
75/*!
76 \ingroup utilities
77*/
78QuantLib::Date parseDate(const string& s);
79
80//! Convert text to Real
81/*!
82 \ingroup utilities
83*/
84QuantLib::Real parseReal(const string& s);
85
86//! Convert text to Real, empty string to Null<Real>()
87/*!
88 \ingroup utilities
89*/
90Real parseRealOrNull(const string& s);
91
92//! Attempt to convert text to Real
93/*! Attempts to convert text to Real
94 \param[in] s The string we wish to convert to a Real
95 \param[out] result The result of the conversion if it is valid.
96 Null<Real>() if conversion fails
97
98 \return True if the conversion was successful, False if not
99
100 \ingroup utilities
101*/
102bool tryParseReal(const string& s, QuantLib::Real& result);
103
104//! Convert text to QuantLib::Integer
105/*!
106 \ingroup utilities
107*/
108QuantLib::Integer parseInteger(const string& s);
109
110//! Convert text to bool
111/*!
112 \ingroup utilities
113*/
114bool parseBool(const string& s);
115
116//! Convert text to QuantLib::Calendar
117/*!
118
119 For a joint calendar, the separate calendar names should be
120 comma-delimited.
121 \ingroup utilities
122*/
123QuantLib::Calendar parseCalendar(const string& s);
124
125//! return true if s represents a period of the form [0-9][D|W|M|Y] (i.e. 1Y6M would return false)
126bool isOnePeriod(const string& s);
127
128//! Convert text to QuantLib::Period
129/*!
130 \ingroup utilities
131 */
132QuantLib::Period parsePeriod(const string& s);
133
134//! Convert text to QuantLib::BusinessDayConvention
135/*!
136 \ingroup utilities
137 */
138QuantLib::BusinessDayConvention parseBusinessDayConvention(const string& s);
139
140//! Convert text to QuantLib::DayCounter
141/*!
142 \ingroup utilities
143 */
144QuantLib::DayCounter parseDayCounter(const string& s);
145
146//! Convert text to QuantLib::Currency
147/*!
148 \ingroup utilities
149 */
150QuantLib::Currency parseCurrency(const string& s);
151
152//! Convert text to QuantExt::ConfigurableCurrency::Type (Major, Minor, Metal, Crypto)
153/*!
154 \ingroup utilities
155 */
156QuantExt::ConfigurableCurrency::Type parseCurrencyType(const string& s);
157
158//! Convert text to QuantLib::Currency for minor currencies e.g GBp -> GBPCurrency()
159/*!
160 \ingroup utilities
161 */
162QuantLib::Currency parseMinorCurrency(const string& s);
163
164//! Convert text to QuantLib::Currency
165/*!
166 \ingroup utilities
167 */
168QuantLib::Currency parseCurrencyWithMinors(const string& s);
169
170//! Convert text to std::pair<QuantLib::Currency, QuantLib::Currency>
171/*!
172 \ingroup utilities
173 */
174std::pair<QuantLib::Currency, QuantLib::Currency> parseCurrencyPair(const string& s, const string& delimiters);
175
176//! check for vaid currency code, including minors and pseudo currencies
177/*!
178 \ingroup utilities
179 */
180bool checkCurrency(const string& code);
181
182//! check for pseudo currency = precious metal or crypto currency */
183/*!
184 \ingroup utilities
185 */
186bool isPseudoCurrency(const string& code);
187
188//! check for precious metal */
189/*!
190 \ingroup utilities
191 */
192bool isPreciousMetal(const string& code);
193
194//! check for crypto currency */
195/*!
196 \ingroup utilities
197 */
198bool isCryptoCurrency(const string& code);
199
200//! Convert a value from a minor ccy to major
201/*! .i.e 100 GBp to 1 GBP
202 \ingroup utilities
203*/
204QuantLib::Real convertMinorToMajorCurrency(const std::string& s, QuantLib::Real value);
205
206//! Convert text to QuantLib::DateGeneration::Rule
207/*!
208 \ingroup utilities
209 */
210QuantLib::DateGeneration::Rule parseDateGenerationRule(const string& s);
211
212//! Convert text to QuantLib::Frequency
213/*!
214\ingroup utilities
215*/
216QuantLib::Frequency parseFrequency(const string& s);
217
218//! Convert text to QuantLib::Compounding;
219/*!
220\ingroup utilities
221*/
222QuantLib::Compounding parseCompounding(const string& s);
223
224//! Convert text to QuantLib::Position::Type
225/*!
226\ingroup utilities
227*/
228QuantLib::Position::Type parsePositionType(const string& s);
229
230//! Convert text to QuantLib::Protection::Side
231/*!
232\ingroup utilities
233*/
234QuantLib::Protection::Side parseProtectionSide(const string& s);
235
236//! Convert text to QuantLib::Settlement::Type
237/*!
238\ingroup utilities
239*/
240QuantLib::Settlement::Type parseSettlementType(const string& s);
241
242//! Convert text to QuantLib::Settlement::Method
243/*!
244\ingroup utilities
245*/
246QuantLib::Settlement::Method parseSettlementMethod(const string& s);
247
248//! Convert text to QuantLib::Exercise::Type
249/*!
250\ingroup utilities
251*/
252QuantLib::Exercise::Type parseExerciseType(const string& s);
253
254//! Convert text to QuantLib::Option::Type
255/*!
256\ingroup utilities
257*/
258QuantLib::Option::Type parseOptionType(const string& s);
259
260//! Convert text to QuantLib::Bond::Price::Type
261/*!
262\ingroup utilities
263*/
264QuantLib::Bond::Price::Type parseBondPriceType(const string& s);
265
266//! Convert text to QuantLib::Period or QuantLib::Date
267/*!
268\ingroup utilities
269*/
270boost::variant<QuantLib::Date, QuantLib::Period> parseDateOrPeriod(const string& s);
271
272//! Convert text to QuantLib::Period or QuantLib::Date (deprecated version)
273/*!
274\ingroup utilities
275*/
276void parseDateOrPeriod(const string& s, QuantLib::Date& d, QuantLib::Period& p, bool& isDate);
277
278//! Convert text to QuantLib::LsmBasisSystem::PolynomialType
279/*!
280\ingroup utilities
281*/
282QuantLib::LsmBasisSystem::PolynomialType parsePolynomType(const std::string& s);
283
284//! Write QuantLib::LsmBasisSystem::PolynomialType to stream
285/*!
286\ingroup utilities
287*/
288std::ostream& operator<<(std::ostream& os, QuantLib::LsmBasisSystem::PolynomialType a);
289
290//! Convert text to QuantLib::SobolBrownianGenerator::Ordering
291/*!
292\ingroup utilities
293*/
294QuantLib::SobolBrownianGenerator::Ordering parseSobolBrownianGeneratorOrdering(const std::string& s);
295
296//! Convert text to QuantLib::SobolRsg::DirectionIntegers
297/*!
298\ingroup utilities
299*/
300QuantLib::SobolRsg::DirectionIntegers parseSobolRsgDirectionIntegers(const std::string& s);
301
302/*! Convert text to QuantLib::Weekday
303 \ingroup utilities
304*/
305QuantLib::Weekday parseWeekday(const std::string& s);
306
307/*! Convert text to QuantLib::Month
308 \ingroup utilities
309*/
310QuantLib::Month parseMonth(const std::string& s);
311
312
313//! Convert text to PaymentLag
314/*!
315\ingroup utilities
316*/
317PaymentLag parsePaymentLag(const string& s);
318
319//! Convert comma separated list of values to vector of values
320/*!
321\ingroup utilities
322*/
323template <class T> std::vector<T> parseListOfValues(string s, std::function<T(string)> parser) {
324 boost::trim(s);
325 std::vector<T> vec;
326 boost::char_separator<char> sep(",");
327 boost::tokenizer<boost::char_separator<char>> tokens(s, sep);
328 for (auto r : tokens) {
329 boost::trim(r);
330 vec.push_back(parser(r));
331 }
332 return vec;
333}
334
335template <class T> std::vector<T> parseVectorOfValues(std::vector<std::string> str, std::function<T(string)> parser) {
336 std::vector<T> vec;
337 for (auto s : str) {
338 vec.push_back(parser(s));
339 }
340 return vec;
341}
342
343std::vector<string> parseListOfValues(string s, const char escape = '\\', const char delim = ',',
344 const char quote = '\"');
345
347 None,
351 Annuity,
353};
354AmortizationType parseAmortizationType(const std::string& s);
355
356//! Convert string to sequence type
357/*!
358\ingroup utilities
359*/
360QuantExt::SequenceType parseSequenceType(const std::string& s);
361
362//! Convert string to observation interpolation
363/*!
364\ingroup utilities
365*/
366QuantLib::CPI::InterpolationType parseObservationInterpolation(const std::string& s);
367
368//! Convert string to fdm scheme desc
369/*!
370\ingroup utilities
371*/
372QuantLib::FdmSchemeDesc parseFdmSchemeDesc(const std::string& s);
373
374enum class AssetClass { EQ, FX, COM, IR, INF, CR, BOND, BOND_INDEX };
375
376//! Convert text to ore::data::AssetClass
377/*!
378\ingroup utilities
379*/
380AssetClass parseAssetClass(const std::string& s);
381
382//! Write ore::data::AssetClass to stream
383/*!
384\ingroup utilities
385*/
386std::ostream& operator<<(std::ostream& os, AssetClass a);
387
388//! Convert text to QuantLib::DeltaVolQuote::AtmType
389/*!
390\ingroup utilities
391*/
392QuantLib::DeltaVolQuote::AtmType parseAtmType(const std::string& s);
393
394//! Convert text to QuantLib::DeltaVolQuote::DeltaType
395/*!
396\ingroup utilities
397*/
398QuantLib::DeltaVolQuote::DeltaType parseDeltaType(const std::string& s);
399
400//! Convert text to QuantLib::Rounding
401/*!
402\ingroup utilities
403*/
404QuantLib::Rounding::Type parseRoundingType(const std::string& s);
405
406//! Convert std::string to QuantLib::BarrierType
407/*!
408 \ingroup utilities
409*/
410QuantLib::Barrier::Type parseBarrierType(const string& s);
411
412//! Convert std::string to QuantLib::DoubleBarrierType
413/*!
414 \ingroup utilities
415*/
416QuantLib::DoubleBarrier::Type parseDoubleBarrierType(const string& s);
417
418/*! Attempt to parse string \p str to \p obj of type \c T using \p parser
419 \param[in] str The string we wish to parse.
420 \param[out] obj The resulting object if the parsing was successful.
421 \param[in] parser The function to use to attempt to parse \p str. This function may throw.
422
423 \return \c true if the parsing was successful and \c false if not.
424
425 \ingroup utilities
426*/
427template <class T> bool tryParse(const std::string& str, T& obj, std::function<T(const std::string&)> parser) {
428 DLOG("tryParse: attempting to parse " << str);
429 try {
430 obj = parser(str);
431 } catch (...) {
432 TLOG("String " << str << " could not be parsed");
433 return false;
434 }
435 return true;
436}
437
438inline bool tryParseCurrency(const std::string& str, Currency& obj) {
439 DLOG("tryParse: attempting to parse currency from " << str);
440 try {
441 obj = parseCurrency(str);
442 } catch (...) {
443 TLOG("String " << str << " could not be parsed");
444 return false;
445 }
446 return true;
447}
448
449//! Enumeration for holding various extrapolation settings
451
452//! Parse Extrapolation from string
453Extrapolation parseExtrapolation(const std::string& s);
454
455//! Write Extrapolation, \p extrap, to stream.
456std::ostream& operator<<(std::ostream& os, Extrapolation extrap);
457
458/*! Convert text to QuantLib::VolatilityType
459 \ingroup utilities
460*/
461QuantLib::VolatilityType parseVolatilityQuoteType(const std::string& s);
462
463/*! Convert text to QuantLib::CapFloor::Type
464 \ingroup utilities
465*/
466QuantLib::CapFloor::Type parseCapFloorType(const std::string& s);
467
468/*! Convert text to QuantLib::YoYInflationCapFloor::Type
469 \ingroup utilities
470*/
471QuantLib::YoYInflationCapFloor::Type parseYoYInflationCapFloorType(const std::string& s);
472
473/*! Convert text to QuantExt::CrossAssetModelTypes::AssetType
474 \ingroup utilities
475*/
477
478/*! Convert boost::any to pair<string,string>, including the valueType and the value
479 \ingroup utilities
480*/
481std::pair<string, string> parseBoostAny(const boost::any& anyType, Size precision = 8);
482
483//! Convert text to QuantLib::RateAveraging::Type
484QuantLib::RateAveraging::Type parseOvernightIndexFutureNettingType(const std::string& s);
485
486//! Write QuantLib::RateAveraging::Type to stream
487std::ostream& operator<<(std::ostream& os, QuantLib::RateAveraging::Type t);
488
489//! Convert text to FutureConvention::DateGeneration
491
492//! Write QuantLib::RateAveraging::Type to stream
493std::ostream& operator<<(std::ostream& os, FutureConvention::DateGenerationRule t);
494
495//! Convert text to InflationSwapConvention::PublicationRoll
497
498//! Write InflationSwapConvention::PublicationRoll to stream
499std::ostream& operator<<(std::ostream& os, InflationSwapConvention::PublicationRoll pr);
500
501//! Write QuantLib::SobolBrownianGenerator::Ordering to stream
502std::ostream& operator<<(std::ostream& os, SobolBrownianGenerator::Ordering t);
503
504//! Write QuantLib::SobolRsg::DirectionIntegers to stream
505std::ostream& operator<<(std::ostream& os, SobolRsg::DirectionIntegers t);
506
507//! Enum to string used in ScenarioGeneratorData's toXML
508std::ostream& operator<<(std::ostream& os, QuantExt::CrossAssetModel::Discretization type);
509
510//! Convert text to CommodityFutureConvention::AveragingData::CalculationPeriod
512
513//! Write CommodityFutureConvention::AveragingData::CalculationPeriod to stream
515
516//! Convert text to PriceSegment::Type
517PriceSegment::Type parsePriceSegmentType(const std::string& s);
518
519//! Write PriceSegment::Type to stream
520std::ostream& operator<<(std::ostream& os, PriceSegment::Type pst);
521
522//! Convert text to QuantExt::CommodityQuantityFrequency
524
525//! Write QuantExt::CommodityQuantityFrequency to stream
526std::ostream& operator<<(std::ostream& os, QuantExt::CommodityQuantityFrequency cqf);
527
528/*! Convert text to QuantExt::CdsOption::StrikeType
529 \ingroup utilities
530*/
532
533/*! Convert text to QuantLib::Average::Type
534 \ingroup utilities
535*/
536QuantLib::Average::Type parseAverageType(const std::string& s);
537
538/*! Convert text to QuantExt::BondData::PriceQuoteMethod
539\ingroup utilities
540 */
542
543//! Write PriceQuoteMethod to stream
544std::ostream& operator<<(std::ostream& os, QuantExt::BondIndex::PriceQuoteMethod);
545
546//! Helper function to get the two tokens in a correlation name Index2:Index1
547std::vector<std::string> getCorrelationTokens(const std::string& name);
548
549//! Convert FX pair to market standard dominance
550/*!
551 Convert FX pair to market standard dominance, e.g. "USD" & "GBP" -> "GBPUSD", "USD" & "JPY" -> "USDJPY"
552 \ingroup utilities
553*/
554string fxDominance(const string& s1, const string& s2);
555
556//! Convert FX index name to market standard dominance
557string normaliseFxIndex(const std::string& indexName);
558
560
561//! Convert text to ore::data::MomentType
562/*!
563\ingroup utilities
564*/
565MomentType parseMomentType(const std::string& s);
566
567//! Enumeration CreditPortfolioSensitivityDecomposition
569
570//! Convert text to CreditPortfolioSensitivitiyDecomposition
572
573//! Output operator for CreditPortfolioSensitivityDecomposition
574std::ostream& operator<<(std::ostream& os, const CreditPortfolioSensitivityDecomposition d);
575
576//! Convert text to QuantLib::Pillar::Choice
577/*!
578\ingroup utilities
579*/
580QuantLib::Pillar::Choice parsePillarChoice(const std::string& s);
581
582//! Convert text to QuantExt::McMultiLegBaseEngine::RegressorModel
583/*!
584\ingroup utilities
585*/
586QuantExt::McMultiLegBaseEngine::RegressorModel parseRegressorModel(const std::string& s);
587
589
590//! Convert text to MporCashFlowMode
591/*!
592\ingroup utilities
593*/
594MporCashFlowMode parseMporCashFlowMode(const std::string& s);
595
596//! Write MporCashFlowMode to stream
597/*!
598\ingroup utilities
599*/
600std::ostream& operator<<(std::ostream& os, MporCashFlowMode t);
601
602//! Parse SabrParametricVolatility::ModelVariant
603/*!
604\ingroup utilities
605*/
606QuantExt::SabrParametricVolatility::ModelVariant parseSabrParametricVolatilityModelVariant(const std::string& s);
607
608//! Write SabrParametricVolatility::ModelVariant
609/*!
610\ingroup utilities
611*/
612std::ostream& operator<<(std::ostream& out, QuantExt::SabrParametricVolatility::ModelVariant m);
613
614//! Write QuantLib::Exercise::Type
615/*!
616\ingroup utilities
617*/
618std::ostream& operator<<(std::ostream& os, QuantLib::Exercise::Type type);
619
620} // namespace data
621} // namespace ore
CalculationPeriod
Indicate location of calculation period relative to the future expiry date.
PublicationRoll
Rule for determining when inflation swaps roll to observing latest inflation index release.
Type
Type of price segment being represented, i.e. type of instrument in the price segment.
Class to hold Underlyings.
Definition: underlying.hpp:37
Commodity curve configuration class.
SafeStack< ValueType > value
Currency and instrument specific conventions/defaults.
DateGeneration::Rule parseDateGenerationRule(const string &s)
Convert text to QuantLib::DateGeneration::Rule.
Definition: parsers.cpp:328
Calendar parseCalendar(const string &s)
Convert text to QuantLib::Calendar.
Definition: parsers.cpp:157
CdsOption::StrikeType parseCdsOptionStrikeType(const string &s)
Definition: parsers.cpp:1240
Exercise::Type parseExerciseType(const std::string &s)
Convert text to QuantLib::Exercise::Type.
Definition: parsers.cpp:466
Currency parseMinorCurrency(const string &s)
Convert text to QuantLib::Currency for minor currencies e.g GBp -> GBPCurrency()
Definition: parsers.cpp:308
Month parseMonth(const string &s)
Definition: parsers.cpp:613
QuantExt::ConfigurableCurrency::Type parseCurrencyType(const string &s)
Convert text to QuantExt::ConfigurableCurrency::Type (Major, Minor, Metal, Crypto)
Definition: parsers.cpp:292
MporCashFlowMode parseMporCashFlowMode(const string &s)
Convert text to MporCashFlowMode.
Definition: parsers.cpp:1428
YoYInflationCapFloor::Type parseYoYInflationCapFloorType(const string &s)
Definition: parsers.cpp:827
SequenceType parseSequenceType(const std::string &s)
Convert string to sequence type.
Definition: parsers.cpp:668
bool tryParseReal(const string &s, QuantLib::Real &result)
Attempt to convert text to Real.
Definition: parsers.cpp:126
VolatilityType parseVolatilityQuoteType(const string &s)
Definition: parsers.cpp:804
QuantLib::LsmBasisSystem::PolynomialType parsePolynomType(const std::string &s)
Convert text to QuantLib::LsmBasisSystem::PolynomialType.
Definition: parsers.cpp:527
DoubleBarrier::Type parseDoubleBarrierType(const std::string &s)
Convert std::string to QuantLib::DoubleBarrierType.
Definition: parsers.cpp:1061
pair< string, string > parseBoostAny(const boost::any &anyType, Size precision)
Definition: parsers.cpp:859
bool tryParse(const std::string &str, T &obj, std::function< T(const std::string &)> parser)
Definition: parsers.hpp:427
Settlement::Method parseSettlementMethod(const std::string &s)
Convert text to QuantLib::Settlement::Method.
Definition: parsers.cpp:450
Currency parseCurrencyWithMinors(const string &s)
Convert text to QuantLib::Currency.
Definition: parsers.cpp:310
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
Definition: parsers.cpp:51
QuantLib::Real convertMinorToMajorCurrency(const std::string &s, QuantLib::Real value)
Convert a value from a minor ccy to major.
Definition: parsers.cpp:324
boost::variant< QuantLib::Date, QuantLib::Period > parseDateOrPeriod(const string &s)
Convert text to QuantLib::Period or QuantLib::Date.
Definition: parsers.cpp:493
bool isCryptoCurrency(const string &code)
check for crypto currency *‍/
Definition: parsers.cpp:322
bool isPreciousMetal(const string &code)
check for precious metal *‍/
Definition: parsers.cpp:320
Currency parseCurrency(const string &s)
Convert text to QuantLib::Currency.
Definition: parsers.cpp:290
SabrParametricVolatility::ModelVariant parseSabrParametricVolatilityModelVariant(const std::string &s)
Parse SabrParametricVolatility::ModelVariant.
Definition: parsers.cpp:1458
Position::Type parsePositionType(const std::string &s)
Convert text to QuantLib::Position::Type.
Definition: parsers.cpp:404
QuantLib::Pillar::Choice parsePillarChoice(const std::string &s)
Convert text to QuantLib::Pillar::Choice.
Definition: parsers.cpp:1403
CapFloor::Type parseCapFloorType(const string &s)
Definition: parsers.cpp:815
BusinessDayConvention parseBusinessDayConvention(const string &s)
Convert text to QuantLib::BusinessDayConvention.
Definition: parsers.cpp:173
QuantLib::CPI::InterpolationType parseObservationInterpolation(const std::string &s)
Convert string to observation interpolation.
Definition: parsers.cpp:682
AssetClass parseAssetClass(const std::string &s)
Convert text to ore::data::AssetClass.
Definition: parsers.cpp:710
Period parsePeriod(const string &s)
Convert text to QuantLib::Period.
Definition: parsers.cpp:171
Frequency parseFrequency(const string &s)
Convert text to QuantLib::Frequency.
Definition: parsers.cpp:348
string fxDominance(const string &s1, const string &s2)
Convert FX pair to market standard dominance.
Definition: parsers.cpp:1296
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
pair< Currency, Currency > parseCurrencyPair(const string &s, const string &delimiters)
Convert text to std::pair<QuantLib::Currency, QuantLib::Currency>
Definition: parsers.cpp:312
QuantLib::Bond::Price::Type parseBondPriceType(const string &s)
Convert text to QuantLib::Bond::Price::Type.
Definition: parsers.cpp:392
Compounding parseCompounding(const string &s)
Convert text to QuantLib::Compounding;.
Definition: parsers.cpp:376
SobolRsg::DirectionIntegers parseSobolRsgDirectionIntegers(const std::string &s)
Convert text to QuantLib::SobolRsg::DirectionIntegers.
Definition: parsers.cpp:579
QuantExt::BondIndex::PriceQuoteMethod parsePriceQuoteMethod(const std::string &s)
Definition: parsers.cpp:1261
Weekday parseWeekday(const string &s)
Definition: parsers.cpp:599
PaymentLag parsePaymentLag(const string &s)
Convert text to PaymentLag.
Definition: parsers.cpp:628
Real parseRealOrNull(const string &s)
Convert text to Real, empty string to Null<Real>()
Definition: parsers.cpp:120
Barrier::Type parseBarrierType(const std::string &s)
Convert std::string to QuantLib::BarrierType.
Definition: parsers.cpp:1042
bool isPseudoCurrency(const string &code)
check for pseudo currency = precious metal or crypto currency *‍/
Definition: parsers.cpp:318
MomentType parseMomentType(const std::string &s)
Convert text to ore::data::MomentType.
Definition: parsers.cpp:1361
DeltaVolQuote::AtmType parseAtmType(const std::string &s)
Convert text to QuantLib::DeltaVolQuote::AtmType.
Definition: parsers.cpp:746
Average::Type parseAverageType(const std::string &s)
Definition: parsers.cpp:1251
QuantExt::McMultiLegBaseEngine::RegressorModel parseRegressorModel(const std::string &s)
Convert text to QuantExt::McMultiLegBaseEngine::RegressorModel.
Definition: parsers.cpp:1418
Protection::Side parseProtectionSide(const std::string &s)
Convert text to QuantLib::Protection::Side.
Definition: parsers.cpp:420
Real parseReal(const string &s)
Convert text to Real.
Definition: parsers.cpp:112
SobolBrownianGenerator::Ordering parseSobolBrownianGeneratorOrdering(const std::string &s)
Convert text to QuantLib::SobolBrownianGenerator::Ordering.
Definition: parsers.cpp:567
QuantLib::Rounding::Type parseRoundingType(const std::string &s)
Convert text to QuantLib::Rounding.
Definition: parsers.cpp:1027
bool checkCurrency(const string &code)
check for vaid currency code, including minors and pseudo currencies
Definition: parsers.cpp:316
QuantExt::CrossAssetModel::AssetType parseCamAssetType(const string &s)
Definition: parsers.cpp:839
FdmSchemeDesc parseFdmSchemeDesc(const std::string &s)
Convert string to fdm scheme desc.
Definition: parsers.cpp:692
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
Definition: parsers.cpp:136
Settlement::Type parseSettlementType(const std::string &s)
Convert text to QuantLib::Settlement::Type.
Definition: parsers.cpp:434
DayCounter parseDayCounter(const string &s)
Convert text to QuantLib::DayCounter.
Definition: parsers.cpp:209
Option::Type parseOptionType(const std::string &s)
Convert text to QuantLib::Option::Type.
Definition: parsers.cpp:481
DeltaVolQuote::DeltaType parseDeltaType(const std::string &s)
Convert text to QuantLib::DeltaVolQuote::DeltaType.
Definition: parsers.cpp:763
Classes and functions for log message handling.
@ data
Definition: log.hpp:77
#define DLOG(text)
Logging Macro (Level = Debug)
Definition: log.hpp:554
#define TLOG(text)
Logging Macro (Level = Data)
Definition: log.hpp:556
CommodityQuantityFrequency
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
std::vector< std::string > getCorrelationTokens(const std::string &name)
Helper function to get the two tokens in a correlation name Index2:Index1.
Definition: parsers.cpp:1281
string normaliseFxIndex(const std::string &indexName)
Convert FX index name to market standard dominance.
Definition: parsers.cpp:1351
bool isOnePeriod(const string &s)
return true if s represents a period of the form [0-9][D|W|M|Y] (i.e. 1Y6M would return false)
Definition: parsers.cpp:159
ADCP parseAveragingDataPeriod(const string &s)
Convert text to CommodityFutureConvention::AveragingData::CalculationPeriod.
Definition: parsers.cpp:1136
std::vector< string > parseListOfValues(string s, const char escape, const char delim, const char quote)
Definition: parsers.cpp:639
CreditPortfolioSensitivityDecomposition parseCreditPortfolioSensitivityDecomposition(const std::string &s)
Convert text to CreditPortfolioSensitivitiyDecomposition.
Definition: parsers.cpp:1374
FutureConvention::DateGenerationRule parseFutureDateGenerationRule(const std::string &s)
Convert text to FutureConvention::DateGeneration.
Definition: parsers.cpp:991
MporCashFlowMode
Definition: parsers.hpp:588
@ Unspecified
Definition: parsers.hpp:588
bool tryParseCurrency(const std::string &str, Currency &obj)
Definition: parsers.hpp:438
Extrapolation
Enumeration for holding various extrapolation settings.
Definition: parsers.hpp:450
CommodityQuantityFrequency parseCommodityQuantityFrequency(const string &s)
Convert text to QuantExt::CommodityQuantityFrequency.
Definition: parsers.cpp:1192
std::vector< T > parseVectorOfValues(std::vector< std::string > str, std::function< T(string)> parser)
Definition: parsers.hpp:335
InflationSwapConvention::PublicationRoll parseInflationSwapPublicationRoll(const string &s)
Convert text to InflationSwapConvention::PublicationRoll.
Definition: parsers.cpp:1012
CreditPortfolioSensitivityDecomposition
Enumeration CreditPortfolioSensitivityDecomposition.
Definition: parsers.hpp:568
AmortizationType parseAmortizationType(const std::string &s)
Definition: parsers.cpp:651
boost::variant< QuantLib::Period, QuantLib::Natural > PaymentLag
Definition: types.hpp:32
QuantLib::RateAveraging::Type parseOvernightIndexFutureNettingType(const std::string &s)
Convert text to QuantLib::RateAveraging::Type.
Definition: parsers.cpp:970
Extrapolation parseExtrapolation(const string &s)
Parse Extrapolation from string.
Definition: parsers.cpp:778
PriceSegment::Type parsePriceSegmentType(const string &s)
Convert text to PriceSegment::Type.
Definition: parsers.cpp:1158
AmortizationType
Definition: parsers.hpp:346
Serializable Credit Default Swap.
Definition: namespaces.docs:23
string name
MarketObject obj
payment lag