Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
impliedbondspread.hpp
Go to the documentation of this file.
1/*
2Copyright (C) 2018 Quaternion Risk Management Ltd
3All rights reserved.
4
5This file is part of ORE, a free-software/open-source library
6for transparent pricing and risk analysis - http://opensourcerisk.org
7
8ORE is free software: you can redistribute it and/or modify it
9under the terms of the Modified BSD License. You should have received a
10copy of the license along with this program.
11The license is also available online at <http://opensourcerisk.org>
12
13This program is distributed on the basis that it will form a useful
14contribution to risk analytics and model standardisation, but WITHOUT
15ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file qle/instruments/impliedbondspread.hpp
20\brief utilities for implied bond credit spread calculation
21
22\ingroup instruments
23*/
24
25#ifndef quantlib_implied_bond_spread_hpp
26#define quantlib_implied_bond_spread_hpp
27
28#include <ql/instruments/bond.hpp>
29#include <ql/quotes/simplequote.hpp>
30
31namespace QuantExt {
32
33namespace detail {
34
35//! helper class for implied vanilla bond spread calculation
36/*! The passed engine must be linked to the passed quote
37
38 \note this function is meant for developers of bond
39 classes so that they can compute a fair credit spread,
40 or infer spread from quoted bond price.
41*/
43public:
44 static QuantLib::Real calculate(const QuantLib::ext::shared_ptr<QuantLib::Bond>& bond,
45 const QuantLib::ext::shared_ptr<QuantLib::PricingEngine>& engine,
46 const QuantLib::ext::shared_ptr<QuantLib::SimpleQuote>& spreadQuote,
47 QuantLib::Real targetValue,
48 bool isCleanPrice, // if false, assumes targetValue is based on dirty price
49 QuantLib::Real accuracy, QuantLib::Natural maxEvaluations, QuantLib::Real minSpread,
50 QuantLib::Real maxSpread);
51};
52} // namespace detail
53
54} // namespace QuantExt
55
56#endif
helper class for implied vanilla bond spread calculation
static QuantLib::Real calculate(const QuantLib::ext::shared_ptr< QuantLib::Bond > &bond, const QuantLib::ext::shared_ptr< QuantLib::PricingEngine > &engine, const QuantLib::ext::shared_ptr< QuantLib::SimpleQuote > &spreadQuote, QuantLib::Real targetValue, bool isCleanPrice, QuantLib::Real accuracy, QuantLib::Natural maxEvaluations, QuantLib::Real minSpread, QuantLib::Real maxSpread)