QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
atmsmilesection.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) 2013 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 atmsmilesection.hpp
21 \brief smile section that allows for explicit / alternate specification of
22 atm level
23*/
24
25#ifndef quantlib_atm_smile_section_hpp
26#define quantlib_atm_smile_section_hpp
27
29
30namespace QuantLib {
31
33
34 public:
35 AtmSmileSection(const ext::shared_ptr<SmileSection>& source, Real atm = Null<Real>());
36
37 Real minStrike() const override { return source_->minStrike(); }
38 Real maxStrike() const override { return source_->maxStrike(); }
39 Real atmLevel() const override { return f_; }
40 const Date& exerciseDate() const override { return source_->exerciseDate(); }
41 Time exerciseTime() const override { return source_->exerciseTime(); }
42 const DayCounter& dayCounter() const override { return source_->dayCounter(); }
43 const Date& referenceDate() const override { return source_->referenceDate(); }
44 VolatilityType volatilityType() const override { return source_->volatilityType(); }
45 Rate shift() const override { return source_->shift(); }
46
47 protected:
48 Volatility volatilityImpl(Rate strike) const override {
49 return source_->volatility(strike);
50 }
51 Real varianceImpl(Rate strike) const override { return source_->variance(strike); }
52
53 private:
54 ext::shared_ptr<SmileSection> source_;
56 };
57}
58
59#endif
Real atmLevel() const override
Time exerciseTime() const override
const Date & exerciseDate() const override
const Date & referenceDate() const override
Real minStrike() const override
VolatilityType volatilityType() const override
ext::shared_ptr< SmileSection > source_
Volatility volatilityImpl(Rate strike) const override
Real varianceImpl(Rate strike) const override
const DayCounter & dayCounter() const override
Real maxStrike() const override
Rate shift() const override
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
template class providing a null value for a given type.
Definition: null.hpp:76
interest rate volatility smile section
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real Volatility
volatility
Definition: types.hpp:78
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35
Smile section base class.