Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
bondspreadimplymarket.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
21namespace ore {
22namespace data {
23
24BondSpreadImplyMarket::BondSpreadImplyMarket(const QuantLib::ext::shared_ptr<Market>& market, const bool handlePseudoCurrencies)
25 : WrappedMarket(market, handlePseudoCurrencies) {}
26
27QuantLib::ext::shared_ptr<SimpleQuote> BondSpreadImplyMarket::spreadQuote(const string& securityID) const {
28 if (auto s = spreadQuote_.find(securityID); s != spreadQuote_.end())
29 return s->second;
30 auto q = QuantLib::ext::make_shared<SimpleQuote>(0.0);
31 spreadQuote_[securityID] = q;
32 return q;
33}
34
35Handle<Quote> BondSpreadImplyMarket::securitySpread(const string& securityID, const string& configuration) const {
36 return Handle<Quote>(spreadQuote(securityID));
37}
38
39} // namespace data
40} // namespace ore
market that can be used to imply bond spreads
std::map< std::string, QuantLib::ext::shared_ptr< SimpleQuote > > spreadQuote_
Handle< Quote > securitySpread(const string &securityID, const string &configuration=Market::defaultConfiguration) const override
BondSpreadImplyMarket(const QuantLib::ext::shared_ptr< Market > &market, const bool handlePseudoCurrencies=true)
QuantLib::ext::shared_ptr< SimpleQuote > spreadQuote(const string &securityID) const
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23