QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
gaussian1dsmilesection.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) 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
20/*! \file gaussian1dsmilesection.hpp
21 \brief smile section generated by a gaussian 1d model
22*/
23
24#ifndef quantlib_gaussian1dsmilesection_hpp
25#define quantlib_gaussian1dsmilesection_hpp
26
33
34namespace QuantLib {
35
36/*! smile section based on a gaussian 1d model instance
37 if curves are attached to the swap or ibor index, these are used to adjust
38 the model's yield term structure, if not the model's yield term structure
39 is used directly */
40
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
basic interface for one factor interest rate models
#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
base class for Inter-Bank-Offered-Rate indexes
Definition: any.hpp:35
Smile section base class.
swap-rate indexes