QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
pricingengines
capfloor
blackcapfloorengine.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) 2007 Ferdinando Ametrano
5
Copyright (C) 2001, 2002, 2003 Sadruddin Rejeb
6
Copyright (C) 2006 StatPro Italia srl
7
8
This file is part of QuantLib, a free-software/open-source library
9
for financial quantitative analysts and developers - http://quantlib.org/
10
11
QuantLib is free software: you can redistribute it and/or modify it
12
under the terms of the QuantLib license. You should have received a
13
copy of the license along with this program; if not, please email
14
<quantlib-dev@lists.sf.net>. The license is also available online at
15
<http://quantlib.org/license.shtml>.
16
17
This program is distributed in the hope that it will be useful, but WITHOUT
18
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19
FOR A PARTICULAR PURPOSE. See the license for more details.
20
*/
21
22
/*! \file blackcapfloorengine.hpp
23
\brief Black-formula cap/floor engine
24
*/
25
26
#ifndef quantlib_pricers_black_capfloor_hpp
27
#define quantlib_pricers_black_capfloor_hpp
28
29
#include <
ql/instruments/capfloor.hpp
>
30
#include <
ql/termstructures/volatility/optionlet/optionletvolatilitystructure.hpp
>
31
32
namespace
QuantLib
{
33
34
class
Quote;
35
36
//! Black-formula cap/floor engine
37
/*! \ingroup capfloorengines */
38
class
BlackCapFloorEngine
:
public
CapFloor::engine
{
39
public
:
40
BlackCapFloorEngine
(
Handle<YieldTermStructure>
discountCurve,
41
Volatility
vol,
42
const
DayCounter
& dc =
Actual365Fixed
(),
43
Real
displacement
= 0.0);
44
BlackCapFloorEngine
(
Handle<YieldTermStructure>
discountCurve,
45
const
Handle<Quote>
& vol,
46
const
DayCounter
& dc =
Actual365Fixed
(),
47
Real
displacement
= 0.0);
48
BlackCapFloorEngine
(
Handle<YieldTermStructure>
discountCurve,
49
Handle<OptionletVolatilityStructure>
vol,
50
Real
displacement
=
Null<Real>
());
51
void
calculate
()
const override
;
52
Handle<YieldTermStructure>
termStructure
() {
return
discountCurve_
; }
53
Handle<OptionletVolatilityStructure>
volatility
() {
return
vol_
; }
54
Real
displacement
()
const
{
return
displacement_
; }
55
56
private
:
57
Handle<YieldTermStructure>
discountCurve_
;
58
Handle<OptionletVolatilityStructure>
vol_
;
59
Real
displacement_
;
60
};
61
62
}
63
64
#endif
capfloor.hpp
cap and floor class
QuantLib::Actual365Fixed
Actual/365 (Fixed) day count convention.
Definition:
actual365fixed.hpp:45
QuantLib::BlackCapFloorEngine
Black-formula cap/floor engine.
Definition:
blackcapfloorengine.hpp:38
QuantLib::BlackCapFloorEngine::discountCurve_
Handle< YieldTermStructure > discountCurve_
Definition:
blackcapfloorengine.hpp:57
QuantLib::BlackCapFloorEngine::volatility
Handle< OptionletVolatilityStructure > volatility()
Definition:
blackcapfloorengine.hpp:53
QuantLib::BlackCapFloorEngine::displacement
Real displacement() const
Definition:
blackcapfloorengine.hpp:54
QuantLib::BlackCapFloorEngine::calculate
void calculate() const override
Definition:
blackcapfloorengine.cpp:77
QuantLib::BlackCapFloorEngine::displacement_
Real displacement_
Definition:
blackcapfloorengine.hpp:59
QuantLib::BlackCapFloorEngine::vol_
Handle< OptionletVolatilityStructure > vol_
Definition:
blackcapfloorengine.hpp:58
QuantLib::BlackCapFloorEngine::termStructure
Handle< YieldTermStructure > termStructure()
Definition:
blackcapfloorengine.hpp:52
QuantLib::CapFloor::engine
base class for cap/floor engines
Definition:
capfloor.hpp:158
QuantLib::DayCounter
day counter class
Definition:
daycounter.hpp:44
QuantLib::Handle
Shared handle to an observable.
Definition:
handle.hpp:41
QuantLib::Null
template class providing a null value for a given type.
Definition:
null.hpp:76
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
QuantLib::Volatility
Real Volatility
volatility
Definition:
types.hpp:78
QuantLib
Definition:
any.hpp:35
optionletvolatilitystructure.hpp
optionlet (caplet/floorlet) volatility structure
Generated by
Doxygen
1.9.5