QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
experimental
fx
deltavolquote.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) 2010 Dimitri Reiswich
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 deltavolquote.hpp
21
\brief Class for the quotation of delta vs vol.
22
*/
23
24
#ifndef quantlib_delta_vol_quote_hpp
25
#define quantlib_delta_vol_quote_hpp
26
27
#include <
ql/quote.hpp
>
28
#include <
ql/handle.hpp
>
29
30
namespace
QuantLib
{
31
32
//! Class for the quotation of delta vs vol.
33
/*! It includes the various delta quotation types
34
in FX markets as well as ATM types.
35
*/
36
class
DeltaVolQuote
:
public
Quote
,
37
public
Observer
{
38
public
:
39
enum
DeltaType
{
40
Spot
,
// Spot Delta, e.g. usual Black Scholes delta
41
Fwd
,
// Forward Delta
42
PaSpot
,
// Premium Adjusted Spot Delta
43
PaFwd
// Premium Adjusted Forward Delta
44
};
45
46
enum
AtmType
{
47
AtmNull
,
// Default, if not an atm quote
48
AtmSpot
,
// K=S_0
49
AtmFwd
,
// K=F
50
AtmDeltaNeutral
,
// Call Delta = Put Delta
51
AtmVegaMax
,
// K such that Vega is Maximum
52
AtmGammaMax
,
// K such that Gamma is Maximum
53
AtmPutCall50
// K such that Call Delta=0.50 (only for Fwd Delta)
54
};
55
56
// Standard constructor delta vs vol.
57
DeltaVolQuote
(
Real
delta
,
Handle<Quote>
vol,
Time
maturity
,
DeltaType
deltaType
);
58
59
// Additional constructor, if special atm quote is used
60
DeltaVolQuote
(
Handle<Quote>
vol,
DeltaType
deltaType
,
Time
maturity
,
AtmType
atmType
);
61
62
void
update
()
override
;
63
64
Real
value
()
const override
;
65
Real
delta
()
const
;
66
Time
maturity
()
const
;
67
68
AtmType
atmType
()
const
;
69
DeltaType
deltaType
()
const
;
70
71
bool
isValid
()
const override
;
72
73
private
:
74
Real
delta_
;
75
Handle<Quote>
vol_
;
76
DeltaType
deltaType_
;
77
Time
maturity_
;
78
AtmType
atmType_
;
79
};
80
81
}
82
83
#endif
QuantLib::DeltaVolQuote
Class for the quotation of delta vs vol.
Definition:
deltavolquote.hpp:37
QuantLib::DeltaVolQuote::delta_
Real delta_
Definition:
deltavolquote.hpp:74
QuantLib::DeltaVolQuote::AtmType
AtmType
Definition:
deltavolquote.hpp:46
QuantLib::DeltaVolQuote::AtmSpot
@ AtmSpot
Definition:
deltavolquote.hpp:48
QuantLib::DeltaVolQuote::AtmPutCall50
@ AtmPutCall50
Definition:
deltavolquote.hpp:53
QuantLib::DeltaVolQuote::AtmFwd
@ AtmFwd
Definition:
deltavolquote.hpp:49
QuantLib::DeltaVolQuote::AtmVegaMax
@ AtmVegaMax
Definition:
deltavolquote.hpp:51
QuantLib::DeltaVolQuote::AtmNull
@ AtmNull
Definition:
deltavolquote.hpp:47
QuantLib::DeltaVolQuote::AtmDeltaNeutral
@ AtmDeltaNeutral
Definition:
deltavolquote.hpp:50
QuantLib::DeltaVolQuote::AtmGammaMax
@ AtmGammaMax
Definition:
deltavolquote.hpp:52
QuantLib::DeltaVolQuote::delta
Real delta() const
Definition:
deltavolquote.cpp:45
QuantLib::DeltaVolQuote::update
void update() override
Definition:
deltavolquote.cpp:57
QuantLib::DeltaVolQuote::atmType_
AtmType atmType_
Definition:
deltavolquote.hpp:78
QuantLib::DeltaVolQuote::DeltaType
DeltaType
Definition:
deltavolquote.hpp:39
QuantLib::DeltaVolQuote::Spot
@ Spot
Definition:
deltavolquote.hpp:40
QuantLib::DeltaVolQuote::PaFwd
@ PaFwd
Definition:
deltavolquote.hpp:43
QuantLib::DeltaVolQuote::Fwd
@ Fwd
Definition:
deltavolquote.hpp:41
QuantLib::DeltaVolQuote::PaSpot
@ PaSpot
Definition:
deltavolquote.hpp:42
QuantLib::DeltaVolQuote::vol_
Handle< Quote > vol_
Definition:
deltavolquote.hpp:75
QuantLib::DeltaVolQuote::maturity
Time maturity() const
Definition:
deltavolquote.cpp:49
QuantLib::DeltaVolQuote::deltaType
DeltaType deltaType() const
Definition:
deltavolquote.cpp:65
QuantLib::DeltaVolQuote::maturity_
Time maturity_
Definition:
deltavolquote.hpp:77
QuantLib::DeltaVolQuote::atmType
AtmType atmType() const
Definition:
deltavolquote.cpp:61
QuantLib::DeltaVolQuote::value
Real value() const override
returns the current value
Definition:
deltavolquote.cpp:41
QuantLib::DeltaVolQuote::deltaType_
DeltaType deltaType_
Definition:
deltavolquote.hpp:76
QuantLib::DeltaVolQuote::isValid
bool isValid() const override
returns true if the Quote holds a valid value
Definition:
deltavolquote.cpp:53
QuantLib::Handle
Shared handle to an observable.
Definition:
handle.hpp:41
QuantLib::Observer
Object that gets notified when a given observable changes.
Definition:
observable.hpp:116
QuantLib::Quote
purely virtual base class for market observables
Definition:
quote.hpp:37
QuantLib::Time
Real Time
continuous quantity with 1-year units
Definition:
types.hpp:62
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
handle.hpp
Globally accessible relinkable pointer.
QuantLib
Definition:
any.hpp:35
quote.hpp
purely virtual base class for market observables
Generated by
Doxygen
1.9.5