QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
deltavolquote.hpp
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
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
30namespace QuantLib {
31
33
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.
58
59 // Additional constructor, if special atm quote is used
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:
79 };
80
81}
82
83#endif
Class for the quotation of delta vs vol.
void update() override
DeltaType deltaType() const
AtmType atmType() const
Real value() const override
returns the current value
bool isValid() const override
returns true if the Quote holds a valid value
Shared handle to an observable.
Definition: handle.hpp:41
Object that gets notified when a given observable changes.
Definition: observable.hpp:116
purely virtual base class for market observables
Definition: quote.hpp:37
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35