Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
marketdatumparser.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/marketdatumparser.hpp
20 \brief Market Datum parser
21 \ingroup marketdata
22*/
23
24#pragma once
25
27#include <ql/time/calendar.hpp>
28#include <ql/time/calendars/weekendsonly.hpp>
29#include <ql/time/date.hpp>
30#include <ql/types.hpp>
31#include <string>
32
33namespace ore {
34namespace data {
35using QuantLib::Date;
36using QuantLib::Real;
37using std::string;
38
39//! Function to parse a market datum
40/*! \ingroup marketdata
41 */
42QuantLib::ext::shared_ptr<MarketDatum> parseMarketDatum(const Date&, const string&, const Real&);
43
44//! Get a date from a date string or period
45/*! \ingroup marketdata
46 */
47Date getDateFromDateOrPeriod(const string& token, Date asof, QuantLib::Calendar cal = QuantLib::WeekendsOnly(),
48 QuantLib::BusinessDayConvention bdc = QuantLib::BusinessDayConvention::Following);
49
50//! Convert text to QuantLib::Period of Fx forward string
51/*!
52 \ingroup marketdata
53 */
54boost::variant<QuantLib::Period, FXForwardQuote::FxFwdString> parseFxPeriod(const string& s);
55
56
57QuantLib::Period fxFwdQuoteTenor(const boost::variant<QuantLib::Period, FXForwardQuote::FxFwdString>& term);
58
59
60QuantLib::Period fxFwdQuoteStartTenor(const boost::variant<QuantLib::Period, FXForwardQuote::FxFwdString>& term,
61 const QuantLib::ext::shared_ptr<FXConvention>& fxConvention = nullptr);
62
63bool matchFxFwdStringTerm(const boost::variant<QuantLib::Period, FXForwardQuote::FxFwdString>& term,
64 const FXForwardQuote::FxFwdString& fxfwdString);
65
66} // namespace data
67} // namespace ore
QuantLib::ext::shared_ptr< MarketDatum > parseMarketDatum(const Date &asof, const string &datumName, const Real &value)
Function to parse a market datum.
Date getDateFromDateOrPeriod(const string &token, Date asof, QuantLib::Calendar cal, QuantLib::BusinessDayConvention bdc)
Get a date from a date string or period.
boost::variant< QuantLib::Period, FXForwardQuote::FxFwdString > parseFxPeriod(const string &s)
Convert text to QuantLib::Period of Fx forward string.
@ data
Definition: log.hpp:77
Market data representation.
QuantLib::ext::shared_ptr< FXConvention > fxConvention
bool matchFxFwdStringTerm(const boost::variant< QuantLib::Period, FXForwardQuote::FxFwdString > &term, const FXForwardQuote::FxFwdString &fxfwdString)
QuantLib::Period fxFwdQuoteStartTenor(const boost::variant< QuantLib::Period, FXForwardQuote::FxFwdString > &term, const QuantLib::ext::shared_ptr< FXConvention > &fxConvention)
QuantLib::Period fxFwdQuoteTenor(const boost::variant< QuantLib::Period, FXForwardQuote::FxFwdString > &term)
Serializable Credit Default Swap.
Definition: namespaces.docs:23