Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
marketdatum.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/marketdata/marketdatum.hpp
20 \brief Market data representation
21 \ingroup marketdata
22*/
23
24#pragma once
25
33
34#include <ql/currency.hpp>
35#include <ql/quotes/simplequote.hpp>
36#include <ql/time/date.hpp>
37#include <ql/time/daycounter.hpp>
38#include <ql/types.hpp>
39#include <string>
40
41#include <boost/make_shared.hpp>
42#include <boost/optional.hpp>
43#include <boost/serialization/base_object.hpp>
44#include <boost/serialization/export.hpp>
45#include <boost/serialization/optional.hpp>
46#include <boost/serialization/shared_ptr.hpp>
47#include <boost/serialization/variant.hpp>
48
49namespace ore {
50namespace data {
51using QuantLib::Date;
52using QuantLib::DayCounter;
53using QuantLib::Handle;
54using QuantLib::Month;
55using QuantLib::Months;
56using QuantLib::Natural;
57using QuantLib::Period;
58using QuantLib::Quote;
59using QuantLib::Real;
60using QuantLib::SimpleQuote;
61using QuantLib::Size;
62using std::string;
63
64//! Base market data class
65/*!
66 This class holds a single market point, a SimpleQuote pointer and generic
67 additional information.
68
69 The market point is classified by an instrument type, a quote type and
70 a name string. The name's structure depends on the market point's type
71 with tokens separated by "/".
72
73 Specific market data classes are derived from this base class and hold
74 additional specific data that are represented by the market point's name.
75
76 \ingroup marketdata
77*/
79public:
81 //! Supported market instrument types
82 enum class InstrumentType {
83 ZERO,
85 MM,
88 FRA,
89 IMM_FRA,
90 IR_SWAP,
95 CDS,
97 FX_SPOT,
98 FX_FWD,
101 SWAPTION,
102 CAPFLOOR,
103 FX_OPTION,
113 BOND,
120 CPR,
121 RATING,
122 NONE
123 };
124
125 //! Supported market quote types
126 enum class QuoteType {
132 RATE,
133 RATIO,
134 PRICE,
136 RATE_NVOL,
139 SHIFT,
141 NONE
142 };
143
144 //! Constructor
146 : quote_(QuantLib::ext::make_shared<SimpleQuote>(value)), asofDate_(asofDate), name_(name),
148
149 //! Default destructor
150 virtual ~MarketDatum() {}
151
152 //! Make a copy of the market datum
153 virtual QuantLib::ext::shared_ptr<MarketDatum> clone() {
154 return QuantLib::ext::make_shared<MarketDatum>(quote_->value(), asofDate_, name_, quoteType_, instrumentType_);
155 }
156
157 //! \name Inspectors
158 //@{
159 const string& name() const { return name_; }
160 const Handle<Quote>& quote() const { return quote_; }
161 Date asofDate() const { return asofDate_; }
163 QuoteType quoteType() const { return quoteType_; }
164 //@}
165protected:
166 Handle<Quote> quote_;
168 string name_;
171
172private:
173 //! Serialization
175 template <class Archive> void serialize(Archive& ar, const unsigned int version);
176};
177
178bool operator<(const MarketDatum& a, const MarketDatum& b);
179
181 bool operator()(const QuantLib::ext::shared_ptr<MarketDatum>& a, const QuantLib::ext::shared_ptr<MarketDatum>& b) const {
182 return *a < *b;
183 }
184};
185
186std::ostream& operator<<(std::ostream& out, const MarketDatum::QuoteType& type);
187std::ostream& operator<<(std::ostream& out, const MarketDatum::InstrumentType& type);
188
189//! Money market data class
190/*!
191 This class holds single market points of type
192 - MM
193
194 Specific data comprise currency, fwdStart, term
195
196 \ingroup marketdata
197*/
199public:
201 //! Constructor
202 MoneyMarketQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, Period fwdStart,
203 Period term, const std::string& indexName = "")
206
207 //! Make a copy of the datum
208 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
209 return QuantLib::ext::make_shared<MoneyMarketQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, fwdStart_, term_, indexName_);
210 }
211
212 //! \name Inspectors
213 //@{
214 const string& ccy() const { return ccy_; }
215 const Period& fwdStart() const { return fwdStart_; }
216 const Period& term() const { return term_; }
217 //! Empty if the index name is not provided.
218 const std::string& indexName() const { return indexName_; }
219 //@}
220private:
221 string ccy_;
222 Period fwdStart_;
223 Period term_;
224 std::string indexName_;
225 //! Serialization
227 template <class Archive> void serialize(Archive& ar, const unsigned int version);
228};
229
230//! FRA market data class
231/*!
232 This class holds single market points of type
233 - FRA
234
235 Specific data comprise currency, fwdStart, term
236
237 \ingroup marketdata
238*/
239class FRAQuote : public MarketDatum {
240public:
242 //! Constructor
243 FRAQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, Period fwdStart,
244 Period term)
246 term_(term) {}
247
248 //! Make a copy of the market datum
249 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
250 return QuantLib::ext::make_shared<FRAQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, fwdStart_, term_);
251 }
252
253 //! \name Inspectors
254 //@{
255 const string& ccy() const { return ccy_; }
256 const Period& fwdStart() const { return fwdStart_; }
257 const Period& term() const { return term_; }
258 //@}
259private:
260 string ccy_;
261 Period fwdStart_;
262 Period term_;
263 //! Serialization
265 template <class Archive> void serialize(Archive& ar, const unsigned int version);
266};
267
268//! IMM FRA market data class
269/*!
270 This class holds single market points of type
271 - IMM FRA
272
273 Specific data comprise currency, IMM 1 and IMM 2
274
275 IMM 1 & 2 are strings representing the IMM dates - 1 is the next date,
276 up to 9, and then A, B, C, D
277
278\ingroup marketdata
279*/
280class ImmFraQuote : public MarketDatum {
281public:
283 //! Constructor
284 ImmFraQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, Size imm1, Size imm2)
286
287 //! Make a copy of the market datum
288 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
289 return QuantLib::ext::make_shared<ImmFraQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, imm1_, imm2_);
290 }
291
292 //! \name Inspectors
293 //@{
294 const string& ccy() const { return ccy_; }
295 const Size& imm1() const { return imm1_; }
296 const Size& imm2() const { return imm2_; }
297 //@}
298private:
299 string ccy_;
300 Size imm1_;
301 Size imm2_;
302 //! Serialization
304 template <class Archive> void serialize(Archive& ar, const unsigned int version);
305};
306
307//! Swap market data class
308/*!
309 This class holds single market points of type
310 - IR_SWAP
311
312 Specific data comprise currency, fwdStart, tenor, term, startDate, maturityDate
313 The constructor accepts either fwdStart/term or startDate/maturityDate
314
315 \ingroup marketdata
316*/
317class SwapQuote : public MarketDatum {
318public:
320 //! Constructor if fwdStart / tenor is given
321 SwapQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, Period fwdStart,
322 Period term, Period tenor, const std::string& indexName = "")
324 term_(term), tenor_(tenor), indexName_(indexName), startDate_(Null<Date>()), maturityDate_(Null<Date>()) {}
325 //! Constructor if startDate, maturityDate is given
326 SwapQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, Date startDate,
327 Date maturityDate, Period tenor, const std::string& indexName = "")
330
331 //! Make a copy of the market datum
332 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
333 if (startDate_ == Null<Date>() && maturityDate_ == Null<Date>())
334 return QuantLib::ext::make_shared<SwapQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, fwdStart_, term_,
335 tenor_);
336 else
337 return QuantLib::ext::make_shared<SwapQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, startDate_,
339 }
340
341 //! \name Inspectors
342 //@{
343 const string& ccy() const { return ccy_; }
344 const Period& fwdStart() const { return fwdStart_; }
345 const Period& term() const { return term_; }
346 const Period& tenor() const { return tenor_; }
347 const std::string& indeName() const { return indexName_; }
348 const Date& startDate() const { return startDate_; }
349 const Date& maturityDate() const { return maturityDate_; }
350 //@}
351private:
352 string ccy_;
353 Period fwdStart_;
354 Period term_;
355 Period tenor_;
356 std::string indexName_;
359 //! Serialization
361 template <class Archive> void serialize(Archive& ar, const unsigned int version);
362};
363
364class ZeroQuote : public MarketDatum {
365public:
367 //! Constructor
368 ZeroQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, const string& ccy, Date date,
369 DayCounter dayCounter, Period tenor = Period())
372 // Minimal adjustment in the absence of a calendar
373 QL_REQUIRE(date_ != Date() || tenor != Period(), "ZeroQuote: either date or period is required");
374 tenorBased_ = (date_ == Date());
375 }
376
377 //! Make a copy of the market datum
378 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
379 return QuantLib::ext::make_shared<ZeroQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, date_, dayCounter_, tenor_);
380 }
381
382 //! Inspectors
383 //@{
384 const string& ccy() const { return ccy_; }
385 Date date() const { return date_; }
386 DayCounter dayCounter() const { return dayCounter_; }
387 const Period& tenor() const { return tenor_; }
388 bool tenorBased() const { return tenorBased_; }
389 //@}
390private:
391 string ccy_;
392 Date date_;
393 DayCounter dayCounter_;
394 Period tenor_;
396 //! Serialization
398 template <class Archive> void serialize(Archive& ar, const unsigned int version);
399};
400
401//! Discount market data class
402/*!
403 This class holds single market points of type
404 - DISCOUNT.
405 Specific data comprise currency, date.
406
407 \ingroup marketdata
408*/
410public:
412 //! Constructor
413 DiscountQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, Date date, Period tenor)
415
416 //! Make a copy of the market datum
417 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
418 return QuantLib::ext::make_shared<DiscountQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, date_, tenor_);
419 }
420 //! \name Inspectors
421 //@{
422 const string& ccy() const { return ccy_; }
423 Date date() const { return date_; }
424 Period tenor() const { return tenor_; }
425 //@}
426private:
427 string ccy_;
428 Date date_;
429 Period tenor_;
430 //! Serialization
432 template <class Archive> void serialize(Archive& ar, const unsigned int version);
433};
434
435//! Money Market Future data class
436/*! This class holds single market points of type - MM_FUTURE.
437 Specific data comprise currency, expiry, contract and future tenor.
438
439 \warning expiry parameter is expected in the format YYYY-MM e.g.
440 2013-06 for Jun 2013, 1998-05 for May 1998, etc.
441
442 \ingroup marketdata
443*/
445public:
447 //! Constructor
448 MMFutureQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, string expiry,
449 string contract = "", Period tenor = 3 * Months)
452
453 //! Make a copy of the market datum
454 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
455 return QuantLib::ext::make_shared<MMFutureQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, expiry_, contract_, tenor_);
456 }
457
458 //! \name Inspectors
459 //@{
460 const string& ccy() const { return ccy_; }
461 const string& expiry() const { return expiry_; }
462 Natural expiryYear() const;
463 Month expiryMonth() const;
464 const string& contract() const { return contract_; }
465 const Period& tenor() const { return tenor_; }
466 //@}
467
468private:
469 string ccy_;
470 string expiry_;
471 string contract_;
472 Period tenor_;
473 //! Serialization
475 template <class Archive> void serialize(Archive& ar, const unsigned int version);
476};
477
478//! Overnight index future data class
479/*! This class holds single market points of type - OI_FUTURE.
480 Specific data comprise currency, expiry, contract and future tenor.
481
482 \warning expiry parameter is expected in the format YYYY-MM e.g.
483 2013-06 for Jun 2013, 1998-05 for May 1998, etc.
484
485 \ingroup marketdata
486*/
488public:
490 //! Constructor
491 OIFutureQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, string expiry,
492 string contract = "", Period tenor = 3 * Months)
495
496 //! Make a copy of the market datum
497 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
498 return QuantLib::ext::make_shared<OIFutureQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, expiry_, contract_, tenor_);
499 }
500
501 //! \name Inspectors
502 //@{
503 const string& ccy() const { return ccy_; }
504 const string& expiry() const { return expiry_; }
505 Natural expiryYear() const;
506 Month expiryMonth() const;
507 const string& contract() const { return contract_; }
508 const Period& tenor() const { return tenor_; }
509 //@}
510
511private:
512 string ccy_;
513 string expiry_;
514 string contract_;
515 Period tenor_;
516 //! Serialization
518 template <class Archive> void serialize(Archive& ar, const unsigned int version);
519};
520
521//! Basis Swap data class
522/*!
523 This class holds single market points of type
524 - BASIS_SWAP SPREAD
525 Specific data comprise
526 - flat term
527 - term
528
529 The quote (in Basis Points) is then interpreted as follows:
530
531 A fair Swap pays the reference index with "flat term" with spread zero
532 and receives the reference index with "term" plus the quoted spread.
533
534 \ingroup marketdata
535*/
537public:
539 //! Constructor
540 BasisSwapQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, Period flatTerm, Period term,
541 string ccy = "USD", Period maturity = 3 * Months)
544
545 //! Make a copy of the market datum
546 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
547 return QuantLib::ext::make_shared<BasisSwapQuote>(quote_->value(), asofDate_, name_, quoteType_, flatTerm_, term_, ccy_, maturity_);
548 }
549
550 //! \name Inspectors
551 //@{
552 const Period& flatTerm() const { return flatTerm_; }
553 const Period& term() const { return term_; }
554 const string& ccy() const { return ccy_; }
555 const Period& maturity() const { return maturity_; }
556 //@}
557private:
558 Period flatTerm_;
559 Period term_;
560 string ccy_;
561 Period maturity_;
562 //! Serialization
564 template <class Archive> void serialize(Archive& ar, const unsigned int version);
565};
566
567//! BMA Swap data class
568/*!
569This class holds single market points of type
570- BMA_SWAP
571Specific data comprise
572- term
573- currency
574- maturity
575
576The quote (in Basis Points) is then interpreted as follows:
577
578A fair Swap pays the libor index with gearing equal to the quote
579and receives the bma index.
580
581\ingroup marketdata
582*/
583class BMASwapQuote : public MarketDatum {
584public:
586 //! Constructor
587 BMASwapQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, Period term, string ccy = "USD",
588 Period maturity = 3 * Months)
591
592 //! Make a copy of the market datum
593 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
594 return QuantLib::ext::make_shared<BMASwapQuote>(quote_->value(), asofDate_, name_, quoteType_, term_, ccy_, maturity_);
595 }
596
597 //! \name Inspectors
598 //@{
599 const Period& term() const { return term_; }
600 const string& ccy() const { return ccy_; }
601 const Period& maturity() const { return maturity_; }
602 //@}
603private:
604 Period term_;
605 string ccy_;
606 Period maturity_;
607 //! Serialization
609 template <class Archive> void serialize(Archive& ar, const unsigned int version);
610};
611
612//! Cross Currency Basis Swap data class
613/*!
614 This class holds single market points of type
615 - CC_BASIS_SWAP BASIS_SPREAD
616 Specific data comprise
617 - flat currency
618 - currency
619
620 The quote in Basis Points is then interpreted as follows:
621
622 A fair Swap pays the reference index of "flat currency" in "flat currency"
623 with spread zero and receives the reference index of "currency" in
624 "currency" plus the quoted spread.
625
626 \ingroup marketdata
627*/
629public:
631 //! Constructor
633 Period flatTerm, string ccy, Period term, Period maturity = 3 * Months)
636
637 //! Make a copy of the market datum
638 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
639 return QuantLib::ext::make_shared<CrossCcyBasisSwapQuote>(quote_->value(), asofDate_, name_, quoteType_, flatCcy_, flatTerm_, ccy_, term_, maturity_);
640 }
641
642 //! \name Inspectors
643 //@{
644 const string& flatCcy() const { return flatCcy_; }
645 const Period& flatTerm() const { return flatTerm_; }
646 const string& ccy() const { return ccy_; }
647 const Period& term() const { return term_; }
648 const Period& maturity() const { return maturity_; }
649 //@}
650
651private:
652 string flatCcy_;
653 Period flatTerm_;
654 string ccy_;
655 Period term_;
656 Period maturity_;
657 //! Serialization
659 template <class Archive> void serialize(Archive& ar, const unsigned int version);
660};
661
662//! Cross Currency Fix Float Swap quote holder
663/*! Holds the quote for the fair fixed rate on a fixed against float
664 cross currency swap.
665
666 \ingroup marketdata
667*/
669public:
671 //! Constructor
672 CrossCcyFixFloatSwapQuote(QuantLib::Real value, const QuantLib::Date& asof, const std::string& name,
673 QuoteType quoteType, const string& floatCurrency, const QuantLib::Period& floatTenor,
674 const string& fixedCurrency, const QuantLib::Period& fixedTenor,
675 const QuantLib::Period& maturity)
678
679 //! Make a copy of the market datum
680 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
681 return QuantLib::ext::make_shared<CrossCcyFixFloatSwapQuote>(quote_->value(), asofDate_, name_, quoteType_, floatCurrency_, floatTenor_, fixedCurrency_, fixedTenor_, maturity_);
682 }
683
684 //! \name Inspectors
685 //@{
686 const string& floatCurrency() const { return floatCurrency_; }
687 const QuantLib::Period& floatTenor() const { return floatTenor_; }
688 const string& fixedCurrency() const { return fixedCurrency_; }
689 const QuantLib::Period& fixedTenor() const { return fixedTenor_; }
690 const QuantLib::Period& maturity() const { return maturity_; }
691 //@}
692
693private:
695 QuantLib::Period floatTenor_;
697 QuantLib::Period fixedTenor_;
698 QuantLib::Period maturity_;
699 //! Serialization
701 template <class Archive> void serialize(Archive& ar, const unsigned int version);
702};
703
704/*! CDS Spread data class
705 This class holds single market points of type
706 - CREDIT_SPREAD
707 - CONV_CREDIT_SPREAD
708 - PRICE
709 \ingroup marketdata
710*/
711class CdsQuote : public MarketDatum {
712public:
713 CdsQuote() : runningSpread_(Null<Real>()) {}
714
715 //! Constructor
716 CdsQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, const string& underlyingName,
717 const string& seniority, const string& ccy, Period term, const string& docClause = "",
718 Real runningSpread = Null<Real>())
721
722 //! Make a copy of the market datum
723 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
724 return QuantLib::ext::make_shared<CdsQuote>(quote_->value(), asofDate_, name_, quoteType_, underlyingName_,
726 }
727
728 //! \name Inspectors
729 //@{
730 const Period& term() const { return term_; }
731 const string& seniority() const { return seniority_; }
732 const string& ccy() const { return ccy_; }
733 const string& underlyingName() const { return underlyingName_; }
734 const string& docClause() const { return docClause_; }
735 Real runningSpread() const { return runningSpread_; }
736 //@}
737
738private:
741 string ccy_;
742 Period term_;
745
746 //! Serialization
748 template <class Archive> void serialize(Archive& ar, const unsigned int version);
749};
750
751//! Hazard rate data class
752/*!
753 This class holds single market points of type
754 - HAZARD_RATE
755
756 \ingroup marketdata
757*/
759public:
761 //! Constructor
762 HazardRateQuote(Real value, Date asofDate, const string& name, const string& underlyingName,
763 const string& seniority, const string& ccy, Period term, const string& docClause = "")
766
767 //! Make a copy of the market datum
768 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
769 return QuantLib::ext::make_shared<HazardRateQuote>(quote_->value(), asofDate_, name_, underlyingName_, seniority_, ccy_, term_, docClause_);
770 }
771
772 //! \name Inspectors
773 //@{
774 const Period& term() const { return term_; }
775 const string& seniority() const { return seniority_; }
776 const string& ccy() const { return ccy_; }
777 const string& underlyingName() const { return underlyingName_; }
778 const string& docClause() const { return docClause_; }
779 //@}
780private:
783 string ccy_;
784 Period term_;
786 //! Serialization
788 template <class Archive> void serialize(Archive& ar, const unsigned int version);
789};
790
791//! Recovery rate data class
792/*!
793 This class holds single market points of type
794 - RECOVERY_RATE
795 \ingroup marketdata
796*/
798public:
800 //! Constructor
801 RecoveryRateQuote(Real value, Date asofDate, const string& name, const string& underlyingName,
802 const string& seniority, const string& ccy, const string& docClause = "")
805
806 //! Make a copy of the market datum
807 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
808 return QuantLib::ext::make_shared<RecoveryRateQuote>(quote_->value(), asofDate_, name_, underlyingName_, seniority_, ccy_, docClause_);
809 }
810
811 //! \name Inspectors
812 //@{
813 const string& seniority() const { return seniority_; }
814 const string& ccy() const { return ccy_; }
815 const string& underlyingName() const { return underlyingName_; }
816 const string& docClause() const { return docClause_; }
817 //@}
818private:
821 string ccy_;
823 //! Serialization
825 template <class Archive> void serialize(Archive& ar, const unsigned int version);
826};
827
828//! Swaption data class
829/*!
830 This class holds single market points of type
831 - SWAPTION
832 Specific data comprise
833 - currency
834 - expiry
835 - term
836 - at-the-money flag (is an at-the-money swaption quote?)
837 - strike
838
839 \ingroup marketdata
840*/
842public:
844 //! Constructor
845 SwaptionQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, Period expiry,
846 Period term, string dimension, Real strike = 0.0, const std::string& quoteTag = std::string(),
847 bool isPayer = true)
850
851 //! Make a copy of the market datum
852 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
853 return QuantLib::ext::make_shared<SwaptionQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, expiry_, term_,
855 }
856
857 //! \name Inspectors
858 //@{
859 const string& ccy() const { return ccy_; }
860 const Period& expiry() const { return expiry_; }
861 const Period& term() const { return term_; }
862 const string& dimension() const { return dimension_; }
863 Real strike() { return strike_; }
864 const string& quoteTag() const { return quoteTag_; }
865 bool isPayer() const { return isPayer_; }
866 //@}
867private:
868 string ccy_;
869 Period expiry_;
870 Period term_;
873 string quoteTag_;
875 //! Serialization
877 template <class Archive> void serialize(Archive& ar, const unsigned int version);
878};
879
880//! Shift data class (for SLN swaption volatilities)
881/*!
882 This class holds single market points of type
883 - SHIFT
884 Specific data comprise
885 - currency
886 - term
887
888 \ingroup marketdata
889*/
891public:
893 //! Constructor
894 SwaptionShiftQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, Period term,
895 const std::string& quoteTag = std::string())
898 QL_REQUIRE(quoteType == MarketDatum::QuoteType::SHIFT, "quote type must be SHIFT for shift data");
899 }
900
901 //! Make a copy of the market datum
902 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
903 return QuantLib::ext::make_shared<SwaptionShiftQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, term_);
904 }
905
906 //! \name Inspectors
907 //@{
908 const string& ccy() const { return ccy_; }
909 const Period& term() const { return term_; }
910 const string& quoteTag() const { return quoteTag_; }
911 //@}
912private:
913 string ccy_;
914 Period term_;
915 string quoteTag_;
916 //! Serialization
918 template <class Archive> void serialize(Archive& ar, const unsigned int version);
919};
920
921//! Bond option data class
922/*!
923This class holds single market points of type
924- BOND_OPTION
925Specific data comprise
926- qualifier
927- expiry
928- term
929
930\ingroup marketdata
931*/
932
934public:
936 //! Constructor
937 BondOptionQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string qualifier, Period expiry,
938 Period term)
941
942 //! Make a copy of the market datum
943 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
944 return QuantLib::ext::make_shared<BondOptionQuote>(quote_->value(), asofDate_, name_, quoteType_, qualifier_, expiry_, term_);
945 }
946
947 //! \name Inspectors
948 //@{
949 const string& qualifier() const { return qualifier_; }
950 const Period& expiry() const { return expiry_; }
951 const Period& term() const { return term_; }
952 //@}
953private:
955 Period expiry_;
956 Period term_;
957 //! Serialization
959 template <class Archive> void serialize(Archive& ar, const unsigned int version);
960};
961
962//! Shift data class (for SLN bond option volatilities)
963/*!
964This class holds single market points of type
965- SHIFT
966Specific data comprise
967- qualifier
968- term
969
970\ingroup marketdata
971*/
972
974public:
976 //! Constructor
978 Period term)
980 term_(term) {
981 QL_REQUIRE(quoteType == MarketDatum::QuoteType::SHIFT, "quote type must be SHIFT for shift data");
982 }
983
984 //! Make a copy of the market datum
985 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
986 return QuantLib::ext::make_shared<BondOptionShiftQuote>(quote_->value(), asofDate_, name_, quoteType_, qualifier_, term_);
987 }
988
989 //! \name Inspectors
990 //@{
991 const string& qualifier() const { return qualifier_; }
992 const Period& term() const { return term_; }
993 //@}
994private:
996 Period term_;
997 //! Serialization
999 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1000};
1001
1002//! Cap/Floor data class
1003/*!
1004 This class holds single market points of type
1005 - CAPFLOOR
1006 Specific data comprise
1007 - currency
1008 - term
1009 - underlying index tenor
1010 - at-the-money flag (is an at-the-money cap/floor quote?)
1011 - relative quotation flag (quote to be added to the at-the-money quote?)
1012 - strike
1013
1014 \ingroup marketdata
1015*/
1017public:
1019 //! Constructor
1020 CapFloorQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string ccy, Period term,
1021 Period underlying, bool atm, bool relative, Real strike = 0.0, const string& indexName = string(), bool isCap = true)
1024
1025 //! Make a copy of the market datum
1026 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1027 return QuantLib::ext::make_shared<CapFloorQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, term_,
1029 }
1030
1031 //! \name Inspectors
1032 //@{
1033 const string& ccy() const { return ccy_; }
1034 const Period& term() const { return term_; }
1035 const Period& underlying() const { return underlying_; }
1036 bool atm() const { return atm_; }
1037 bool relative() const { return relative_; }
1038 Real strike() { return strike_; }
1039 const string& indexName() const { return indexName_; }
1040 bool isCap() const { return isCap_; }
1041 //@}
1042private:
1043 string ccy_;
1044 Period term_;
1046 bool atm_;
1051 //! Serialization
1053 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1054};
1055
1056//! Shift data class (for SLN cap/floor volatilities)
1057/*! This class holds, for a given currency and index tenor, single market points of type
1058 - SHIFT
1059 \ingroup marketdata
1060*/
1062public:
1064 CapFloorShiftQuote(Real value, const Date& asofDate, const string& name, QuoteType quoteType, const string& ccy,
1065 const Period& indexTenor, const string& indexName = string())
1068 QL_REQUIRE(quoteType == MarketDatum::QuoteType::SHIFT, "Quote type must be SHIFT for shift data");
1069 }
1070
1071 //! Make a copy of the market datum
1072 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1073 return QuantLib::ext::make_shared<CapFloorShiftQuote>(quote_->value(), asofDate_, name_, quoteType_, ccy_, indexTenor_,
1074 indexName_);
1075 }
1076
1077 const string& ccy() const { return ccy_; }
1078 const Period& indexTenor() const { return indexTenor_; }
1079 const string& indexName() const { return indexName_; }
1080
1081private:
1082 string ccy_;
1085 //! Serialization
1087 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1088};
1089
1090//! Foreign exchange rate data class
1091/*!
1092 This class holds single market points of type
1093 - FX_SPOT
1094 Specific data comprise
1095 - unit currency
1096 - currency
1097
1098 The quote is then interpreted as follows:
1099
1100 1 unit of "unit currency" = quote * 1 unit of "currency"
1101
1102 \ingroup marketdata
1103*/
1104class FXSpotQuote : public MarketDatum {
1105public:
1107 //! Constructor
1108 FXSpotQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string unitCcy, string ccy)
1110
1111 //! Make a copy of the market datum
1112 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1113 return QuantLib::ext::make_shared<FXSpotQuote>(quote_->value(), asofDate_, name_, quoteType_, unitCcy_, ccy_);
1114 }
1115
1116 //! \name Inspectors
1117 //@{
1118 const string& unitCcy() const { return unitCcy_; }
1119 const string& ccy() const { return ccy_; }
1120 //@}
1121private:
1122 string unitCcy_;
1123 string ccy_;
1124 //! Serialization
1126 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1127};
1128
1129//! Foreign exchange rate data class
1130/*!
1131 This class holds single market points of type
1132 - FX_FWD
1133 Specific data comprise
1134 - unit currency
1135 - currency
1136 - term
1137 - conversion factor
1138
1139 The quote is expected in "forward points" = (FXFwd - FXSpot) / conversionFactor
1140
1141 \ingroup marketdata
1142*/
1144public:
1145 enum class FxFwdString { ON, TN, SN };
1146
1148 //! Constructor
1149 FXForwardQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string unitCcy, string ccy,
1150 const boost::variant<QuantLib::Period, FxFwdString>& term, Real conversionFactor = 1.0)
1153
1154 //! Make a copy of the market datum
1155 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1156 return QuantLib::ext::make_shared<FXForwardQuote>(quote_->value(), asofDate_, name_, quoteType_, unitCcy_, ccy_, term_, conversionFactor_);
1157 }
1158
1159 //! \name Inspectors
1160 //@{
1161 const string& unitCcy() const { return unitCcy_; }
1162 const string& ccy() const { return ccy_; }
1163 const boost::variant<QuantLib::Period, FxFwdString>& term() const { return term_; }
1164 Real conversionFactor() const { return conversionFactor_; }
1165 //@}
1166private:
1167 string unitCcy_;
1168 string ccy_;
1169 boost::variant<QuantLib::Period, FxFwdString> term_;
1171 //! Serialization
1173 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1174};
1175
1176//! FX Option data class
1177/*!
1178 This class holds single market points of type
1179 - FX_OPTION
1180 Specific data comprise
1181 - unit currency
1182 - currency
1183 - expiry
1184 - "strike" (25 delta butterfly "25BF", 25 delta risk reversal "25RR", atm straddle ATM, or individual delta put/call
1185 quotes) we do not yet support ATMF.
1186
1187 \ingroup marketdata
1188*/
1190public:
1192 //! Constructor
1193 FXOptionQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string unitCcy, string ccy,
1194 Period expiry, string strike)
1197
1199 QL_REQUIRE(s.type == Strike::Type::DeltaCall || s.type == Strike::Type::DeltaPut ||
1201 "Unsupported FXOptionQuote strike (" << strike << ")");
1202 }
1203
1204 //! Make a copy of the market datum
1205 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1206 return QuantLib::ext::make_shared<FXOptionQuote>(quote_->value(), asofDate_, name_, quoteType_, unitCcy_, ccy_, expiry_, strike_);
1207 }
1208
1209 //! \name Inspectors
1210 //@{
1211 const string& unitCcy() const { return unitCcy_; }
1212 const string& ccy() const { return ccy_; }
1213 const Period& expiry() const { return expiry_; }
1214 const string& strike() const { return strike_; }
1215 //@}
1216private:
1217 string unitCcy_;
1218 string ccy_;
1219 Period expiry_;
1220 string strike_; // TODO: either: ATM, 25RR, 25BF. Should be an enum?
1221 //! Serialization
1223 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1224};
1225
1226//! ZC Inflation swap data class
1227/*!
1228 This class holds single market points of type
1229 - ZC_INFLATIONSWAP
1230 Specific data comprise index, term.
1231
1232 \ingroup marketdata
1233 */
1235public:
1237 ZcInflationSwapQuote(Real value, Date asofDate, const string& name, const string& index, Period term)
1239 term_(term) {}
1240
1241 //! Make a copy of the market datum
1242 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1243 return QuantLib::ext::make_shared<ZcInflationSwapQuote>(quote_->value(), asofDate_, name_, index_, term_);
1244 }
1245
1246 string index() { return index_; }
1247 Period term() { return term_; }
1248
1249private:
1250 string index_;
1251 Period term_;
1252 //! Serialization
1254 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1255};
1256
1257//! Inflation Cap Floor data class
1258/*!
1259This class holds single market points of type
1260- INFLATION_CAPFLOOR
1261Specific data comprise type (can be price or nvol or slnvol),
1262index, term, cap/floor, strike
1263
1264\ingroup marketdata
1265*/
1267public:
1269 InflationCapFloorQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, const string& index,
1270 Period term, bool isCap, const string& strike, InstrumentType instrumentType)
1272 strike_(strike) {}
1273
1274 //! Make a copy of the market datum
1275 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1276 return QuantLib::ext::make_shared<InflationCapFloorQuote>(quote_->value(), asofDate_, name_, quoteType_, index_, term_, isCap_, strike_, instrumentType_);
1277 }
1278
1279 string index() { return index_; }
1280 Period term() { return term_; }
1281 bool isCap() { return isCap_; }
1282 string strike() { return strike_; }
1283
1284private:
1285 string index_;
1286 Period term_;
1288 string strike_;
1289 //! Serialization
1291 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1292};
1293
1294//! ZC Cap Floor data class
1295/*!
1296 This class holds single market points of type
1297 - ZC_INFLATION_CAPFLOOR
1298 Specific data comprise type (can be price or nvol or slnvol),
1299 index, term, cap/floor, strike
1300
1301 \ingroup marketdata
1302 */
1304public:
1306 ZcInflationCapFloorQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, const string& index,
1307 Period term, bool isCap, const string& strike)
1310
1311 //! Make a copy of the market datum
1312 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1313 return QuantLib::ext::make_shared<ZcInflationCapFloorQuote>(quote_->value(), asofDate_, name_, quoteType_, index(), term(), isCap(), strike());
1314 }
1315
1316private:
1317 //! Serialization
1319 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1320};
1321
1322//! YoY Inflation swap data class
1323/*!
1324 This class holds single market points of type
1325 - YOY_INFLATIONSWAP
1326 Specific data comprise index, term.
1327
1328 \ingroup marketdata
1329 */
1331public:
1333 YoYInflationSwapQuote(Real value, Date asofDate, const string& name, const string& index, Period term)
1335 term_(term) {}
1336
1337 //! Make a copy of the market datum
1338 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1339 return QuantLib::ext::make_shared<YoYInflationSwapQuote>(quote_->value(), asofDate_, name_, index_, term_);
1340 }
1341
1342 string index() { return index_; }
1343 Period term() { return term_; }
1344
1345private:
1346 string index_;
1347 Period term_;
1348 //! Serialization
1350 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1351};
1352
1353//! YY Cap Floor data class
1354/*!
1355This class holds single market points of type
1356- YY_INFLATION_CAPFLOOR
1357Specific data comprise type (can be price or nvol or slnvol),
1358index, term, cap/floor, strike
1359
1360\ingroup marketdata
1361*/
1363public:
1365 YyInflationCapFloorQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, const string& index,
1366 Period term, bool isCap, const string& strike)
1369
1370
1371 //! Make a copy of the market datum
1372 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1373 return QuantLib::ext::make_shared<YyInflationCapFloorQuote>(quote_->value(), asofDate_, name_, quoteType_, index(), term(), isCap(), strike());
1374 }
1375private:
1376 //! Serialization
1378 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1379};
1380
1381//! Inflation seasonality data class
1382/*!
1383 This class holds single market points of type
1384 - SEASONALITY
1385 Specific data comprise inflation index, factor type (ADD, MULT) and month (JAN to DEC).
1386
1387 \ingroup marketdata
1388 */
1390public:
1392 SeasonalityQuote(Real value, Date asofDate, const string& name, const string& index, const string& type,
1393 const string& month)
1395 month_(month) {}
1396 //! Make a copy of the market datum
1397 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1398 return QuantLib::ext::make_shared<SeasonalityQuote>(quote_->value(), asofDate_, name_, index(), type(), month());
1399 }
1400
1401 string index() { return index_; }
1402 string type() { return type_; }
1403 string month() { return month_; }
1404 QuantLib::Size applyMonth() const;
1405
1406private:
1407 string index_;
1408 string type_;
1409 string month_;
1410 //! Serialization
1412 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1413};
1414
1415//! Equity/Index spot price data class
1416/*!
1417This class holds single market points of type
1418- EQUITY_SPOT
1419Specific data comprise
1420- Equity/Index name
1421- currency
1422
1423\ingroup marketdata
1424*/
1426public:
1428 //! Constructor
1429 EquitySpotQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string equityName, string ccy)
1431
1432
1433 //! Make a copy of the market datum
1434 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1435 return QuantLib::ext::make_shared<EquitySpotQuote>(quote_->value(), asofDate_, name_, quoteType_, eqName_, ccy_);
1436 }
1437
1438 //! \name Inspectors
1439 //@{
1440 const string& eqName() const { return eqName_; }
1441 const string& ccy() const { return ccy_; }
1442 //@}
1443private:
1444 string eqName_;
1445 string ccy_;
1446 //! Serialization
1448 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1449};
1450
1451//! Equity forward data class
1452/*!
1453This class holds single market points of type
1454- EQUITY_FWD
1455Specific data comprise
1456- Equity/Index name
1457- currency
1458- expiry date
1459
1460The quote is expected as a forward price
1461
1462\ingroup marketdata
1463*/
1465public:
1467 //! Constructor
1468 EquityForwardQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string equityName,
1469 string ccy, const Date& expiryDate);
1470
1471 //! Make a copy of the market datum
1472 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1473 return QuantLib::ext::make_shared<EquityForwardQuote>(quote_->value(), asofDate_, name_, quoteType_, eqName_, ccy_, expiry_);
1474 }
1475
1476 //! \name Inspectors
1477 //@{
1478 const string& eqName() const { return eqName_; }
1479 const string& ccy() const { return ccy_; }
1480 const Date& expiryDate() const { return expiry_; }
1481 //@}
1482private:
1483 string eqName_;
1484 string ccy_;
1486 //! Serialization
1488 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1489};
1490
1491//! Equity/Index Dividend yield data class
1492/*!
1493This class holds single market points of type
1494- EQUITY_DIVIDEND
1495Specific data comprise
1496- Equity/Index name
1497- currency
1498- yield tenor date
1499
1500The quote is expected as a forward price
1501
1502\ingroup marketdata
1503*/
1505public:
1507 //! Constructor
1508 EquityDividendYieldQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string equityName,
1509 string ccy, const Date& tenorDate);
1510
1511 //! Make a copy of the market datum
1512 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1513 return QuantLib::ext::make_shared<EquityDividendYieldQuote>(quote_->value(), asofDate_, name_, quoteType_, eqName_, ccy_, tenor_);
1514 }
1515
1516 //! \name Inspectors
1517 //@{
1518 const string& eqName() const { return eqName_; }
1519 const string& ccy() const { return ccy_; }
1520 const Date& tenorDate() const { return tenor_; }
1521 //@}
1522private:
1523 string eqName_;
1524 string ccy_;
1526 //! Serialization
1528 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1529};
1530
1531//! Equity/Index Option data class
1532/*!
1533This class holds single market points of type
1534- EQUITY_OPTION
1535Specific data comprise
1536- Equity/Index name
1537- currency
1538- expiry
1539- strike - supported are:
1540 - absolute strike, e.g. 1234.5
1541 - ATM/AtmFwd (or as an alias ATMF)
1542 - MNY/[Spot/Fwd]/1.2
1543- C (call), P (put) flag, this is optional and defaults to C
1544
1545\ingroup marketdata
1546*/
1548public:
1550 //! Constructor
1551 EquityOptionQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, string equityName, string ccy,
1552 string expiry, const QuantLib::ext::shared_ptr<BaseStrike>& strike, bool isCall = true);
1553
1554
1555 //! Make a copy of the market datum
1556 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1557 return QuantLib::ext::make_shared<EquityOptionQuote>(quote_->value(), asofDate_, name_, quoteType_, eqName_, ccy_, expiry_, strike_, isCall_);
1558 }
1559
1560 //! \name Inspectors
1561 //@{
1562 const string& eqName() const { return eqName_; }
1563 const string& ccy() const { return ccy_; }
1564 const string& expiry() const { return expiry_; }
1565 const QuantLib::ext::shared_ptr<BaseStrike>& strike() const { return strike_; }
1566 bool isCall() { return isCall_; }
1567 //@}
1568private:
1569 string eqName_;
1570 string ccy_;
1571 string expiry_;
1572 QuantLib::ext::shared_ptr<BaseStrike> strike_;
1574 //! Serialization
1576 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1577};
1578
1579//! Bond spread data class
1580/*!
1581This class holds single market points of type
1582- BOND SPREAD
1583\ingroup marketdata
1584*/
1586public:
1588 //! Constructor
1589 SecuritySpreadQuote(Real value, Date asofDate, const string& name, const string& securityID)
1591
1592 //! Make a copy of the market datum
1593 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1594 return QuantLib::ext::make_shared<SecuritySpreadQuote>(quote_->value(), asofDate_, name_, securityID_);
1595 }
1596
1597 //! \name Inspectors
1598 //@{
1599 const string& securityID() const { return securityID_; }
1600 //@}
1601private:
1603 //! Serialization
1605 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1606};
1607
1608//! Base correlation data class
1609/*!
1610This class holds single market points of type
1611- CDS_INDEX BASE_CORRELATION
1612\ingroup marketdata
1613*/
1615public:
1617 //! Constructor
1618 BaseCorrelationQuote(Real value, Date asofDate, const string& name, QuoteType quoteType, const string& cdsIndexName,
1619 Period term, Real detachmentPoint)
1620 : MarketDatum(value, asofDate, name, quoteType, InstrumentType::CDS_INDEX), cdsIndexName_(cdsIndexName),
1621 term_(term), detachmentPoint_(detachmentPoint) {}
1622
1623
1624 //! Make a copy of the market datum
1625 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1626 return QuantLib::ext::make_shared<BaseCorrelationQuote>(quote_->value(), asofDate_, name_, quoteType_, cdsIndexName_, term_, detachmentPoint_);
1627 }
1628
1629 //! \name Inspectors
1630 //@{
1631 const string& cdsIndexName() const { return cdsIndexName_; }
1632 Real detachmentPoint() const { return detachmentPoint_; }
1633 Period term() const { return term_; }
1634 //@}
1635private:
1637 Period term_;
1639 //! Serialization
1641 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1642};
1643
1644//! CDS Index Option data class
1645/*! This class holds single market points of type \c INDEX_CDS_OPTION
1646 \ingroup marketdata
1647*/
1649public:
1650 //! Default constructor
1652
1653 //! Detailed constructor
1654 /*! \param value The volatility value
1655 \param asof The quote date
1656 \param name The quote name
1657 \param indexName The name of the CDS index
1658 \param expiry Expiry object defining the quote's expiry
1659 \param indexTerm The term of the underlying CDS index e.g. 3Y, 5Y, 7Y, 10Y etc. If not given, defaults to
1660 an empty string. Assumed here that the term is encoded in \c indexName.
1661 \param strike Strike object defining the quote's strike. If not given, assumed that quote is ATM.
1662 */
1663 IndexCDSOptionQuote(QuantLib::Real value, const QuantLib::Date& asof, const std::string& name,
1664 const std::string& indexName, const QuantLib::ext::shared_ptr<Expiry>& expiry,
1665 const std::string& indexTerm = "", const QuantLib::ext::shared_ptr<BaseStrike>& strike = nullptr);
1666
1667
1668 //! Make a copy of the market datum
1669 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1670 return QuantLib::ext::make_shared<IndexCDSOptionQuote>(quote_->value(), asofDate_, name_, indexName_, expiry_, indexTerm_, strike_);
1671 }
1672
1673 //! \name Inspectors
1674 //@{
1675 const std::string& indexName() const { return indexName_; }
1676 const QuantLib::ext::shared_ptr<Expiry>& expiry() const { return expiry_; }
1677 const std::string& indexTerm() const { return indexTerm_; }
1678 const QuantLib::ext::shared_ptr<BaseStrike>& strike() const { return strike_; }
1679 //@}
1680
1681private:
1682 std::string indexName_;
1683 QuantLib::ext::shared_ptr<Expiry> expiry_;
1684 std::string indexTerm_;
1685 QuantLib::ext::shared_ptr<BaseStrike> strike_;
1686
1687 //! Serialization
1689 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1690};
1691
1692//! Commodity spot quote class
1693/*! This class holds a spot price for a commodity in a given currency
1694 \ingroup marketdata
1695*/
1697public:
1699 //! Constructor
1700 CommoditySpotQuote(QuantLib::Real value, const QuantLib::Date& asofDate, const std::string& name,
1701 QuoteType quoteType, const std::string& commodityName, const std::string& quoteCurrency)
1704 QL_REQUIRE(quoteType == QuoteType::PRICE, "Commodity spot quote must be of type 'PRICE'");
1705 }
1706
1707 //! Make a copy of the market datum
1708 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1709 return QuantLib::ext::make_shared<CommoditySpotQuote>(quote_->value(), asofDate_, name_, quoteType_, commodityName_, quoteCurrency_);
1710 }
1711
1712 //! \name Inspectors
1713 //@{
1714 const std::string& commodityName() const { return commodityName_; }
1715 const std::string& quoteCurrency() const { return quoteCurrency_; }
1716 //@}
1717
1718private:
1719 std::string commodityName_;
1720 std::string quoteCurrency_;
1721 //! Serialization
1723 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1724};
1725
1726//! Commodity forward quote class
1727/*! This class holds a forward price for a commodity in a given currency
1728 \ingroup marketdata
1729*/
1731public:
1733 //! Date based commodity forward constructor
1734 CommodityForwardQuote(QuantLib::Real value, const QuantLib::Date& asofDate, const std::string& name,
1735 QuoteType quoteType, const std::string& commodityName, const std::string& quoteCurrency,
1736 const QuantLib::Date& expiryDate);
1737
1738 //! Tenor based commodity forward constructor
1739 CommodityForwardQuote(QuantLib::Real value, const QuantLib::Date& asofDate, const std::string& name,
1740 QuoteType quoteType, const std::string& commodityName, const std::string& quoteCurrency,
1741 const QuantLib::Period& tenor, boost::optional<QuantLib::Period> startTenor = boost::none);
1742
1743 //! Make a copy of the market datum
1744 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1745 if (tenorBased_) {
1746 return QuantLib::ext::make_shared<CommodityForwardQuote>(quote_->value(), asofDate_, name_, quoteType_, commodityName_, quoteCurrency_, tenor_, startTenor_);
1747 } else {
1748 return QuantLib::ext::make_shared<CommodityForwardQuote>(quote_->value(), asofDate_, name_, quoteType_, commodityName_, quoteCurrency_, expiryDate_);
1749 }
1750 }
1751
1752 //! \name Inspectors
1753 //@{
1754 const std::string& commodityName() const { return commodityName_; }
1755 const std::string& quoteCurrency() const { return quoteCurrency_; }
1756
1757 //! The commodity forward's expiry if the quote is date based
1758 const QuantLib::Date& expiryDate() const { return expiryDate_; }
1759
1760 //! The commodity forward's tenor if the quote is tenor based
1761 const QuantLib::Period& tenor() const { return tenor_; }
1762
1763 /*! The period between the as of date and the date from which the forward tenor is applied. This is generally the
1764 spot tenor which is indicated by \c boost::none but there are special cases:
1765 - overnight forward: \c startTenor will be <code>0 * Days</code> and \c tenor will be <code>1 * Days</code>
1766 - tom-next forward: \c startTenor will be <code>1 * Days</code> and \c tenor will be <code>1 * Days</code>
1767 */
1768 const boost::optional<QuantLib::Period>& startTenor() const { return startTenor_; }
1769
1770 //! Returns \c true if the forward is tenor based and \c false if forward is date based
1771 bool tenorBased() const { return tenorBased_; }
1772 //@}
1773
1774private:
1775 std::string commodityName_;
1776 std::string quoteCurrency_;
1777 QuantLib::Date expiryDate_;
1778 QuantLib::Period tenor_;
1779 boost::optional<QuantLib::Period> startTenor_;
1781 //! Serialization
1783 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1784};
1785
1786//! Commodity option data class
1787/*! This class holds single market points of type COMMODITY_OPTION
1788 \ingroup marketdata
1789*/
1791public:
1793
1794 //! Constructor
1795 /*! \param value The volatility value
1796 \param asof The quote date
1797 \param name The quote name
1798 \param quoteType The quote type, should be RATE_LNVOL
1799 \param commodityName The name of the underlying commodity
1800 \param quoteCurrency The quote currency
1801 \param expiry Expiry object defining the quote's expiry
1802 \param strike Strike object defining the quote's strike
1803 \param optionType The option type.
1804 */
1805 CommodityOptionQuote(QuantLib::Real value, const QuantLib::Date& asof, const std::string& name, QuoteType quoteType,
1806 const std::string& commodityName, const std::string& quoteCurrency,
1807 const QuantLib::ext::shared_ptr<Expiry>& expiry, const QuantLib::ext::shared_ptr<BaseStrike>& strike,
1808 QuantLib::Option::Type optionType = QuantLib::Option::Call);
1809
1810 //! Make a copy of the market datum
1811 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1812 return QuantLib::ext::make_shared<CommodityOptionQuote>(quote_->value(), asofDate_, name_,
1814 }
1815
1816 //! \name Inspectors
1817 //@{
1818 const std::string& commodityName() const { return commodityName_; }
1819 const std::string& quoteCurrency() const { return quoteCurrency_; }
1820 const QuantLib::ext::shared_ptr<Expiry>& expiry() const { return expiry_; }
1821 const QuantLib::ext::shared_ptr<BaseStrike>& strike() const { return strike_; }
1822 QuantLib::Option::Type optionType() const { return optionType_; }
1823 //@}
1824
1825private:
1826 std::string commodityName_;
1827 std::string quoteCurrency_;
1828 QuantLib::ext::shared_ptr<Expiry> expiry_;
1829 QuantLib::ext::shared_ptr<BaseStrike> strike_;
1830 QuantLib::Option::Type optionType_;
1831 //! Serialization
1833 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1834};
1835
1836//! Spread data class
1837/*! This class holds single market points of type SPREAD
1838 \ingroup marketdata
1839*/
1841public:
1843 //! Constructor
1844 /*! \param value The correlation value
1845 \param asof The quote date
1846 \param name The quote name
1847 \param quoteType The quote type, should be RATE or PRICE
1848 \param index1 The name of the first index
1849 \param index2 The name of the second index
1850 \param expiry Expiry can be a period or a date
1851 \param strike Can be underlying commodity price or ATM
1852 */
1853 CorrelationQuote(QuantLib::Real value, const QuantLib::Date& asof, const std::string& name, QuoteType quoteType,
1854 const std::string& index1, const std::string& index2, const std::string& expiry,
1855 const std::string& strike);
1856
1857 //! Make a copy of the market datum
1858 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1859 return QuantLib::ext::make_shared<CorrelationQuote>(quote_->value(), asofDate_, name_, quoteType_, index1_, index2_, expiry_, strike_);
1860 }
1861
1862 //! \name Inspectors
1863 //@{
1864 const std::string& index1() const { return index1_; }
1865 const std::string& index2() const { return index2_; }
1866 const std::string& expiry() const { return expiry_; }
1867 const std::string& strike() const { return strike_; }
1868 //@}
1869
1870private:
1871 std::string index1_;
1872 std::string index2_;
1873 std::string expiry_;
1874 std::string strike_;
1875 //! Serialization
1877 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1878};
1879
1880//! CPR data class
1881/*!
1882This class holds single market points of type
1883- CPR
1884\ingroup marketdata
1885*/
1886class CPRQuote : public MarketDatum {
1887public:
1889 //! Constructor
1890 CPRQuote(Real value, Date asofDate, const string& name, const string& securityId)
1892
1893 //! Make a copy of the market datum
1894 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1895 return QuantLib::ext::make_shared<CPRQuote>(quote_->value(), asofDate_, name_, securityID_);
1896 }
1897
1898 //! \name Inspectors
1899 //@{
1900 const string& securityID() const { return securityID_; }
1901 //@}
1902private:
1904 //! Serialization
1906 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1907};
1908
1909//! Bond Price Quote
1910/*!
1911This class holds single market points of type
1912- Price
1913\ingroup marketdata
1914*/
1916public:
1918 //! Constructor
1919 BondPriceQuote(Real value, Date asofDate, const string& name, const string& securityId)
1921
1922 //! Make a copy of the market datum
1923 QuantLib::ext::shared_ptr<MarketDatum> clone() override {
1924 return QuantLib::ext::make_shared<BondPriceQuote>(quote_->value(), asofDate_, name_, securityID_);
1925 }
1926
1927 //! \name Inspectors
1928 //@{
1929 const string& securityID() const { return securityID_; }
1930 //@}
1931private:
1933 //! Serialization
1935 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1936};
1937
1938//! Transition Probability data class
1940public:
1942 TransitionProbabilityQuote(Real value, Date asofDate, const string& name, const string& id,
1943 const string& fromRating, const string& toRating)
1946
1947 //! \name Inspectors
1948 //@{
1949 const string& id() const { return id_; }
1950 const string& fromRating() const { return fromRating_; }
1951 const string& toRating() const { return toRating_; }
1952 //@}
1953private:
1954 string id_;
1957 //! Serialization
1959 template <class Archive> void serialize(Archive& ar, const unsigned int version);
1960};
1961
1962} // namespace data
1963} // namespace ore
1964
Real value() const override
BMA Swap data class.
const Period & term() const
const Period & maturity() const
BMASwapQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, Period term, string ccy="USD", Period maturity=3 *Months)
Constructor.
const string & ccy() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
void serialize(Archive &ar, const unsigned int version)
BaseCorrelationQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, const string &cdsIndexName, Period term, Real detachmentPoint)
Constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
const string & cdsIndexName() const
Basis Swap data class.
const Period & flatTerm() const
const Period & term() const
const Period & maturity() const
const string & ccy() const
BasisSwapQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, Period flatTerm, Period term, string ccy="USD", Period maturity=3 *Months)
Constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Bond option data class.
const Period & term() const
const Period & expiry() const
const string & qualifier() const
BondOptionQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string qualifier, Period expiry, Period term)
Constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Shift data class (for SLN bond option volatilities)
const Period & term() const
BondOptionShiftQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string qualifier, Period term)
Constructor.
const string & qualifier() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
const string & securityID() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
BondPriceQuote(Real value, Date asofDate, const string &name, const string &securityId)
Constructor.
CPR data class.
CPRQuote(Real value, Date asofDate, const string &name, const string &securityId)
Constructor.
const string & securityID() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Cap/Floor data class.
CapFloorQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, Period term, Period underlying, bool atm, bool relative, Real strike=0.0, const string &indexName=string(), bool isCap=true)
Constructor.
const Period & term() const
const string & ccy() const
const Period & underlying() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
const string & indexName() const
void serialize(Archive &ar, const unsigned int version)
Shift data class (for SLN cap/floor volatilities)
const string & ccy() const
CapFloorShiftQuote(Real value, const Date &asofDate, const string &name, QuoteType quoteType, const string &ccy, const Period &indexTenor, const string &indexName=string())
const Period & indexTenor() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
const string & indexName() const
void serialize(Archive &ar, const unsigned int version)
const Period & term() const
const string & docClause() const
const string & underlyingName() const
const string & ccy() const
Real runningSpread() const
CdsQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, const string &underlyingName, const string &seniority, const string &ccy, Period term, const string &docClause="", Real runningSpread=Null< Real >())
Constructor.
const string & seniority() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Commodity forward quote class.
const QuantLib::Date & expiryDate() const
The commodity forward's expiry if the quote is date based.
const std::string & commodityName() const
const boost::optional< QuantLib::Period > & startTenor() const
const QuantLib::Period & tenor() const
The commodity forward's tenor if the quote is tenor based.
boost::optional< QuantLib::Period > startTenor_
bool tenorBased() const
Returns true if the forward is tenor based and false if forward is date based.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
const std::string & quoteCurrency() const
void serialize(Archive &ar, const unsigned int version)
Commodity option data class.
QuantLib::ext::shared_ptr< Expiry > expiry_
const QuantLib::ext::shared_ptr< Expiry > & expiry() const
QuantLib::Option::Type optionType() const
const std::string & commodityName() const
QuantLib::ext::shared_ptr< BaseStrike > strike_
const QuantLib::ext::shared_ptr< BaseStrike > & strike() const
QuantLib::Option::Type optionType_
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
const std::string & quoteCurrency() const
CommodityOptionQuote(QuantLib::Real value, const QuantLib::Date &asof, const std::string &name, QuoteType quoteType, const std::string &commodityName, const std::string &quoteCurrency, const QuantLib::ext::shared_ptr< Expiry > &expiry, const QuantLib::ext::shared_ptr< BaseStrike > &strike, QuantLib::Option::Type optionType=QuantLib::Option::Call)
Constructor.
void serialize(Archive &ar, const unsigned int version)
Commodity spot quote class.
CommoditySpotQuote(QuantLib::Real value, const QuantLib::Date &asofDate, const std::string &name, QuoteType quoteType, const std::string &commodityName, const std::string &quoteCurrency)
Constructor.
const std::string & commodityName() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
const std::string & quoteCurrency() const
void serialize(Archive &ar, const unsigned int version)
const std::string & expiry() const
const std::string & index2() const
const std::string & strike() const
CorrelationQuote(QuantLib::Real value, const QuantLib::Date &asof, const std::string &name, QuoteType quoteType, const std::string &index1, const std::string &index2, const std::string &expiry, const std::string &strike)
Constructor.
const std::string & index1() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Cross Currency Basis Swap data class.
const Period & flatTerm() const
const Period & term() const
const Period & maturity() const
const string & ccy() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
const string & flatCcy() const
CrossCcyBasisSwapQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string flatCcy, Period flatTerm, string ccy, Period term, Period maturity=3 *Months)
Constructor.
void serialize(Archive &ar, const unsigned int version)
Cross Currency Fix Float Swap quote holder.
const QuantLib::Period & floatTenor() const
CrossCcyFixFloatSwapQuote(QuantLib::Real value, const QuantLib::Date &asof, const std::string &name, QuoteType quoteType, const string &floatCurrency, const QuantLib::Period &floatTenor, const string &fixedCurrency, const QuantLib::Period &fixedTenor, const QuantLib::Period &maturity)
Constructor.
const QuantLib::Period & fixedTenor() const
const string & fixedCurrency() const
const QuantLib::Period & maturity() const
const string & floatCurrency() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Discount market data class.
const string & ccy() const
DiscountQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, Date date, Period tenor)
Constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Equity/Index Dividend yield data class.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Equity forward data class.
const string & eqName() const
const string & ccy() const
const Date & expiryDate() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Equity/Index Option data class.
const string & eqName() const
const string & ccy() const
QuantLib::ext::shared_ptr< BaseStrike > strike_
const QuantLib::ext::shared_ptr< BaseStrike > & strike() const
const string & expiry() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Equity/Index spot price data class.
const string & eqName() const
const string & ccy() const
EquitySpotQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string equityName, string ccy)
Constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
FRA market data class.
const Period & term() const
const string & ccy() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
const Period & fwdStart() const
FRAQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, Period fwdStart, Period term)
Constructor.
void serialize(Archive &ar, const unsigned int version)
Foreign exchange rate data class.
const string & ccy() const
const boost::variant< QuantLib::Period, FxFwdString > & term() const
boost::variant< QuantLib::Period, FxFwdString > term_
FXForwardQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string unitCcy, string ccy, const boost::variant< QuantLib::Period, FxFwdString > &term, Real conversionFactor=1.0)
Constructor.
const string & unitCcy() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
FX Option data class.
const string & ccy() const
const string & strike() const
const Period & expiry() const
FXOptionQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string unitCcy, string ccy, Period expiry, string strike)
Constructor.
const string & unitCcy() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Foreign exchange rate data class.
FXSpotQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string unitCcy, string ccy)
Constructor.
const string & ccy() const
const string & unitCcy() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Hazard rate data class.
const Period & term() const
const string & docClause() const
const string & underlyingName() const
const string & ccy() const
const string & seniority() const
HazardRateQuote(Real value, Date asofDate, const string &name, const string &underlyingName, const string &seniority, const string &ccy, Period term, const string &docClause="")
Constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
IMM FRA market data class.
const string & ccy() const
ImmFraQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, Size imm1, Size imm2)
Constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
const Size & imm1() const
void serialize(Archive &ar, const unsigned int version)
const Size & imm2() const
CDS Index Option data class.
IndexCDSOptionQuote()
Default constructor.
QuantLib::ext::shared_ptr< Expiry > expiry_
const QuantLib::ext::shared_ptr< Expiry > & expiry() const
const std::string & indexTerm() const
const std::string & indexName() const
QuantLib::ext::shared_ptr< BaseStrike > strike_
const QuantLib::ext::shared_ptr< BaseStrike > & strike() const
IndexCDSOptionQuote(QuantLib::Real value, const QuantLib::Date &asof, const std::string &name, const std::string &indexName, const QuantLib::ext::shared_ptr< Expiry > &expiry, const std::string &indexTerm="", const QuantLib::ext::shared_ptr< BaseStrike > &strike=nullptr)
Detailed constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Inflation Cap Floor data class.
InflationCapFloorQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, const string &index, Period term, bool isCap, const string &strike, InstrumentType instrumentType)
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Money Market Future data class.
const string & contract() const
const string & ccy() const
MMFutureQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, string expiry, string contract="", Period tenor=3 *Months)
Constructor.
Natural expiryYear() const
const string & expiry() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
const Period & tenor() const
Base market data class.
Definition: marketdatum.hpp:78
InstrumentType instrumentType() const
MarketDatum(Real value, Date asofDate, const string &name, QuoteType quoteType, InstrumentType instrumentType)
Constructor.
const Handle< Quote > & quote() const
InstrumentType instrumentType_
Handle< Quote > quote_
virtual ~MarketDatum()
Default destructor.
InstrumentType
Supported market instrument types.
Definition: marketdatum.hpp:82
virtual QuantLib::ext::shared_ptr< MarketDatum > clone()
Make a copy of the market datum.
QuoteType
Supported market quote types.
friend class boost::serialization::access
Serialization.
const string & name() const
QuoteType quoteType() const
void serialize(Archive &ar, const unsigned int version)
Money market data class.
const Period & term() const
MoneyMarketQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, Period fwdStart, Period term, const std::string &indexName="")
Constructor.
const string & ccy() const
const std::string & indexName() const
Empty if the index name is not provided.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the datum.
friend class boost::serialization::access
Serialization.
const Period & fwdStart() const
void serialize(Archive &ar, const unsigned int version)
Overnight index future data class.
const string & contract() const
const string & ccy() const
Natural expiryYear() const
OIFutureQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, string expiry, string contract="", Period tenor=3 *Months)
Constructor.
const string & expiry() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
const Period & tenor() const
Recovery rate data class.
const string & docClause() const
const string & underlyingName() const
const string & ccy() const
const string & seniority() const
RecoveryRateQuote(Real value, Date asofDate, const string &name, const string &underlyingName, const string &seniority, const string &ccy, const string &docClause="")
Constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Inflation seasonality data class.
QuantLib::Size applyMonth() const
SeasonalityQuote(Real value, Date asofDate, const string &name, const string &index, const string &type, const string &month)
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Bond spread data class.
SecuritySpreadQuote(Real value, Date asofDate, const string &name, const string &securityID)
Constructor.
const string & securityID() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Swap market data class.
const Period & term() const
const std::string & indeName() const
const string & ccy() const
const Date & maturityDate() const
const Date & startDate() const
SwapQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, Date startDate, Date maturityDate, Period tenor, const std::string &indexName="")
Constructor if startDate, maturityDate is given.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
const Period & fwdStart() const
SwapQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, Period fwdStart, Period term, Period tenor, const std::string &indexName="")
Constructor if fwdStart / tenor is given.
std::string indexName_
void serialize(Archive &ar, const unsigned int version)
const Period & tenor() const
Swaption data class.
const Period & term() const
const string & ccy() const
const Period & expiry() const
const string & dimension() const
SwaptionQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, Period expiry, Period term, string dimension, Real strike=0.0, const std::string &quoteTag=std::string(), bool isPayer=true)
Constructor.
const string & quoteTag() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Shift data class (for SLN swaption volatilities)
const Period & term() const
const string & ccy() const
const string & quoteTag() const
SwaptionShiftQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, string ccy, Period term, const std::string &quoteTag=std::string())
Constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
Transition Probability data class.
TransitionProbabilityQuote(Real value, Date asofDate, const string &name, const string &id, const string &fromRating, const string &toRating)
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
YoY Inflation swap data class.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
YoYInflationSwapQuote(Real value, Date asofDate, const string &name, const string &index, Period term)
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
YyInflationCapFloorQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, const string &index, Period term, bool isCap, const string &strike)
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
ZcInflationCapFloorQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, const string &index, Period term, bool isCap, const string &strike)
void serialize(Archive &ar, const unsigned int version)
ZC Inflation swap data class.
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
friend class boost::serialization::access
Serialization.
void serialize(Archive &ar, const unsigned int version)
ZcInflationSwapQuote(Real value, Date asofDate, const string &name, const string &index, Period term)
const string & ccy() const
Inspectors.
bool tenorBased() const
QuantLib::ext::shared_ptr< MarketDatum > clone() override
Make a copy of the market datum.
ZeroQuote(Real value, Date asofDate, const string &name, QuoteType quoteType, const string &ccy, Date date, DayCounter dayCounter, Period tenor=Period())
Constructor.
friend class boost::serialization::access
Serialization.
DayCounter dayCounter() const
void serialize(Archive &ar, const unsigned int version)
const Period & tenor() const
SafeStack< ValueType > value
Classes for representing an expiry for use in market quotes.
Strike parseStrike(const std::string &s)
Convert text to Strike.
Definition: strike.cpp:30
@ data
Definition: log.hpp:77
Classes for representing a strike using various conventions.
BOOST_CLASS_EXPORT_KEY(ore::data::MoneyMarketQuote)
bool operator<(const Dividend &d1, const Dividend &d2)
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Map text representations to QuantLib/QuantExt types.
support for QuantLib::Date serialization
support for QuantLib::DayCounter serialization
support for QuantLib::Period serialization
bool operator()(const QuantLib::ext::shared_ptr< MarketDatum > &a, const QuantLib::ext::shared_ptr< MarketDatum > &b) const
string name
strike description