Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
conventions.hpp
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
19/*! \file ored/configuration/conventions.hpp
20 \brief Currency and instrument specific conventions/defaults
21 \ingroup configuration
22*/
23
24#pragma once
25
28#include <ql/experimental/fx/deltavolquote.hpp>
29#include <ql/indexes/iborindex.hpp>
30#include <ql/indexes/inflationindex.hpp>
31#include <ql/indexes/swapindex.hpp>
32#include <ql/instruments/overnightindexfuture.hpp>
33#include <ql/instruments/bond.hpp>
34#include <ql/option.hpp>
35#include <qle/cashflows/subperiodscoupon.hpp> // SubPeriodsCouponType
38
39#include <boost/thread/shared_mutex.hpp>
40#include <boost/thread/lock_types.hpp>
41
42namespace ore {
43namespace data {
46using std::map;
47using std::string;
49using namespace QuantLib;
50
51//! Abstract base class for convention objects
52/*!
53 \ingroup configuration
54 */
56public:
57 //! Supported convention types
58 enum class Type {
59 Zero,
60 Deposit,
61 Future,
62 FRA,
63 OIS,
64 Swap,
69 FX,
72 CDS,
84 };
85
86 //! Default destructor
87 virtual ~Convention() {}
88
89 //! \name Inspectors
90 //@{
91 const string& id() const { return id_; }
92 Type type() const { return type_; }
93 //@}
94
95 //! \name convention interface definition
96 //@{
97 virtual void build() = 0;
98 //@}
99
100protected:
102 Convention(const string& id, Type type);
104 string id_;
105};
106
107std::ostream& operator<<(std::ostream& out, Convention::Type type);
108
109//! Repository for currency dependent market conventions
110/*!
111 \ingroup market
112*/
114public:
115 //! Default constructor
117
118 /*! Returns the convention if found and throws if not */
119 QuantLib::ext::shared_ptr<Convention> get(const string& id) const;
120
121 /*! Get a convention with the given \p id and \p type. If no convention of the given \p type with the given \p id
122 is found, the first element of the returned pair is \c false and the second element is a \c nullptr. If a
123 convention is found, the first element of the returned pair is \c true and the second element holds the
124 convention.
125 */
126 std::pair<bool, QuantLib::ext::shared_ptr<Convention>> get(const std::string& id, const Convention::Type& type) const;
127
128 /*! Get all conventions of a given type */
129 std::set<QuantLib::ext::shared_ptr<Convention>> get(const Convention::Type& type) const;
130
131 /*! Find a convention for an FX pair */
132 QuantLib::ext::shared_ptr<Convention> getFxConvention(const string& ccy1, const string& ccy2) const;
133
134 //! Checks if we have a convention with the given \p id
135 bool has(const std::string& id) const;
136
137 //! Checks if we have a convention with the given \p id and \p type
138 bool has(const std::string& id, const Convention::Type& type) const;
139
140 /*! Clear all conventions */
141 void clear() const;
142
143 /*! Add a convention. This will overwrite an existing convention
144 with the same id */
145 void add(const QuantLib::ext::shared_ptr<Convention>& convention) const;
146
147 //! \name Serialisation
148 //@{0
149 virtual void fromXML(XMLNode* node) override;
150 virtual XMLNode* toXML(XMLDocument& doc) const override;
151 //@}
152
153private:
154 mutable map<string, QuantLib::ext::shared_ptr<Convention>> data_;
155 mutable map<string, std::pair<string, string>> unparsed_;
156 mutable std::set<string> used_;
157 mutable boost::shared_mutex mutex_;
158};
159
160//! Singleton to hold conventions
161//
162class InstrumentConventions : public QuantLib::Singleton<InstrumentConventions, std::integral_constant<bool, true>> {
163 friend class QuantLib::Singleton<InstrumentConventions, std::integral_constant<bool, true>>;
164
165private:
166 InstrumentConventions() { conventions_[Date()] = QuantLib::ext::make_shared<ore::data::Conventions>(); }
167
168 mutable std::map<QuantLib::Date, QuantLib::ext::shared_ptr<ore::data::Conventions>> conventions_;
169 mutable boost::shared_mutex mutex_;
170 mutable std::size_t numberOfEmittedWarnings_ = 0;
171
172public:
173 const QuantLib::ext::shared_ptr<ore::data::Conventions>& conventions(QuantLib::Date d = QuantLib::Date()) const;
174 void setConventions(const QuantLib::ext::shared_ptr<ore::data::Conventions>& conventions,
175 QuantLib::Date d = QuantLib::Date());
176 void clear() { conventions_.clear(); }
177};
178
179//! Container for storing Zero Rate conventions
180/*!
181 \ingroup marketdata
182 */
184public:
185 //! \name Constructors
186 //@{
187 //! Default constructor
189 ZeroRateConvention(const string& id, const string& dayCounter, const string& compounding,
190 const string& compoundingFrequency);
191 ZeroRateConvention(const string& id, const string& dayCounter, const string& tenorCalendar,
192 const string& compounding = "Continuous", const string& compoundingFrequency = "Annual",
193 const string& spotLag = "", const string& spotCalendar = "", const string& rollConvention = "",
194 const string& eom = "");
195 //@}
196
197 //! \name Inspectors
198 //@{
199 //! Zero rate day counter
200 const DayCounter& dayCounter() const { return dayCounter_; }
201 //! Return the calendar used for converting tenor points into dates
202 const Calendar& tenorCalendar() const { return tenorCalendar_; }
203 //! Zero rate compounding
204 Compounding compounding() const { return compounding_; }
205 //! Zero rate compounding frequency
206 Frequency compoundingFrequency() const { return compoundingFrequency_; }
207 //! Zero rate spot lag
208 Natural spotLag() const { return spotLag_; }
209 //! Calendar used for spot date adjustment
210 const Calendar& spotCalendar() const { return spotCalendar_; }
211 //! Business day convention used in converting tenor points into dates
212 BusinessDayConvention rollConvention() const { return rollConvention_; }
213 //! End of month adjustment
214 bool eom() { return eom_; }
215 //! Flag to indicate whether the Zero Rate convention is based on a tenor input
216 bool tenorBased() { return tenorBased_; }
217 //@}
218
219 //! \name Serialisation
220 //@{
221 virtual void fromXML(XMLNode* node) override;
222 virtual XMLNode* toXML(XMLDocument& doc) const override;
223 virtual void build() override;
224 //@}
225
226private:
227 DayCounter dayCounter_;
229 Compounding compounding_;
231 Natural spotLag_;
233 BusinessDayConvention rollConvention_;
234 bool eom_;
236
237 // Strings to store the inputs
245 string strEom_;
246};
247
248//! Container for storing Deposit conventions
249/*!
250 \ingroup marketdata
251 */
253public:
254 //! \name Constructors
255 //@{
256 //! Default constructor
258 //! Index based constructor
259 DepositConvention(const string& id, const string& index);
260 //! Detailed constructor
261 DepositConvention(const string& id, const string& calendar, const string& convention, const string& eom,
262 const string& dayCounter, const string& settlementDays);
263 //@}
264
265 //! \name Inspectors
266 //@{
267 const string& index() const { return index_; }
268 const Calendar& calendar() const { return calendar_; }
269 BusinessDayConvention convention() const { return convention_; }
270 bool eom() { return eom_; }
271 const DayCounter& dayCounter() const { return dayCounter_; }
272 const Size settlementDays() const { return settlementDays_; }
273 bool indexBased() { return indexBased_; }
274 // @}
275
276 //! \name Serialisation
277 //@{
278 virtual void fromXML(XMLNode* node) override;
279 virtual XMLNode* toXML(XMLDocument& doc) const override;
280 virtual void build() override;
281 //@}
282
283private:
284 string index_;
285 Calendar calendar_;
286 BusinessDayConvention convention_;
287 bool eom_;
288 DayCounter dayCounter_;
291
292 // Strings to store the inputs
295 string strEom_;
298};
299
300//! Container for storing Money Market Futures conventions
301/*!
302 \ingroup marketdata
303 */
305public:
307 //! \name Constructors
308 //@{
309 //! Default constructor
311 //! Index based constructor
312 FutureConvention(const string& id, const string& index);
313 //! Index based constructor taking in addition a netting type for ON indices and a date generation rule
314 FutureConvention(const string& id, const string& index,
315 const QuantLib::RateAveraging::Type overnightIndexFutureNettingType,
316 const DateGenerationRule dateGeneration);
317 //@}
318 //! \name Inspectors
319 //@{
320 QuantLib::ext::shared_ptr<IborIndex> index() const;
321 QuantLib::RateAveraging::Type overnightIndexFutureNettingType() const { return overnightIndexFutureNettingType_; }
323 //@}
324
325 //! Serialisation
326 //@{
327 virtual void fromXML(XMLNode* node) override;
328 virtual XMLNode* toXML(XMLDocument& doc) const override;
329 virtual void build() override {}
330 //@}
331
332private:
333 string strIndex_;
334 QuantLib::RateAveraging::Type overnightIndexFutureNettingType_;
336};
337
338//! Container for storing Forward rate Agreement conventions
339/*!
340 \ingroup marketdata
341 */
342class FraConvention : public Convention {
343public:
344 //! \name Constructors
345 //@{
346 //! Default constructor
348 //! Index based constructor
349 FraConvention(const string& id, const string& index);
350 //@}
351
352 //! \name Inspectors
353 //@{
354 QuantLib::ext::shared_ptr<IborIndex> index() const;
355 const string& indexName() const { return strIndex_; }
356 //@}
357
358 //! \name Serialisation
359 //@{
360 virtual void fromXML(XMLNode* node) override;
361 virtual XMLNode* toXML(XMLDocument& doc) const override;
362 virtual void build() override {}
363 //@}
364
365private:
366 string strIndex_;
367};
368
369//! Container for storing Overnight Index Swap conventions
370/*!
371 \ingroup marketdata
372 */
373class OisConvention : public Convention {
374public:
375 //! \name Constructors
376 //@{
377 //! Default constructor
379 //! Detailed constructor
380 OisConvention(const string& id, const string& spotLag, const string& index, const string& fixedDayCounter,
381 const string& fixedCalendar, const string& paymentLag = "", const string& eom = "",
382 const string& fixedFrequency = "", const string& fixedConvention = "",
383 const string& fixedPaymentConvention = "", const string& rule = "",
384 const std::string& paymentCalendar = "");
385 //@}
386
387 //! \name Inspectors
388 //@{
389 Natural spotLag() const { return spotLag_; }
390 const string& indexName() const { return strIndex_; }
391 QuantLib::ext::shared_ptr<OvernightIndex> index() const;
392 const DayCounter& fixedDayCounter() const { return fixedDayCounter_; }
393 // might be empty to retain bwd compatibility
394 const Calendar& fixedCalendar() const { return fixedCalendar_; }
395 Natural paymentLag() const { return paymentLag_; }
396 bool eom() { return eom_; }
397 Frequency fixedFrequency() const { return fixedFrequency_; }
398 BusinessDayConvention fixedConvention() const { return fixedConvention_; }
399 BusinessDayConvention fixedPaymentConvention() const { return fixedPaymentConvention_; }
400 DateGeneration::Rule rule() const { return rule_; }
402 //@}
403
404 //! \name Serialisation
405 //@{
406 virtual void fromXML(XMLNode* node) override;
407 virtual XMLNode* toXML(XMLDocument& doc) const override;
408 virtual void build() override;
409 //@}
410
411private:
412 Natural spotLag_;
415 Natural paymentLag_;
416 bool eom_;
418 BusinessDayConvention fixedConvention_;
419 BusinessDayConvention fixedPaymentConvention_;
420 DateGeneration::Rule rule_;
422
423 // Strings to store the inputs
425 string strIndex_;
429 string strEom_;
433 string strRule_;
434 std::string strPaymentCal_;
435};
436
437//! Container for storing Ibor Index conventions
438/*!
439 \ingroup marketdata
440 */
442public:
444 IborIndexConvention(const string& id, const string& fixingCalendar, const string& dayCounter,
445 const Size settlementDays, const string& businessDayConvention, const bool endOfMonth);
446
447 const string& fixingCalendar() const { return strFixingCalendar_; }
448 const string& dayCounter() const { return strDayCounter_; }
449 const Size settlementDays() const { return settlementDays_; }
450 const string& businessDayConvention() const { return strBusinessDayConvention_; }
451 const bool endOfMonth() const { return endOfMonth_; }
452
453 virtual void fromXML(XMLNode* node) override;
454 virtual XMLNode* toXML(XMLDocument& doc) const override;
455 virtual void build() override;
456
457private:
458 string localId_;
464};
465
466//! Container for storing Overnight Index conventions
467/*!
468 \ingroup marketdata
469 */
471public:
473 OvernightIndexConvention(const string& id, const string& fixingCalendar, const string& dayCounter,
474 const Size settlementDays);
475
476 const string& fixingCalendar() const { return strFixingCalendar_; }
477 const string& dayCounter() const { return strDayCounter_; }
478 const Size settlementDays() const { return settlementDays_; }
479
480 virtual void fromXML(XMLNode* node) override;
481 virtual XMLNode* toXML(XMLDocument& doc) const override;
482 virtual void build() override;
483
484private:
488};
489
490//! Container for storing Swap Index conventions
491/*!
492 \ingroup marketdata
493 */
495public:
497 SwapIndexConvention(const string& id, const string& conventions, const string& fixingCalendar = "");
498
499 const string& conventions() const { return strConventions_; }
500 const string& fixingCalendar() const { return fixingCalendar_; }
501
502 virtual void fromXML(XMLNode* node) override;
503 virtual XMLNode* toXML(XMLDocument& doc) const override;
504 virtual void build() override {};
505
506private:
509};
510
511//! Container for storing Interest Rate Swap conventions
512/*!
513 \ingroup marketdata
514 */
516public:
517 //! \name Constructors
518 //@{
519 //! Default constructor
521 //! Detailed constructor
522 IRSwapConvention(const string& id, const string& fixedCalendar, const string& fixedFrequency,
523 const string& fixedConvention, const string& fixedDayCounter, const string& index,
524 bool hasSubPeriod = false, const string& floatFrequency = "",
525 const string& subPeriodsCouponType = "");
526 //@}
527
528 //! \name Inspectors
529 //@{
530 const Calendar& fixedCalendar() const { return fixedCalendar_; }
531 Frequency fixedFrequency() const { return fixedFrequency_; }
532 BusinessDayConvention fixedConvention() const { return fixedConvention_; }
533 const DayCounter& fixedDayCounter() const { return fixedDayCounter_; }
534 const string& indexName() const { return strIndex_; }
535 QuantLib::ext::shared_ptr<IborIndex> index() const;
536 // For sub period
537 bool hasSubPeriod() const { return hasSubPeriod_; }
538 Frequency floatFrequency() const { return floatFrequency_; } // returns NoFrequency for normal swaps
540 //@}
541
542 //! \name Serialisation
543 //@{
544 virtual void fromXML(XMLNode* node) override;
545 virtual XMLNode* toXML(XMLDocument& doc) const override;
546 virtual void build() override;
547 //@}
548
549private:
552 BusinessDayConvention fixedConvention_;
557
558 // Strings to store the inputs
563 string strIndex_;
566};
567
568//! Container for storing Average OIS conventions
569/*!
570 \ingroup marketdata
571 */
573public:
574 //! \name Constructors
575 //@{
576 //! Default constructor
578 //! Detailed constructor
579 AverageOisConvention(const string& id, const string& spotLag, const string& fixedTenor,
580 const string& fixedDayCounter, const string& fixedCalendar, const string& fixedConvention,
581 const string& fixedPaymentConvention, const string& fixedFrequency, const string& index,
582 const string& onTenor, const string& rateCutoff);
583 //@}
584
585 //! \name Inspectors
586 //@{
587 Natural spotLag() const { return spotLag_; }
588 const Period& fixedTenor() const { return fixedTenor_; }
589 const DayCounter& fixedDayCounter() const { return fixedDayCounter_; }
590 const Calendar& fixedCalendar() const { return fixedCalendar_; }
591 BusinessDayConvention fixedConvention() const { return fixedConvention_; }
592 BusinessDayConvention fixedPaymentConvention() const { return fixedPaymentConvention_; }
593 Frequency fixedFrequency() const { return fixedFrequency_; }
594 const string& indexName() const { return strIndex_; }
595 QuantLib::ext::shared_ptr<OvernightIndex> index() const;
596 const Period& onTenor() const { return onTenor_; }
597 Natural rateCutoff() const { return rateCutoff_; }
598 //@}
599
600 //! \name Serialisation
601 //@{
602 virtual void fromXML(XMLNode* node) override;
603 virtual XMLNode* toXML(XMLDocument& doc) const override;
604 virtual void build() override;
605 //@}
606private:
607 Natural spotLag_;
611 BusinessDayConvention fixedConvention_;
612 BusinessDayConvention fixedPaymentConvention_;
614 Period onTenor_;
615 Natural rateCutoff_;
616
617 // Strings to store the inputs
625 string strIndex_;
628};
629
630//! Container for storing Tenor Basis Swap conventions
631/*!
632 \ingroup marketdata
633 */
635public:
636 //! \name Constructors
637 //@{
638 //! Default constructor
640 //! Detailed constructor
641 TenorBasisSwapConvention(const string& id, const string& payIndex, const string& receiveIndex,
642 const string& receiveFrequency = "", const string& payFrequency = "",
643 const string& spreadOnRec = "", const string& includeSpread = "",
644 const string& subPeriodsCouponType = "");
645 //@}
646
647 //! \name Inspectors
648 //@{
649 QuantLib::ext::shared_ptr<IborIndex> payIndex() const;
650 QuantLib::ext::shared_ptr<IborIndex> receiveIndex() const;
651 const string& payIndexName() const { return strPayIndex_; }
652 const string& receiveIndexName() const { return strReceiveIndex_; }
653 const Period& receiveFrequency() const { return receiveFrequency_; }
654 const Period& payFrequency() const { return payFrequency_; }
655 bool spreadOnRec() const { return spreadOnRec_; }
656 bool includeSpread() const { return includeSpread_; }
658 //@}
659
660 //! \name Serialisation
661 //@{
662 virtual void fromXML(XMLNode* node) override;
663 virtual XMLNode* toXML(XMLDocument& doc) const override;
664 virtual void build() override;
665 //@}
666
667private:
673
674 // Strings to store the inputs
682};
683
684//! Container for storing conventions for Tenor Basis Swaps quoted as a spread of two interest rate swaps
685/*!
686 \ingroup marketdata
687 */
689public:
690 //! \name Constructors
691 //@{
692 //! Default constructor
694 //! Detailed constructor
695 TenorBasisTwoSwapConvention(const string& id, const string& calendar, const string& longFixedFrequency,
696 const string& longFixedConvention, const string& longFixedDayCounter,
697 const string& longIndex, const string& shortFixedFrequency,
698 const string& shortFixedConvention, const string& shortFixedDayCounter,
699 const string& shortIndex, const string& longMinusShort = "");
700 //@}
701
702 //! \name Inspectors
703 //@{
704 const Calendar& calendar() const { return calendar_; }
705 Frequency longFixedFrequency() const { return longFixedFrequency_; }
706 BusinessDayConvention longFixedConvention() const { return longFixedConvention_; }
707 const DayCounter& longFixedDayCounter() const { return longFixedDayCounter_; }
708 QuantLib::ext::shared_ptr<IborIndex> longIndex() const;
709 Frequency shortFixedFrequency() const { return shortFixedFrequency_; }
710 BusinessDayConvention shortFixedConvention() const { return shortFixedConvention_; }
711 const DayCounter& shortFixedDayCounter() const { return shortFixedDayCounter_; }
712 QuantLib::ext::shared_ptr<IborIndex> shortIndex() const;
713 bool longMinusShort() const { return longMinusShort_; }
714 //@}
715
716 //! \name Serialisation
717 //@{
718 virtual void fromXML(XMLNode* node) override;
719 virtual XMLNode* toXML(XMLDocument& doc) const override;
720 virtual void build() override;
721 //@}
722
723private:
724 Calendar calendar_;
726 BusinessDayConvention longFixedConvention_;
729 BusinessDayConvention shortFixedConvention_;
732
733 // Strings to store the inputs
744};
745
746//! Container for storing Libor-BMA Basis Swap conventions
747/*!
748\ingroup marketdata
749*/
751public:
752 //! \name Constructors
753 //@{
754 //! Default constructor
756 //! Detailed constructor
757 BMABasisSwapConvention(const string& id, const string& liborIndex, const string& bmaIndex);
758 //@}
759
760 //! \name Inspectors
761 //@{
762 QuantLib::ext::shared_ptr<IborIndex> liborIndex() const;
763 QuantLib::ext::shared_ptr<QuantExt::BMAIndexWrapper> bmaIndex() const;
764 const string& liborIndexName() const { return strLiborIndex_; }
765 const string& bmaIndexName() const { return strBmaIndex_; }
766 //@}
767
768 //! \name Serialisation
769 //@{
770 virtual void fromXML(XMLNode* node) override;
771 virtual XMLNode* toXML(XMLDocument& doc) const override;
772 virtual void build() override;
773 //@}
774
775private:
776 // Strings to store the inputs
779};
780
781//! Container for storing FX Spot quote conventions
782/*!
783 \ingroup marketdata
784 */
785class FXConvention : public Convention {
786public:
787 //! \name Constructors
788 //@{
789 //! Default constructor
791 //! Detailed constructor
792 FXConvention(const string& id, const string& spotDays, const string& sourceCurrency, const string& targetCurrency,
793 const string& pointsFactor, const string& advanceCalendar = "", const string& spotRelative = "",
794 const string& endOfMonth = "", const string& convention = "");
795 //@}
796
797 //! \name Inspectors
798 //@{
799 Natural spotDays() const { return spotDays_; }
800 const Currency& sourceCurrency() const { return sourceCurrency_; }
801 const Currency& targetCurrency() const { return targetCurrency_; }
802 Real pointsFactor() const { return pointsFactor_; }
803 const Calendar& advanceCalendar() const { return advanceCalendar_; }
804 bool spotRelative() const { return spotRelative_; }
805 bool endOfMonth() const { return endOfMonth_; }
806 BusinessDayConvention convention() const { return convention_; }
807 //@}
808
809 //! \name Serialisation
810 //
811 virtual void fromXML(XMLNode* node) override;
812 virtual XMLNode* toXML(XMLDocument& doc) const override;
813 virtual void build() override;
814 //@}
815
816private:
817 Natural spotDays_;
824 BusinessDayConvention convention_;
825
826 // Strings to store the inputs
835};
836
837//! Container for storing Cross Currency Basis Swap quote conventions
838/*!
839 \ingroup marketdata
840 */
842public:
843 //! \name Constructors
844 //@{
845 //! Default constructor
847 //! Detailed constructor
848 CrossCcyBasisSwapConvention(const string& id, const string& strSettlementDays, const string& strSettlementCalendar,
849 const string& strRollConvention, const string& flatIndex, const string& spreadIndex,
850 const string& strEom = "", const string& strIsResettable = "",
851 const string& strFlatIndexIsResettable = "", const std::string& strFlatTenor = "",
852 const std::string& strSpreadTenor = "", const string& strPaymentLag = "",
853 const string& strFlatPaymentLag = "", const string& strIncludeSpread = "",
854 const string& strLookback = "", const string& strFixingDays = "",
855 const string& strRateCutoff = "", const string& strIsAveraged = "",
856 const string& strFlatIncludeSpread = "", const string& strFlatLookback = "",
857 const string& strFlatFixingDays = "", const string& strFlatRateCutoff = "",
858 const string& strFlatIsAveraged = "", const Conventions* conventions = nullptr);
859 //@}
860
861 //! \name Inspectors
862 //@{
863 Natural settlementDays() const { return settlementDays_; }
864 const Calendar& settlementCalendar() const { return settlementCalendar_; }
865 BusinessDayConvention rollConvention() const { return rollConvention_; }
866 QuantLib::ext::shared_ptr<IborIndex> flatIndex() const;
867 QuantLib::ext::shared_ptr<IborIndex> spreadIndex() const;
868 const string& flatIndexName() const { return strFlatIndex_; }
869 const string& spreadIndexName() const { return strSpreadIndex_; }
870
871 bool eom() const { return eom_; }
872 bool isResettable() const { return isResettable_; }
874 const QuantLib::Period& flatTenor() const { return flatTenor_; }
875 const QuantLib::Period& spreadTenor() const { return spreadTenor_; }
876
877 Size paymentLag() const { return paymentLag_; }
878 Size flatPaymentLag() const { return flatPaymentLag_; }
879
880 // only OIS
881 boost::optional<bool> includeSpread() const { return includeSpread_; }
882 boost::optional<QuantLib::Period> lookback() const { return lookback_; }
883 boost::optional<QuantLib::Size> fixingDays() const { return fixingDays_; }
884 boost::optional<Size> rateCutoff() const { return rateCutoff_; }
885 boost::optional<bool> isAveraged() const { return isAveraged_; }
886 boost::optional<bool> flatIncludeSpread() const { return flatIncludeSpread_; }
887 boost::optional<QuantLib::Period> flatLookback() const { return flatLookback_; }
888 boost::optional<QuantLib::Size> flatFixingDays() const { return flatFixingDays_; }
889 boost::optional<Size> flatRateCutoff() const { return flatRateCutoff_; }
890 boost::optional<bool> flatIsAveraged() const { return flatIsAveraged_; }
891 //@}
892
893 //! \name Serialisation
894 //@{
895 virtual void fromXML(XMLNode* node) override;
896 virtual XMLNode* toXML(XMLDocument& doc) const override;
897 virtual void build() override;
898 //@}
899private:
902 BusinessDayConvention rollConvention_;
903 bool eom_;
906 QuantLib::Period flatTenor_;
907 QuantLib::Period spreadTenor_;
908 QuantLib::Size paymentLag_;
909 QuantLib::Size flatPaymentLag_;
910 // OIS only
911 boost::optional<bool> includeSpread_;
912 boost::optional<QuantLib::Period> lookback_;
913 boost::optional<QuantLib::Size> fixingDays_;
914 boost::optional<Size> rateCutoff_;
915 boost::optional<bool> isAveraged_;
916 boost::optional<bool> flatIncludeSpread_;
917 boost::optional<QuantLib::Period> flatLookback_;
918 boost::optional<QuantLib::Size> flatFixingDays_;
919 boost::optional<Size> flatRateCutoff_;
920 boost::optional<bool> flatIsAveraged_;
921
922 // Strings to store the inputs
928 string strEom_;
935 // OIS only
946};
947
948/*! Container for storing Cross Currency Fix vs Float Swap quote conventions
949 \ingroup marketdata
950 */
952public:
953 //! \name Constructors
954 //@{
955 //! Default constructor
957 //! Detailed constructor
958 CrossCcyFixFloatSwapConvention(const std::string& id, const std::string& settlementDays,
959 const std::string& settlementCalendar, const std::string& settlementConvention,
960 const std::string& fixedCurrency, const std::string& fixedFrequency,
961 const std::string& fixedConvention, const std::string& fixedDayCounter,
962 const std::string& index, const std::string& eom = "",
963 const std::string& strIsResettable = "",
964 const std::string& strFloatIndexIsResettable = "");
965 //@}
966
967 //! \name Inspectors
968 //@{
969 QuantLib::Natural settlementDays() const { return settlementDays_; }
971 QuantLib::BusinessDayConvention settlementConvention() const { return settlementConvention_; }
972 const QuantLib::Currency& fixedCurrency() const { return fixedCurrency_; }
973 QuantLib::Frequency fixedFrequency() const { return fixedFrequency_; }
974 QuantLib::BusinessDayConvention fixedConvention() const { return fixedConvention_; }
975 const QuantLib::DayCounter& fixedDayCounter() const { return fixedDayCounter_; }
976 QuantLib::ext::shared_ptr<QuantLib::IborIndex> index() const;
977 bool eom() const { return eom_; }
978 bool isResettable() const { return isResettable_; }
980 //@}
981
982 //! \name Serialisation interface
983 //@{
984 void fromXML(XMLNode* node) override;
985 XMLNode* toXML(XMLDocument& doc) const override;
986 //@}
987
988 //! \name Convention interface
989 //@{
990 void build() override;
991 //@}
992
993private:
994 QuantLib::Natural settlementDays_;
996 QuantLib::BusinessDayConvention settlementConvention_;
997 QuantLib::Currency fixedCurrency_;
998 QuantLib::Frequency fixedFrequency_;
999 QuantLib::BusinessDayConvention fixedConvention_;
1000 QuantLib::DayCounter fixedDayCounter_;
1001 bool eom_;
1004
1005 // Strings to store the inputs
1013 std::string strIndex_;
1014 std::string strEom_;
1015
1016 std::string strIsResettable_;
1018};
1019
1020//! Container for storing Credit Default Swap quote conventions
1021/*!
1022 \ingroup marketdata
1023 */
1025public:
1026 //! \name Constructors
1027 //@{
1028 //! Default constructor
1029 CdsConvention();
1030
1031 //! Detailed constructor
1032 CdsConvention(const string& id, const string& strSettlementDays, const string& strCalendar,
1033 const string& strFrequency, const string& strPaymentConvention, const string& strRule,
1034 const string& dayCounter, const string& settlesAccrual, const string& paysAtDefaultTime,
1035 const string& strUpfrontSettlementDays = "", const string& lastPeriodDayCounter = "");
1036 //@}
1037
1038 //! \name Inspectors
1039 //@{
1040 Natural settlementDays() const { return settlementDays_; }
1041 const Calendar& calendar() const { return calendar_; }
1042 Frequency frequency() const { return frequency_; }
1043 BusinessDayConvention paymentConvention() const { return paymentConvention_; }
1044 DateGeneration::Rule rule() const { return rule_; }
1045 const DayCounter& dayCounter() const { return dayCounter_; }
1046 bool settlesAccrual() const { return settlesAccrual_; }
1047 bool paysAtDefaultTime() const { return paysAtDefaultTime_; }
1049 const DayCounter& lastPeriodDayCounter() const { return lastPeriodDayCounter_; }
1050 //@}
1051
1052 //! \name Serialisation
1053 //@{
1054 virtual void fromXML(XMLNode* node0) override;
1055 virtual XMLNode* toXML(XMLDocument& doc) const override;
1056 virtual void build() override;
1057 //@}
1058private:
1060 Calendar calendar_;
1061 Frequency frequency_;
1062 BusinessDayConvention paymentConvention_;
1063 DateGeneration::Rule rule_;
1064 DayCounter dayCounter_;
1069
1070 // Strings to store the inputs
1075 string strRule_;
1081};
1082
1084public:
1085 //! Rule for determining when inflation swaps roll to observing latest inflation index release.
1086 enum class PublicationRoll {
1087 None,
1090 };
1091
1093
1094 InflationSwapConvention(const string& id, const string& strFixCalendar, const string& strFixConvention,
1095 const string& strDayCounter, const string& strIndex, const string& strInterpolated,
1096 const string& strObservationLag, const string& strAdjustInfObsDates,
1097 const string& strInfCalendar, const string& strInfConvention,
1099 const QuantLib::ext::shared_ptr<ScheduleData>& publicationScheduleData = nullptr);
1100
1101 const Calendar& fixCalendar() const { return fixCalendar_; }
1102 BusinessDayConvention fixConvention() const { return fixConvention_; }
1103 const DayCounter& dayCounter() const { return dayCounter_; }
1104 QuantLib::ext::shared_ptr<ZeroInflationIndex> index() const;
1105 const string& indexName() const { return strIndex_; }
1106 bool interpolated() const { return interpolated_; }
1107 Period observationLag() const { return observationLag_; }
1108 bool adjustInfObsDates() const { return adjustInfObsDates_; }
1109 const Calendar& infCalendar() const { return infCalendar_; }
1110 BusinessDayConvention infConvention() const { return infConvention_; }
1112 const Schedule& publicationSchedule() const { return publicationSchedule_; }
1113
1114 virtual void fromXML(XMLNode* node) override;
1115 virtual XMLNode* toXML(XMLDocument& doc) const override;
1116 virtual void build() override;
1117
1118private:
1120 BusinessDayConvention fixConvention_;
1121 DayCounter dayCounter_;
1122 QuantLib::ext::shared_ptr<ZeroInflationIndex> index_;
1127 BusinessDayConvention infConvention_;
1129
1130 // Store the inputs
1141 QuantLib::ext::shared_ptr<ScheduleData> publicationScheduleData_;
1142};
1143
1144//! Container for storing Bond Spread Rate conventions
1145/*!
1146\ingroup marketdata
1147*/
1149public:
1150 //! \name Constructors
1151 //@{
1152 //! Default constructor
1154 SecuritySpreadConvention(const string& id, const string& dayCounter, const string& compounding,
1155 const string& compoundingFrequency);
1156 SecuritySpreadConvention(const string& id, const string& dayCounter, const string& tenorCalendar,
1157 const string& compounding = "Continuous", const string& compoundingFrequency = "Annual",
1158 const string& spotLag = "", const string& spotCalendar = "",
1159 const string& rollConvention = "", const string& eom = "");
1160 //@}
1161
1162 //! \name Inspectors
1163 //@{
1164 //! Zero rate day counter
1165 const DayCounter& dayCounter() const { return dayCounter_; }
1166 //! Return the calendar used for converting tenor points into dates
1167 const Calendar& tenorCalendar() const { return tenorCalendar_; }
1168 //! Zero rate compounding
1169 Compounding compounding() const { return compounding_; }
1170 //! Zero rate compounding frequency
1171 Frequency compoundingFrequency() const { return compoundingFrequency_; }
1172 //! Zero rate spot lag
1173 Natural spotLag() const { return spotLag_; }
1174 //! Calendar used for spot date adjustment
1175 const Calendar& spotCalendar() const { return spotCalendar_; }
1176 //! Business day convention used in converting tenor points into dates
1177 BusinessDayConvention rollConvention() const { return rollConvention_; }
1178 //! End of month adjustment
1179 bool eom() { return eom_; }
1180 //! Flag to indicate whether the Zero Rate convention is based on a tenor input
1181 bool tenorBased() { return tenorBased_; }
1182 //@}
1183
1184 //! \name Serialisation
1185 //@{
1186 virtual void fromXML(XMLNode* node) override;
1187 virtual XMLNode* toXML(XMLDocument& doc) const override;
1188 virtual void build() override;
1189 //@}
1190
1191private:
1192 DayCounter dayCounter_;
1194 Compounding compounding_;
1196 Natural spotLag_;
1198 BusinessDayConvention rollConvention_;
1199 bool eom_;
1201
1202 // Strings to store the inputs
1210 string strEom_;
1211};
1212
1213//! Container for storing CMS Spread Option conventions
1214/*!
1215 \ingroup marketdata
1216 */
1218public:
1219 //! \name Constructors
1220 //@{
1221 //! Default constructor
1223 //! Detailed constructor
1224 CmsSpreadOptionConvention(const string& id, const string& strForwardStart, const string& strSpotDays,
1225 const string& strSwapTenor, const string& strFixingDays, const string& strCalendar,
1226 const string& strDayCounter, const string& strConvention);
1227 //@}
1228
1229 //! \name Inspectors
1230 //@{
1231 const Period& forwardStart() const { return forwardStart_; }
1232 const Period spotDays() const { return spotDays_; }
1233 const Period& swapTenor() { return swapTenor_; }
1234 Natural fixingDays() const { return fixingDays_; }
1235 const Calendar& calendar() const { return calendar_; }
1236 const DayCounter& dayCounter() const { return dayCounter_; }
1237 BusinessDayConvention rollConvention() const { return rollConvention_; }
1238 //@}
1239
1240 //! \name Serialisation
1241 //@{
1242 virtual void fromXML(XMLNode* node) override;
1243 virtual XMLNode* toXML(XMLDocument& doc) const override;
1244 virtual void build() override;
1245 //@}
1246private:
1251 Calendar calendar_;
1252 DayCounter dayCounter_;
1253 BusinessDayConvention rollConvention_;
1254
1255 // Strings to store the inputs
1263};
1264
1265/*! Container for storing Commodity forward quote conventions
1266 \ingroup marketdata
1267 */
1269public:
1270 //! \name Constructors
1271 //@{
1272 //! Default constructor
1274
1275 //! Detailed constructor
1276 CommodityForwardConvention(const string& id, const string& spotDays = "", const string& pointsFactor = "",
1277 const string& advanceCalendar = "", const string& spotRelative = "",
1278 BusinessDayConvention bdc = Following, bool outright = true);
1279 //@}
1280
1281 //! \name Inspectors
1282 //@{
1283 Natural spotDays() const { return spotDays_; }
1284 Real pointsFactor() const { return pointsFactor_; }
1285 const Calendar& advanceCalendar() const { return advanceCalendar_; }
1286 string strAdvanceCalendar() const { return strAdvanceCalendar_; }
1287 bool spotRelative() const { return spotRelative_; }
1288 BusinessDayConvention bdc() const { return bdc_; }
1289 bool outright() const { return outright_; }
1290 //@}
1291
1292 //! \name Serialisation
1293 //
1294 virtual void fromXML(XMLNode* node) override;
1295 virtual XMLNode* toXML(XMLDocument& doc) const override;
1296 virtual void build() override;
1297 //@}
1298
1299private:
1300 Natural spotDays_;
1304 BusinessDayConvention bdc_;
1306
1307 // Strings to store the inputs
1312};
1313
1314/*! Container for storing commodity future conventions
1315 \ingroup marketdata
1316 */
1318public:
1319 /*! The anchor day type of commodity future convention
1320 */
1323
1324 //! Classes to differentiate constructors below
1325 //@{
1326 struct DayOfMonth {
1328 std::string dayOfMonth_;
1329 };
1330
1334 };
1335
1339 };
1340
1342 WeeklyWeekday(const std::string& weekday) : weekday_(weekday) {}
1343 std::string weekday_;
1344 };
1345
1346
1352 weekday_("") {}
1355 expiryDay_(""), nth_(""), weekday_("") {}
1356 OptionExpiryAnchorDateRule(const std::string& nth, const std::string& weekday)
1358 OptionExpiryAnchorDateRule(const std::string& lastWeekday)
1363
1365 std::string daysBefore_;
1366 std::string expiryDay_;
1367 std::string nth_;
1368 std::string weekday_;
1369 };
1370 //@}
1371
1372 /*! Class to hold averaging information when \c isAveraging_ is \c true. It is generally needed
1373 in the CommodityFutureConvention when referenced in piecewise price curve construction.
1374 */
1376 public:
1377 //! Indicate location of calculation period relative to the future expiry date.
1379
1380 //! \name Constructors
1381 //@{
1382 //! Default constructor
1383 AveragingData();
1384 //! Detailed constructor
1385 AveragingData(const std::string& commodityName, const std::string& period, const std::string& pricingCalendar,
1386 bool useBusinessDays, const std::string& conventionsId = "", QuantLib::Natural deliveryRollDays = 0,
1387 QuantLib::Natural futureMonthOffset = 0, QuantLib::Natural dailyExpiryOffset =
1388 QuantLib::Null<QuantLib::Natural>());
1389 //@}
1390
1391 //! \name Inspectors
1392 //@{
1393 const std::string& commodityName() const;
1394 CalculationPeriod period() const;
1395 const QuantLib::Calendar& pricingCalendar() const;
1396 bool useBusinessDays() const;
1397 const std::string& conventionsId() const;
1398 QuantLib::Natural deliveryRollDays() const;
1399 QuantLib::Natural futureMonthOffset() const;
1400 QuantLib::Natural dailyExpiryOffset() const;
1401 //@}
1402
1403 //! Returns \c true if the data has not been populated.
1404 bool empty() const;
1405
1406 //! Serialisation
1407 //@{
1408 void fromXML(XMLNode* node) override;
1409 XMLNode* toXML(XMLDocument& doc) const override;
1410 //@}
1411
1412 private:
1413 std::string commodityName_;
1414 std::string strPeriod_;
1417 std::string conventionsId_;
1418 QuantLib::Natural deliveryRollDays_;
1419 QuantLib::Natural futureMonthOffset_;
1420 QuantLib::Natural dailyExpiryOffset_;
1421
1424
1425 //! Populate members
1426 void build();
1427 };
1428
1429 //! Class to store conventions for creating an off peak power index
1431 public:
1432 //! Constructor.
1434
1435 //! Detailed constructor.
1437 const std::string& offPeakIndex,
1438 const std::string& peakIndex,
1439 const std::string& offPeakHours,
1440 const std::string& peakCalendar);
1441
1442 const std::string& offPeakIndex() const { return offPeakIndex_; }
1443 const std::string& peakIndex() const { return peakIndex_; }
1444 QuantLib::Real offPeakHours() const { return offPeakHours_; }
1446
1447 void fromXML(XMLNode* node) override;
1448 XMLNode* toXML(XMLDocument& doc) const override;
1449 void build();
1450
1451 private:
1452 std::string offPeakIndex_;
1453 std::string peakIndex_;
1454 std::string strOffPeakHours_;
1455 std::string strPeakCalendar_;
1456
1457 QuantLib::Real offPeakHours_;
1459 };
1460
1461 //! Class to hold prohibited expiry information.
1463 public:
1465
1467 const QuantLib::Date& expiry,
1468 bool forFuture = true,
1469 QuantLib::BusinessDayConvention futureBdc = QuantLib::Preceding,
1470 bool forOption = true,
1471 QuantLib::BusinessDayConvention optionBdc = QuantLib::Preceding);
1472
1473 const QuantLib::Date& expiry() const { return expiry_; }
1474 bool forFuture() const { return forFuture_; }
1475 QuantLib::BusinessDayConvention futureBdc() const { return futureBdc_; }
1476 bool forOption() const { return forOption_; }
1477 QuantLib::BusinessDayConvention optionBdc() const { return optionBdc_; }
1478
1479 void fromXML(XMLNode* node) override;
1480 XMLNode* toXML(XMLDocument& doc) const override;
1481
1482 private:
1483 QuantLib::Date expiry_;
1485 QuantLib::BusinessDayConvention futureBdc_;
1487 QuantLib::BusinessDayConvention optionBdc_;
1488 };
1489
1490 //! \name Constructors
1491 //@{
1492 //! Default constructor
1494
1495 //! Day of month based constructor
1496 CommodityFutureConvention(const std::string& id, const DayOfMonth& dayOfMonth, const std::string& contractFrequency,
1497 const std::string& calendar, const std::string& expiryCalendar = "",
1498 QuantLib::Size expiryMonthLag = 0, const std::string& oneContractMonth = "",
1499 const std::string& offsetDays = "", const std::string& bdc = "",
1500 bool adjustBeforeOffset = true, bool isAveraging = false,
1501 const OptionExpiryAnchorDateRule& optionExpiryDateRule = OptionExpiryAnchorDateRule(),
1502 const std::set<ProhibitedExpiry>& prohibitedExpiries = {},
1503 QuantLib::Size optionExpiryMonthLag = 0,
1504 const std::string& optionBdc = "",
1505 const std::map<QuantLib::Natural, QuantLib::Natural>& futureContinuationMappings = {},
1506 const std::map<QuantLib::Natural, QuantLib::Natural>& optionContinuationMappings = {},
1507 const AveragingData& averagingData = AveragingData(),
1508 QuantLib::Natural hoursPerDay = QuantLib::Null<QuantLib::Natural>(),
1509 const boost::optional<OffPeakPowerIndexData>& offPeakPowerIndexData = boost::none,
1510 const std::string& indexName = "", const std::string& optionFrequency = "");
1511
1512 //! N-th weekday based constructor
1513 CommodityFutureConvention(const std::string& id, const std::string& nth, const std::string& weekday,
1514 const std::string& contractFrequency, const std::string& calendar,
1515 const std::string& expiryCalendar = "", QuantLib::Size expiryMonthLag = 0,
1516 const std::string& oneContractMonth = "", const std::string& offsetDays = "",
1517 const std::string& bdc = "", bool adjustBeforeOffset = true, bool isAveraging = false,
1518 const OptionExpiryAnchorDateRule& optionExpiryDateRule = OptionExpiryAnchorDateRule(),
1519 const std::set<ProhibitedExpiry>& prohibitedExpiries = {},
1520 QuantLib::Size optionExpiryMonthLag = 0,
1521 const std::string& optionBdc = "",
1522 const std::map<QuantLib::Natural, QuantLib::Natural>& futureContinuationMappings = {},
1523 const std::map<QuantLib::Natural, QuantLib::Natural>& optionContinuationMappings = {},
1524 const AveragingData& averagingData = AveragingData(),
1525 QuantLib::Natural hoursPerDay = QuantLib::Null<QuantLib::Natural>(),
1526 const boost::optional<OffPeakPowerIndexData>& offPeakPowerIndexData = boost::none,
1527 const std::string& indexName = "", const std::string& optionFrequency = "");
1528
1529 //! Calendar days before based constructor
1531 const std::string& contractFrequency, const std::string& calendar,
1532 const std::string& expiryCalendar = "", QuantLib::Size expiryMonthLag = 0,
1533 const std::string& oneContractMonth = "", const std::string& offsetDays = "",
1534 const std::string& bdc = "", bool adjustBeforeOffset = true, bool isAveraging = false,
1535 const OptionExpiryAnchorDateRule& optionExpiryDateRule = OptionExpiryAnchorDateRule(),
1536 const std::set<ProhibitedExpiry>& prohibitedExpiries = {},
1537 QuantLib::Size optionExpiryMonthLag = 0,
1538 const std::string& optionBdc = "",
1539 const std::map<QuantLib::Natural, QuantLib::Natural>& futureContinuationMappings = {},
1540 const std::map<QuantLib::Natural, QuantLib::Natural>& optionContinuationMappings = {},
1541 const AveragingData& averagingData = AveragingData(),
1542 QuantLib::Natural hoursPerDay = QuantLib::Null<QuantLib::Natural>(),
1543 const boost::optional<OffPeakPowerIndexData>& offPeakPowerIndexData = boost::none,
1544 const std::string& indexName = "", const std::string& optionFrequency = "");
1545
1546 //! Business days before based constructor
1548 const std::string& contractFrequency, const std::string& calendar,
1549 const std::string& expiryCalendar = "", QuantLib::Size expiryMonthLag = 0,
1550 const std::string& oneContractMonth = "", const std::string& offsetDays = "",
1551 const std::string& bdc = "", bool adjustBeforeOffset = true, bool isAveraging = false,
1552 const OptionExpiryAnchorDateRule& optionExpiryDateRule = OptionExpiryAnchorDateRule(),
1553 const std::set<ProhibitedExpiry>& prohibitedExpiries = {},
1554 QuantLib::Size optionExpiryMonthLag = 0,
1555 const std::string& optionBdc = "",
1556 const std::map<QuantLib::Natural, QuantLib::Natural>& futureContinuationMappings = {},
1557 const std::map<QuantLib::Natural, QuantLib::Natural>& optionContinuationMappings = {},
1558 const AveragingData& averagingData = AveragingData(),
1559 QuantLib::Natural hoursPerDay = QuantLib::Null<QuantLib::Natural>(),
1560 const boost::optional<OffPeakPowerIndexData>& offPeakPowerIndexData = boost::none,
1561 const std::string& indexName = "", const std::string& optionFrequency = "");
1562
1563 //! \name Inspectors
1564 //@{
1566 QuantLib::Natural dayOfMonth() const { return dayOfMonth_; }
1567 QuantLib::Natural nth() const { return nth_; }
1568 QuantLib::Weekday weekday() const { return weekday_; }
1569 QuantLib::Natural calendarDaysBefore() const { return calendarDaysBefore_; }
1570 QuantLib::Integer businessDaysAfter() const { return businessDaysAfter_; }
1571 QuantLib::Frequency contractFrequency() const { return contractFrequency_; }
1572 const QuantLib::Calendar& calendar() const { return calendar_; }
1574 QuantLib::Size expiryMonthLag() const { return expiryMonthLag_; }
1575 QuantLib::Month oneContractMonth() const { return oneContractMonth_; }
1576 QuantLib::Integer offsetDays() const { return offsetDays_; }
1577 QuantLib::BusinessDayConvention businessDayConvention() const { return bdc_; }
1579 bool isAveraging() const { return isAveraging_; }
1580 QuantLib::Natural optionExpiryOffset() const { return optionExpiryOffset_; }
1581 const std::set<ProhibitedExpiry>& prohibitedExpiries() const {
1582 return prohibitedExpiries_;
1583 }
1584 QuantLib::Size optionExpiryMonthLag() const { return optionExpiryMonthLag_; }
1585 QuantLib::Natural optionExpiryDay() const { return optionExpiryDay_; }
1586 QuantLib::BusinessDayConvention optionBusinessDayConvention() const { return optionBdc_; }
1587 const std::map<QuantLib::Natural, QuantLib::Natural>& futureContinuationMappings() const {
1589 }
1590 const std::map<QuantLib::Natural, QuantLib::Natural>& optionContinuationMappings() const {
1592 }
1593 const AveragingData& averagingData() const { return averagingData_; }
1594 QuantLib::Natural hoursPerDay() const { return hoursPerDay_; }
1595 const boost::optional<OffPeakPowerIndexData>& offPeakPowerIndexData() const { return offPeakPowerIndexData_; }
1596 const std::string& indexName() const { return indexName_; }
1597 QuantLib::Frequency optionContractFrequency() const { return optionContractFrequency_; }
1599 QuantLib::Natural optionNth() const { return optionNth_; }
1600 QuantLib::Weekday optionWeekday() const { return optionWeekday_; }
1601 const std::string& savingsTime() const { return savingsTime_; }
1602 const std::set<QuantLib::Month>& validContractMonths() const { return validContractMonths_; }
1603 bool balanceOfTheMonth() const { return balanceOfTheMonth_; }
1606 //@}
1607
1608 //! Serialisation
1609 //@{
1610 void fromXML(XMLNode* node) override;
1611 XMLNode* toXML(XMLDocument& doc) const override;
1612 //@}
1613
1614 //! Implementation
1615 void build() override;
1616
1617private:
1619 QuantLib::Natural dayOfMonth_;
1620 QuantLib::Natural nth_;
1621 QuantLib::Weekday weekday_;
1622 QuantLib::Natural calendarDaysBefore_;
1623 QuantLib::Integer businessDaysAfter_;
1624 QuantLib::Frequency contractFrequency_;
1627 QuantLib::Month oneContractMonth_;
1628 QuantLib::Integer offsetDays_;
1629 QuantLib::BusinessDayConvention bdc_;
1630
1631
1632 std::string strDayOfMonth_;
1633 std::string strNth_;
1634 std::string strWeekday_;
1638 std::string strCalendar_;
1640 QuantLib::Size expiryMonthLag_;
1642 std::string strOffsetDays_;
1643 std::string strBdc_;
1646 std::set<ProhibitedExpiry> prohibitedExpiries_;
1648 QuantLib::BusinessDayConvention optionBdc_;
1649 std::string strOptionBdc_;
1650 std::map<QuantLib::Natural, QuantLib::Natural> futureContinuationMappings_;
1651 std::map<QuantLib::Natural, QuantLib::Natural> optionContinuationMappings_;
1653 QuantLib::Natural hoursPerDay_;
1654 boost::optional<OffPeakPowerIndexData> offPeakPowerIndexData_;
1655 std::string indexName_;
1656
1658
1662 std::string strOptionNth_;
1664
1665
1666 QuantLib::Frequency optionContractFrequency_;
1667 QuantLib::Natural optionExpiryOffset_;
1668 QuantLib::Natural optionNth_;
1669 QuantLib::Weekday optionWeekday_;
1670 QuantLib::Natural optionExpiryDay_;
1671
1672 std::set<QuantLib::Month> validContractMonths_;
1673 std::string savingsTime_;
1674 // If its averaging Future but the front month is spot averaged and
1675 // balance of the month price is the average price of the remaining
1676 // future days in contract
1680 //! Option Underlying Future convention
1682 //! Populate and check frequency.
1683 Frequency parseAndValidateFrequency(const std::string& strFrequency);
1684
1685 //! Validate the business day conventions in the ProhibitedExpiry
1686 bool validateBdc(const ProhibitedExpiry& pe) const;
1687};
1688
1689//! Compare two prohibited expiries.
1692
1693//! Container for storing FX Option conventions
1694/*! Defining a switchTenor is optional. It is set to 0 * Days if no switch tenor is defined. In this case
1695 longTermAtmType and longTermDeltaType are set to atmType and deltaType respectively.
1696\ingroup marketdata
1697*/
1699public:
1700 //! \name Constructors
1701 //@{
1703 FxOptionConvention(const string& id, const string& fxConventionId, const string& atmType, const string& deltaType,
1704 const string& switchTenor = "", const string& longTermAtmType = "",
1705 const string& longTermDeltaType = "", const string& riskReversalInFavorOf = "Call",
1706 const string& butterflyStyle = "Broker");
1707 //@}
1708
1709 //! \name Inspectors
1710 //@{
1711 const string& fxConventionID() const { return fxConventionID_; }
1712 const DeltaVolQuote::AtmType& atmType() const { return atmType_; }
1713 const DeltaVolQuote::DeltaType& deltaType() const { return deltaType_; }
1714 const Period& switchTenor() const { return switchTenor_; }
1715 const DeltaVolQuote::AtmType& longTermAtmType() const { return longTermAtmType_; }
1716 const DeltaVolQuote::DeltaType& longTermDeltaType() const { return longTermDeltaType_; }
1717 const QuantLib::Option::Type& riskReversalInFavorOf() const { return riskReversalInFavorOf_; }
1719 //@}
1720
1721 //! \name Serialisation
1722 //@{
1723 virtual void fromXML(XMLNode* node) override;
1724 virtual XMLNode* toXML(XMLDocument& doc) const override;
1725 virtual void build() override;
1726 //@}
1727private:
1729 DeltaVolQuote::AtmType atmType_, longTermAtmType_;
1730 DeltaVolQuote::DeltaType deltaType_, longTermDeltaType_;
1732 QuantLib::Option::Type riskReversalInFavorOf_;
1734
1735 // Strings to store the inputs
1743};
1744
1745/*! Container for storing zero inflation index conventions
1746 \ingroup marketdata
1747*/
1749public:
1750 //! Constructor.
1752
1753 //! Detailed constructor.
1754 ZeroInflationIndexConvention(const std::string& id,
1755 const std::string& regionName,
1756 const std::string& regionCode,
1757 bool revised,
1758 const std::string& frequency,
1759 const std::string& availabilityLag,
1760 const std::string& currency);
1761
1762 QuantLib::Region region() const;
1763 bool revised() const { return revised_; }
1764 QuantLib::Frequency frequency() const { return frequency_; }
1765 const QuantLib::Period& availabilityLag() const { return availabilityLag_; }
1766 const QuantLib::Currency& currency() const { return currency_; }
1767
1768 void fromXML(XMLNode* node) override;
1769 XMLNode* toXML(XMLDocument& doc) const override;
1770 void build() override;
1771
1772private:
1773 std::string regionName_;
1774 std::string regionCode_;
1776 std::string strFrequency_;
1778 std::string strCurrency_;
1779
1780 QuantLib::Frequency frequency_;
1781 QuantLib::Period availabilityLag_;
1782 QuantLib::Currency currency_;
1783};
1784
1785/*! Container for storing bond yield calculation conventions
1786 \ingroup marketdata
1787*/
1789public:
1790 //! Constructor.
1792
1793 //! Detailed constructor.
1794 BondYieldConvention(const std::string& id,
1795 const std::string& compoundingName,
1796 const std::string& frequencyName,
1797 const std::string& priceTypeName,
1798 Real accuracy,
1799 Size maxEvaluations,
1800 Real guess);
1801
1802 std::string compoundingName() const { return compoundingName_; }
1803 Compounding compounding() const { return compounding_; }
1804 std::string frequencyName() const { return frequencyName_; }
1805 Frequency frequency() const { return frequency_; }
1806 QuantLib::Bond::Price::Type priceType() const { return priceType_; }
1807 std::string priceTypeName() const { return priceTypeName_; }
1808 QuantLib::Real accuracy() const { return accuracy_; }
1809 QuantLib::Size maxEvaluations() const { return maxEvaluations_; }
1810 QuantLib::Real guess() const { return guess_; }
1811
1812 void fromXML(XMLNode* node) override;
1813 XMLNode* toXML(XMLDocument& doc) const override;
1814 void build() override;
1815
1816private:
1817 Compounding compounding_;
1818 std::string compoundingName_;
1819 Frequency frequency_;
1820 std::string frequencyName_;
1821 QuantLib::Bond::Price::Type priceType_;
1822 std::string priceTypeName_;
1823 QuantLib::Real accuracy_;
1824 QuantLib::Size maxEvaluations_;
1825 QuantLib::Real guess_;
1826};
1827
1828} // namespace data
1829} // namespace ore
Container for storing Average OIS conventions.
BusinessDayConvention fixedConvention_
AverageOisConvention()
Default constructor.
BusinessDayConvention fixedPaymentConvention() const
Frequency fixedFrequency() const
const Period & fixedTenor() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
virtual void build() override
const DayCounter & fixedDayCounter() const
BusinessDayConvention fixedConvention() const
const Calendar & fixedCalendar() const
const string & indexName() const
const Period & onTenor() const
QuantLib::ext::shared_ptr< OvernightIndex > index() const
BusinessDayConvention fixedPaymentConvention_
Container for storing Libor-BMA Basis Swap conventions.
const string & bmaIndexName() const
const string & liborIndexName() const
BMABasisSwapConvention()
Default constructor.
QuantLib::ext::shared_ptr< QuantExt::BMAIndexWrapper > bmaIndex() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
virtual void build() override
QuantLib::ext::shared_ptr< IborIndex > liborIndex() const
QuantLib::Bond::Price::Type priceType() const
QuantLib::Real accuracy() const
Compounding compounding() const
QuantLib::Real guess() const
void fromXML(XMLNode *node) override
std::string frequencyName() const
XMLNode * toXML(XMLDocument &doc) const override
std::string compoundingName() const
QuantLib::Bond::Price::Type priceType_
QuantLib::Size maxEvaluations() const
std::string priceTypeName() const
Container for storing Credit Default Swap quote conventions.
const DayCounter & lastPeriodDayCounter() const
bool paysAtDefaultTime() const
Natural settlementDays() const
BusinessDayConvention paymentConvention() const
const DayCounter & dayCounter() const
virtual void fromXML(XMLNode *node0) override
const Calendar & calendar() const
virtual XMLNode * toXML(XMLDocument &doc) const override
DateGeneration::Rule rule_
virtual void build() override
BusinessDayConvention paymentConvention_
DateGeneration::Rule rule() const
Natural upfrontSettlementDays() const
Frequency frequency() const
CdsConvention()
Default constructor.
Container for storing CMS Spread Option conventions.
const DayCounter & dayCounter() const
const Period & forwardStart() const
const Calendar & calendar() const
CmsSpreadOptionConvention()
Default constructor.
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
BusinessDayConvention rollConvention_
BusinessDayConvention rollConvention() const
const Calendar & advanceCalendar() const
BusinessDayConvention bdc() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
CommodityForwardConvention()
Default constructor.
const QuantLib::Calendar & pricingCalendar() const
bool empty() const
Returns true if the data has not been populated.
void fromXML(XMLNode *node) override
Serialisation.
CalculationPeriod
Indicate location of calculation period relative to the future expiry date.
XMLNode * toXML(XMLDocument &doc) const override
AveragingData(const std::string &commodityName, const std::string &period, const std::string &pricingCalendar, bool useBusinessDays, const std::string &conventionsId="", QuantLib::Natural deliveryRollDays=0, QuantLib::Natural futureMonthOffset=0, QuantLib::Natural dailyExpiryOffset=QuantLib::Null< QuantLib::Natural >())
Detailed constructor.
Class to store conventions for creating an off peak power index.
XMLNode * toXML(XMLDocument &doc) const override
Class to hold prohibited expiry information.
ProhibitedExpiry(const QuantLib::Date &expiry, bool forFuture=true, QuantLib::BusinessDayConvention futureBdc=QuantLib::Preceding, bool forOption=true, QuantLib::BusinessDayConvention optionBdc=QuantLib::Preceding)
QuantLib::BusinessDayConvention optionBdc() const
QuantLib::BusinessDayConvention futureBdc() const
XMLNode * toXML(XMLDocument &doc) const override
QuantLib::BusinessDayConvention optionBusinessDayConvention() const
QuantLib::Natural optionExpiryOffset() const
const AveragingData & averagingData() const
QuantLib::Weekday weekday() const
Calendar balanceOfTheMonthPricingCalendar() const
boost::optional< OffPeakPowerIndexData > offPeakPowerIndexData_
CommodityFutureConvention(const std::string &id, const BusinessDaysAfter &businessDaysAfter, const std::string &contractFrequency, const std::string &calendar, const std::string &expiryCalendar="", QuantLib::Size expiryMonthLag=0, const std::string &oneContractMonth="", const std::string &offsetDays="", const std::string &bdc="", bool adjustBeforeOffset=true, bool isAveraging=false, const OptionExpiryAnchorDateRule &optionExpiryDateRule=OptionExpiryAnchorDateRule(), const std::set< ProhibitedExpiry > &prohibitedExpiries={}, QuantLib::Size optionExpiryMonthLag=0, const std::string &optionBdc="", const std::map< QuantLib::Natural, QuantLib::Natural > &futureContinuationMappings={}, const std::map< QuantLib::Natural, QuantLib::Natural > &optionContinuationMappings={}, const AveragingData &averagingData=AveragingData(), QuantLib::Natural hoursPerDay=QuantLib::Null< QuantLib::Natural >(), const boost::optional< OffPeakPowerIndexData > &offPeakPowerIndexData=boost::none, const std::string &indexName="", const std::string &optionFrequency="")
Business days before based constructor.
std::string optionUnderlyingFutureConvention_
Option Underlying Future convention.
const QuantLib::Calendar & expiryCalendar() const
const std::map< QuantLib::Natural, QuantLib::Natural > & futureContinuationMappings() const
QuantLib::Natural hoursPerDay() const
CommodityFutureConvention(const std::string &id, const DayOfMonth &dayOfMonth, const std::string &contractFrequency, const std::string &calendar, const std::string &expiryCalendar="", QuantLib::Size expiryMonthLag=0, const std::string &oneContractMonth="", const std::string &offsetDays="", const std::string &bdc="", bool adjustBeforeOffset=true, bool isAveraging=false, const OptionExpiryAnchorDateRule &optionExpiryDateRule=OptionExpiryAnchorDateRule(), const std::set< ProhibitedExpiry > &prohibitedExpiries={}, QuantLib::Size optionExpiryMonthLag=0, const std::string &optionBdc="", const std::map< QuantLib::Natural, QuantLib::Natural > &futureContinuationMappings={}, const std::map< QuantLib::Natural, QuantLib::Natural > &optionContinuationMappings={}, const AveragingData &averagingData=AveragingData(), QuantLib::Natural hoursPerDay=QuantLib::Null< QuantLib::Natural >(), const boost::optional< OffPeakPowerIndexData > &offPeakPowerIndexData=boost::none, const std::string &indexName="", const std::string &optionFrequency="")
Day of month based constructor.
QuantLib::BusinessDayConvention optionBdc_
const std::string & indexName() const
CommodityFutureConvention(const std::string &id, const CalendarDaysBefore &calendarDaysBefore, const std::string &contractFrequency, const std::string &calendar, const std::string &expiryCalendar="", QuantLib::Size expiryMonthLag=0, const std::string &oneContractMonth="", const std::string &offsetDays="", const std::string &bdc="", bool adjustBeforeOffset=true, bool isAveraging=false, const OptionExpiryAnchorDateRule &optionExpiryDateRule=OptionExpiryAnchorDateRule(), const std::set< ProhibitedExpiry > &prohibitedExpiries={}, QuantLib::Size optionExpiryMonthLag=0, const std::string &optionBdc="", const std::map< QuantLib::Natural, QuantLib::Natural > &futureContinuationMappings={}, const std::map< QuantLib::Natural, QuantLib::Natural > &optionContinuationMappings={}, const AveragingData &averagingData=AveragingData(), QuantLib::Natural hoursPerDay=QuantLib::Null< QuantLib::Natural >(), const boost::optional< OffPeakPowerIndexData > &offPeakPowerIndexData=boost::none, const std::string &indexName="", const std::string &optionFrequency="")
Calendar days before based constructor.
QuantLib::BusinessDayConvention businessDayConvention() const
QuantLib::Integer businessDaysAfter() const
const std::string & optionUnderlyingFutureConvention() const
QuantLib::Frequency contractFrequency() const
std::map< QuantLib::Natural, QuantLib::Natural > futureContinuationMappings_
QuantLib::Frequency optionContractFrequency() const
OptionAnchorType optionAnchorType() const
QuantLib::Natural optionNth() const
Frequency parseAndValidateFrequency(const std::string &strFrequency)
Populate and check frequency.
QuantLib::Size optionExpiryMonthLag() const
void fromXML(XMLNode *node) override
Serialisation.
const QuantLib::Calendar & calendar() const
std::set< ProhibitedExpiry > prohibitedExpiries_
XMLNode * toXML(XMLDocument &doc) const override
const std::set< ProhibitedExpiry > & prohibitedExpiries() const
void build() override
Implementation.
const std::map< QuantLib::Natural, QuantLib::Natural > & optionContinuationMappings() const
const std::string & savingsTime() const
QuantLib::Natural optionExpiryDay() const
QuantLib::Natural dayOfMonth() const
const boost::optional< OffPeakPowerIndexData > & offPeakPowerIndexData() const
std::map< QuantLib::Natural, QuantLib::Natural > optionContinuationMappings_
const std::set< QuantLib::Month > & validContractMonths() const
std::set< QuantLib::Month > validContractMonths_
QuantLib::Integer offsetDays() const
QuantLib::Weekday optionWeekday() const
QuantLib::BusinessDayConvention bdc_
QuantLib::Natural nth() const
QuantLib::Frequency optionContractFrequency_
QuantLib::Month oneContractMonth() const
QuantLib::Natural calendarDaysBefore() const
CommodityFutureConvention(const std::string &id, const std::string &nth, const std::string &weekday, const std::string &contractFrequency, const std::string &calendar, const std::string &expiryCalendar="", QuantLib::Size expiryMonthLag=0, const std::string &oneContractMonth="", const std::string &offsetDays="", const std::string &bdc="", bool adjustBeforeOffset=true, bool isAveraging=false, const OptionExpiryAnchorDateRule &optionExpiryDateRule=OptionExpiryAnchorDateRule(), const std::set< ProhibitedExpiry > &prohibitedExpiries={}, QuantLib::Size optionExpiryMonthLag=0, const std::string &optionBdc="", const std::map< QuantLib::Natural, QuantLib::Natural > &futureContinuationMappings={}, const std::map< QuantLib::Natural, QuantLib::Natural > &optionContinuationMappings={}, const AveragingData &averagingData=AveragingData(), QuantLib::Natural hoursPerDay=QuantLib::Null< QuantLib::Natural >(), const boost::optional< OffPeakPowerIndexData > &offPeakPowerIndexData=boost::none, const std::string &indexName="", const std::string &optionFrequency="")
N-th weekday based constructor.
CommodityFutureConvention()
Default constructor.
QuantLib::Size expiryMonthLag() const
bool validateBdc(const ProhibitedExpiry &pe) const
Validate the business day conventions in the ProhibitedExpiry.
Abstract base class for convention objects.
Definition: conventions.hpp:55
const string & id() const
Definition: conventions.hpp:91
Type
Supported convention types.
Definition: conventions.hpp:58
virtual void build()=0
virtual ~Convention()
Default destructor.
Definition: conventions.hpp:87
Repository for currency dependent market conventions.
bool has(const std::string &id) const
Checks if we have a convention with the given id.
Conventions()
Default constructor.
QuantLib::ext::shared_ptr< Convention > get(const string &id) const
map< string, QuantLib::ext::shared_ptr< Convention > > data_
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
std::set< string > used_
map< string, std::pair< string, string > > unparsed_
boost::shared_mutex mutex_
QuantLib::ext::shared_ptr< Convention > getFxConvention(const string &ccy1, const string &ccy2) const
void add(const QuantLib::ext::shared_ptr< Convention > &convention) const
Container for storing Cross Currency Basis Swap quote conventions.
const QuantLib::Period & flatTenor() const
boost::optional< bool > flatIncludeSpread_
boost::optional< QuantLib::Size > flatFixingDays() const
QuantLib::ext::shared_ptr< IborIndex > spreadIndex() const
boost::optional< QuantLib::Size > fixingDays_
boost::optional< bool > flatIsAveraged() const
boost::optional< QuantLib::Period > lookback() const
QuantLib::ext::shared_ptr< IborIndex > flatIndex() const
boost::optional< QuantLib::Size > flatFixingDays_
const Calendar & settlementCalendar() const
boost::optional< QuantLib::Period > lookback_
const string & spreadIndexName() const
boost::optional< bool > isAveraged_
CrossCcyBasisSwapConvention()
Default constructor.
boost::optional< Size > flatRateCutoff_
boost::optional< Size > flatRateCutoff() const
boost::optional< Size > rateCutoff_
const QuantLib::Period & spreadTenor() const
boost::optional< bool > flatIncludeSpread() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
boost::optional< bool > includeSpread() const
boost::optional< QuantLib::Period > flatLookback() const
boost::optional< QuantLib::Period > flatLookback_
boost::optional< QuantLib::Size > fixingDays() const
boost::optional< bool > isAveraged() const
boost::optional< bool > includeSpread_
boost::optional< bool > flatIsAveraged_
BusinessDayConvention rollConvention() const
const string & flatIndexName() const
boost::optional< Size > rateCutoff() const
QuantLib::BusinessDayConvention fixedConvention() const
QuantLib::BusinessDayConvention settlementConvention() const
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
const QuantLib::Calendar & settlementCalendar() const
QuantLib::ext::shared_ptr< QuantLib::IborIndex > index() const
QuantLib::Frequency fixedFrequency() const
QuantLib::Natural settlementDays() const
QuantLib::BusinessDayConvention settlementConvention_
QuantLib::BusinessDayConvention fixedConvention_
const QuantLib::DayCounter & fixedDayCounter() const
CrossCcyFixFloatSwapConvention()
Default constructor.
const QuantLib::Currency & fixedCurrency() const
Container for storing Deposit conventions.
const DayCounter & dayCounter() const
const string & index() const
const Size settlementDays() const
const Calendar & calendar() const
DepositConvention()
Default constructor.
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
BusinessDayConvention convention_
BusinessDayConvention convention() const
virtual void build() override
Container for storing FX Spot quote conventions.
const Calendar & advanceCalendar() const
Natural spotDays() const
const Currency & sourceCurrency() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
BusinessDayConvention convention_
BusinessDayConvention convention() const
virtual void build() override
const Currency & targetCurrency() const
FXConvention()
Default constructor.
Container for storing Forward rate Agreement conventions.
virtual void build() override
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
QuantLib::ext::shared_ptr< IborIndex > index() const
const string & indexName() const
FraConvention()
Default constructor.
Container for storing Money Market Futures conventions.
QuantLib::RateAveraging::Type overnightIndexFutureNettingType_
virtual void build() override
FutureConvention()
Default constructor.
DateGenerationRule dateGenerationRule() const
virtual void fromXML(XMLNode *node) override
Serialisation.
virtual XMLNode * toXML(XMLDocument &doc) const override
DateGenerationRule dateGenerationRule_
QuantLib::ext::shared_ptr< IborIndex > index() const
QuantLib::RateAveraging::Type overnightIndexFutureNettingType() const
Container for storing FX Option conventions.
const QuantLib::Option::Type & riskReversalInFavorOf() const
DeltaVolQuote::AtmType atmType_
const DeltaVolQuote::DeltaType & deltaType() const
const string & fxConventionID() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
virtual void build() override
DeltaVolQuote::AtmType longTermAtmType_
const DeltaVolQuote::DeltaType & longTermDeltaType() const
const DeltaVolQuote::AtmType & longTermAtmType() const
const Period & switchTenor() const
const bool butterflyIsBrokerStyle() const
const DeltaVolQuote::AtmType & atmType() const
DeltaVolQuote::DeltaType deltaType_
DeltaVolQuote::DeltaType longTermDeltaType_
QuantLib::Option::Type riskReversalInFavorOf_
Container for storing Interest Rate Swap conventions.
Frequency floatFrequency() const
BusinessDayConvention fixedConvention_
SubPeriodsCoupon1::Type subPeriodsCouponType() const
IRSwapConvention()
Default constructor.
Frequency fixedFrequency() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
virtual void build() override
const DayCounter & fixedDayCounter() const
BusinessDayConvention fixedConvention() const
QuantLib::ext::shared_ptr< IborIndex > index() const
const Calendar & fixedCalendar() const
const string & indexName() const
SubPeriodsCoupon1::Type subPeriodsCouponType_
Container for storing Ibor Index conventions.
const string & businessDayConvention() const
const string & fixingCalendar() const
const bool endOfMonth() const
const Size settlementDays() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
virtual void build() override
const string & dayCounter() const
QuantLib::ext::shared_ptr< ScheduleData > publicationScheduleData_
BusinessDayConvention infConvention_
PublicationRoll publicationRoll() const
QuantLib::ext::shared_ptr< ZeroInflationIndex > index() const
const DayCounter & dayCounter() const
const Calendar & fixCalendar() const
BusinessDayConvention fixConvention() const
virtual void fromXML(XMLNode *node) override
QuantLib::ext::shared_ptr< ZeroInflationIndex > index_
virtual XMLNode * toXML(XMLDocument &doc) const override
virtual void build() override
BusinessDayConvention infConvention() const
const string & indexName() const
const Calendar & infCalendar() const
PublicationRoll
Rule for determining when inflation swaps roll to observing latest inflation index release.
BusinessDayConvention fixConvention_
const Schedule & publicationSchedule() const
Singleton to hold conventions.
const QuantLib::ext::shared_ptr< ore::data::Conventions > & conventions(QuantLib::Date d=QuantLib::Date()) const
Definition: conventions.cpp:72
std::map< QuantLib::Date, QuantLib::ext::shared_ptr< ore::data::Conventions > > conventions_
void setConventions(const QuantLib::ext::shared_ptr< ore::data::Conventions > &conventions, QuantLib::Date d=QuantLib::Date())
Definition: conventions.cpp:92
Container for storing Overnight Index Swap conventions.
BusinessDayConvention fixedConvention_
BusinessDayConvention fixedPaymentConvention() const
Frequency fixedFrequency() const
virtual void fromXML(XMLNode *node) override
Natural paymentLag() const
virtual XMLNode * toXML(XMLDocument &doc) const override
DateGeneration::Rule rule_
virtual void build() override
const DayCounter & fixedDayCounter() const
DateGeneration::Rule rule() const
BusinessDayConvention fixedConvention() const
Natural spotLag() const
const Calendar & fixedCalendar() const
const string & indexName() const
QuantLib::Calendar paymentCal_
QuantLib::ext::shared_ptr< OvernightIndex > index() const
OisConvention()
Default constructor.
QuantLib::Calendar paymentCalendar() const
BusinessDayConvention fixedPaymentConvention_
Container for storing Overnight Index conventions.
const string & fixingCalendar() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
virtual void build() override
const string & dayCounter() const
Container for storing Bond Spread Rate conventions.
const Calendar & spotCalendar() const
Calendar used for spot date adjustment.
const DayCounter & dayCounter() const
Zero rate day counter.
SecuritySpreadConvention()
Default constructor.
Compounding compounding() const
Zero rate compounding.
const Calendar & tenorCalendar() const
Return the calendar used for converting tenor points into dates.
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
bool eom()
End of month adjustment.
Frequency compoundingFrequency() const
Zero rate compounding frequency.
BusinessDayConvention rollConvention_
bool tenorBased()
Flag to indicate whether the Zero Rate convention is based on a tenor input.
Natural spotLag() const
Zero rate spot lag.
BusinessDayConvention rollConvention() const
Business day convention used in converting tenor points into dates.
Container for storing Swap Index conventions.
const string & fixingCalendar() const
virtual void build() override
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & conventions() const
Container for storing Tenor Basis Swap conventions.
const string & payIndexName() const
SubPeriodsCoupon1::Type subPeriodsCouponType() const
const Period & payFrequency() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
QuantLib::ext::shared_ptr< IborIndex > receiveIndex() const
virtual void build() override
QuantLib::ext::shared_ptr< IborIndex > payIndex() const
const Period & receiveFrequency() const
TenorBasisSwapConvention()
Default constructor.
const string & receiveIndexName() const
SubPeriodsCoupon1::Type subPeriodsCouponType_
Container for storing conventions for Tenor Basis Swaps quoted as a spread of two interest rate swaps...
BusinessDayConvention longFixedConvention() const
BusinessDayConvention shortFixedConvention() const
BusinessDayConvention longFixedConvention_
const Calendar & calendar() const
virtual void fromXML(XMLNode *node) override
BusinessDayConvention shortFixedConvention_
virtual XMLNode * toXML(XMLDocument &doc) const override
TenorBasisTwoSwapConvention()
Default constructor.
QuantLib::ext::shared_ptr< IborIndex > shortIndex() const
QuantLib::ext::shared_ptr< IborIndex > longIndex() const
const DayCounter & shortFixedDayCounter() const
const DayCounter & longFixedDayCounter() const
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
QuantLib::Frequency frequency() const
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
const QuantLib::Period & availabilityLag() const
const QuantLib::Currency & currency() const
Container for storing Zero Rate conventions.
const Calendar & spotCalendar() const
Calendar used for spot date adjustment.
const DayCounter & dayCounter() const
Zero rate day counter.
Compounding compounding() const
Zero rate compounding.
const Calendar & tenorCalendar() const
Return the calendar used for converting tenor points into dates.
virtual void fromXML(XMLNode *node) override
ZeroRateConvention()
Default constructor.
virtual XMLNode * toXML(XMLDocument &doc) const override
bool eom()
End of month adjustment.
Frequency compoundingFrequency() const
Zero rate compounding frequency.
virtual void build() override
BusinessDayConvention rollConvention_
bool tenorBased()
Flag to indicate whether the Zero Rate convention is based on a tenor input.
Natural spotLag() const
Zero rate spot lag.
BusinessDayConvention rollConvention() const
Business day convention used in converting tenor points into dates.
@ data
Definition: log.hpp:77
Date lastWeekday(Weekday dayOfWeek, Month m, Year y)
bool operator<(const Dividend &d1, const Dividend &d2)
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade schedule data model and serialization
BusinessDaysAfter(const std::string &businessDaysAfter)
CalendarDaysBefore(const std::string &calendarDaysBefore)
Classes to differentiate constructors below.
OptionExpiryAnchorDateRule(const std::string &nth, const std::string &weekday)
OptionExpiryAnchorDateRule(const CalendarDaysBefore &businessDaysBefore)
XML utility functions.