QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
blackcallablebondengine.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 Allen Kuo
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file blackcallablebondengine.hpp
21 \brief Black-formula callable bond engines
22*/
23
24#ifndef quantlib_black_callable_bond_engine_hpp
25#define quantlib_black_callable_bond_engine_hpp
26
29
30namespace QuantLib {
31
32 //! Black-formula callable fixed rate bond engine
33 /*! Callable fixed rate bond Black engine. The embedded (European)
34 option follows the Black "European bond option" treatment in
35 Hull, Fourth Edition, Chapter 20.
36
37 \todo set additionalResults (e.g. vega, fairStrike, etc.)
38
39 \warning This class has yet to be tested
40
41 \ingroup bondengines
42 */
44 : public CallableFixedRateBond::engine {
45 public:
46 //! volatility is the quoted fwd yield volatility, not price vol
48 Handle<YieldTermStructure> discountCurve);
49 //! volatility is the quoted fwd yield volatility, not price vol
51 Handle<YieldTermStructure> discountCurve);
52 void calculate() const override;
53
54 private:
57 // present value of all coupons paid during the life of option
58 Real spotIncome() const;
59 // converts the yield volatility into a forward price volatility
61 };
62
63
64 //! Black-formula callable zero coupon bond engine
65 /*! Callable zero coupon bond, where the embedded (European)
66 option price is assumed to obey the Black formula. Follows
67 "European bond option" treatment in Hull, Fourth Edition,
68 Chapter 20.
69
70 \warning This class has yet to be tested.
71
72 \ingroup bondengines
73 */
76 public:
77 //! volatility is the quoted fwd yield volatility, not price vol
79 const Handle<Quote>& fwdYieldVol,
80 const Handle<YieldTermStructure>& discountCurve)
81 : BlackCallableFixedRateBondEngine(fwdYieldVol, discountCurve) {}
82
83 //! volatility is the quoted fwd yield volatility, not price vol
85 const Handle<CallableBondVolatilityStructure>& yieldVolStructure,
86 const Handle<YieldTermStructure>& discountCurve)
87 : BlackCallableFixedRateBondEngine(yieldVolStructure, discountCurve) {}
88 };
89
90}
91
92
93#endif
callable bond classes
Callable-bond volatility structure.
Black-formula callable fixed rate bond engine.
Handle< CallableBondVolatilityStructure > volatility_
Black-formula callable zero coupon bond engine.
BlackCallableZeroCouponBondEngine(const Handle< CallableBondVolatilityStructure > &yieldVolStructure, const Handle< YieldTermStructure > &discountCurve)
volatility is the quoted fwd yield volatility, not price vol
BlackCallableZeroCouponBondEngine(const Handle< Quote > &fwdYieldVol, const Handle< YieldTermStructure > &discountCurve)
volatility is the quoted fwd yield volatility, not price vol
Shared handle to an observable.
Definition: handle.hpp:41
QL_REAL Real
real number
Definition: types.hpp:50
Real Volatility
volatility
Definition: types.hpp:78
Definition: any.hpp:35