QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
caphelper.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) 2001, 2002, 2003 Sadruddin Rejeb
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 caphelper.hpp
21 \brief CapHelper calibration helper
22*/
23
24#ifndef quantlib_cap_calibration_helper_hpp
25#define quantlib_cap_calibration_helper_hpp
26
30
31namespace QuantLib {
32
33 //! calibration helper for ATM cap
34
36 public:
37 CapHelper(const Period& length,
39 ext::shared_ptr<IborIndex> index,
40 // data for ATM swap-rate calculation
41 Frequency fixedLegFrequency,
42 DayCounter fixedLegDayCounter,
43 bool includeFirstSwaplet,
44 Handle<YieldTermStructure> termStructure,
48 Real shift = 0.0);
49 void addTimesTo(std::list<Time>& times) const override;
50 Real modelValue() const override;
51 Real blackPrice(Volatility volatility) const override;
52
53 private:
54 void performCalculations() const override;
55 mutable ext::shared_ptr<Cap> cap_;
57 const ext::shared_ptr<IborIndex> index_;
62 };
63
64}
65
66#endif
Calibration helper class.
cap and floor class
liquid Black76 market instrument used during calibration
Handle< Quote > volatility() const
returns the volatility Handle
calibration helper for ATM cap
Definition: caphelper.hpp:35
void performCalculations() const override
Definition: caphelper.cpp:91
const ext::shared_ptr< IborIndex > index_
Definition: caphelper.hpp:57
const Period length_
Definition: caphelper.hpp:56
Real blackPrice(Volatility volatility) const override
Black or Bachelier price given a volatility.
Definition: caphelper.cpp:69
Real modelValue() const override
returns the price of the instrument according to the model
Definition: caphelper.cpp:63
void addTimesTo(std::list< Time > &times) const override
Definition: caphelper.cpp:51
const Frequency fixedLegFrequency_
Definition: caphelper.hpp:59
ext::shared_ptr< Cap > cap_
Definition: caphelper.hpp:55
const Handle< YieldTermStructure > termStructure_
Definition: caphelper.hpp:58
const DayCounter fixedLegDayCounter_
Definition: caphelper.hpp:60
const bool includeFirstSwaplet_
Definition: caphelper.hpp:61
day counter class
Definition: daycounter.hpp:44
Shared handle to an observable.
Definition: handle.hpp:41
Frequency
Frequency of events.
Definition: frequency.hpp:37
QL_REAL Real
real number
Definition: types.hpp:50
Real Volatility
volatility
Definition: types.hpp:78
Definition: any.hpp:35
volatility types