QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
gaussian1dsmilesection.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2015 Peter Caspers
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
24#ifndef quantlib_gaussian1dsmilesection_hpp
25#define quantlib_gaussian1dsmilesection_hpp
26
27#include <ql/termstructures/volatility/smilesection.hpp>
28#include <ql/indexes/swapindex.hpp>
29#include <ql/indexes/iborindex.hpp>
30#include <ql/models/shortrate/onefactormodels/gaussian1dmodel.hpp>
31#include <ql/pricingengines/swaption/gaussian1dswaptionengine.hpp>
32#include <ql/pricingengines/capfloor/gaussian1dcapfloorengine.hpp>
33
34namespace QuantLib {
35
42 public:
43 Gaussian1dSmileSection(const Date& fixingDate,
44 ext::shared_ptr<SwapIndex> swapIndex,
45 const ext::shared_ptr<Gaussian1dModel>& model,
46 const DayCounter& dc,
47 const ext::shared_ptr<Gaussian1dSwaptionEngine>& swaptionEngine =
48 ext::shared_ptr<Gaussian1dSwaptionEngine>());
49 Gaussian1dSmileSection(const Date& fixingDate,
50 ext::shared_ptr<IborIndex> swapIndex,
51 const ext::shared_ptr<Gaussian1dModel>& model,
52 const DayCounter& dc,
53 const ext::shared_ptr<Gaussian1dCapFloorEngine>& capEngine =
54 ext::shared_ptr<Gaussian1dCapFloorEngine>());
55
56 // the minimum strike is zero only because we are
57 // returning a lognormal section
58 Real minStrike() const override { return 0.0; }
59 Real maxStrike() const override { return QL_MAX_REAL; }
60
61 Real atmLevel() const override;
62 Real optionPrice(Rate strike, Option::Type = Option::Call, Real discount = 1.0) const override;
63
64 protected:
65 Real volatilityImpl(Rate strike) const override;
66
67 private:
70 ext::shared_ptr<SwapIndex> swapIndex_;
71 ext::shared_ptr<IborIndex> iborIndex_;
72 ext::shared_ptr<Gaussian1dModel> model_;
73 ext::shared_ptr<PricingEngine> engine_;
74};
75}
76
77#endif
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
ext::shared_ptr< IborIndex > iborIndex_
ext::shared_ptr< SwapIndex > swapIndex_
ext::shared_ptr< PricingEngine > engine_
ext::shared_ptr< Gaussian1dModel > model_
Real optionPrice(Rate strike, Option::Type=Option::Call, Real discount=1.0) const override
Real volatilityImpl(Rate strike) const override
interest rate volatility smile section
#define QL_MAX_REAL
Definition: qldefines.hpp:176
QL_REAL Real
real number
Definition: types.hpp:50
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35