Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
bondspreadimply.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 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 marketdata/bondspreadimply.hpp
20 \brief bond spread imply utility
21 \ingroup marketdata
22*/
23
24#pragma once
25
27
31
32namespace ore {
33namespace data {
34
36public:
37 /*! Determine the securities that require a spread imply and return a map securityID => security containing them.
38 If excludeRegex is non-empty security ids that match excludeRegex are excluded from the returned list. */
39 static std::map<std::string, QuantLib::ext::shared_ptr<Security>>
40 requiredSecurities(const Date& asof, const QuantLib::ext::shared_ptr<TodaysMarketParameters>& params,
41 const QuantLib::ext::shared_ptr<CurveConfigurations>& curveConfigs, const Loader& loader,
42 const bool continueOnError = false, const std::string& excludeRegex = std::string());
43
44 /*! Imply bond spreads and add them to the loader. */
45 static QuantLib::ext::shared_ptr<Loader>
46 implyBondSpreads(const std::map<std::string, QuantLib::ext::shared_ptr<Security>>& securities,
47 const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager,
48 const QuantLib::ext::shared_ptr<Market>& market, const QuantLib::ext::shared_ptr<EngineData>& engineData,
49 const std::string& configuration, const IborFallbackConfig& iborFallbackConfig);
50
51private:
52 //! helper function that computes a single implied spread for a bond
53 static Real implySpread(const std::string& securityId, const Real cleanPrice,
54 const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager,
55 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
56 const QuantLib::ext::shared_ptr<SimpleQuote>& spreadQuote, const std::string& configuration);
57};
58
59} // namespace data
60} // namespace ore
static QuantLib::ext::shared_ptr< Loader > implyBondSpreads(const std::map< std::string, QuantLib::ext::shared_ptr< Security > > &securities, const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager, const QuantLib::ext::shared_ptr< Market > &market, const QuantLib::ext::shared_ptr< EngineData > &engineData, const std::string &configuration, const IborFallbackConfig &iborFallbackConfig)
static Real implySpread(const std::string &securityId, const Real cleanPrice, const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::ext::shared_ptr< SimpleQuote > &spreadQuote, const std::string &configuration)
helper function that computes a single implied spread for a bond
static std::map< std::string, QuantLib::ext::shared_ptr< Security > > requiredSecurities(const Date &asof, const QuantLib::ext::shared_ptr< TodaysMarketParameters > &params, const QuantLib::ext::shared_ptr< CurveConfigurations > &curveConfigs, const Loader &loader, const bool continueOnError=false, const std::string &excludeRegex=std::string())
Market data loader base class.
Definition: loader.hpp:47
Pricing Engine Factory.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Reference data model and serialization.
A wrapper class for holding Bond Spread quotes.
vector< string > curveConfigs
An concrete implementation of the Market class that loads todays market and builds the required curve...