Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fittedbondcurvehelpermarket.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 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
20
22
24
25#include <ql/termstructures/credit/flathazardrate.hpp>
26#include <ql/termstructures/yield/flatforward.hpp>
27
28namespace ore {
29namespace data {
30
32 const std::map<std::string, Handle<YieldTermStructure>>& iborIndexCurves, const bool handlePseudoCurrencies)
33 : MarketImpl(handlePseudoCurrencies) {
34
35 QuantLib::ext::shared_ptr<Conventions> conventions = InstrumentConventions::instance().conventions();
36
37 // populate the ibor index curves
38 for (auto const& c : iborIndexCurves)
39 iborIndices_[std::make_pair(Market::defaultConfiguration, c.first)] =
40 Handle<IborIndex>(parseIborIndex(c.first, c.second));
41}
42
43Handle<YieldTermStructure> FittedBondCurveHelperMarket::yieldCurve(const string& name,
44 const string& configuration) const {
45 return Handle<YieldTermStructure>(QuantLib::ext::make_shared<FlatForward>(0, NullCalendar(), 0.0, Actual365Fixed()));
46}
47
48Handle<Quote> FittedBondCurveHelperMarket::securitySpread(const string& securityID, const string& configuration) const {
49 return Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(0.0));
50}
51
52Handle<QuantExt::CreditCurve> FittedBondCurveHelperMarket::defaultCurve(const string&,
53 const string& configuration) const {
54 return Handle<QuantExt::CreditCurve>(
55 QuantLib::ext::make_shared<QuantExt::CreditCurve>(Handle<DefaultProbabilityTermStructure>(
56 QuantLib::ext::make_shared<FlatHazardRate>(0, NullCalendar(), 0.0, Actual365Fixed()))));
57}
58
59Handle<Quote> FittedBondCurveHelperMarket::recoveryRate(const string&, const string& configuration) const {
60 return Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(0.0));
61}
62
63} // namespace data
64} // namespace ore
Handle< Quote > securitySpread(const string &securityID, const string &configuration=Market::defaultConfiguration) const override
Handle< YieldTermStructure > yieldCurve(const string &name, const string &configuration=Market::defaultConfiguration) const override
Handle< QuantExt::CreditCurve > defaultCurve(const string &, const string &configuration=Market::defaultConfiguration) const override
Handle< Quote > recoveryRate(const string &, const string &configuration=Market::defaultConfiguration) const override
FittedBondCurveHelperMarket(const std::map< std::string, Handle< YieldTermStructure > > &iborIndexCurves={}, const bool handlePseudoCurrencies=true)
static const string defaultConfiguration
Default configuration label.
Definition: market.hpp:296
Market Implementation.
Definition: marketimpl.hpp:53
map< pair< string, string >, Handle< IborIndex > > iborIndices_
Definition: marketimpl.hpp:209
A market implementation providing curves for setting up bond rate helpers.
QuantLib::ext::shared_ptr< IborIndex > parseIborIndex(const string &s, const Handle< YieldTermStructure > &h)
Convert std::string to QuantLib::IborIndex.
Map text representations to QuantLib/QuantExt types.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
string name