Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
qle
instruments
varianceswap.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2019 Quaternion Risk Management Ltd
3
All rights reserved.
4
5
This file is part of ORE, a free-software/open-source library
6
for transparent pricing and risk analysis - http://opensourcerisk.org
7
8
ORE is free software: you can redistribute it and/or modify it
9
under the terms of the Modified BSD License. You should have received a
10
copy of the license along with this program.
11
The license is also available online at <http://opensourcerisk.org>
12
13
This program is distributed on the basis that it will form a useful
14
contribution to risk analytics and model standardisation, but WITHOUT
15
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17
*/
18
19
/*! \file qle/instruments/varianceswap.hpp
20
\brief Variance swap
21
*/
22
23
#pragma once
24
25
#include <ql/instruments/varianceswap.hpp>
26
#include <ql/time/calendars/nullcalendar.hpp>
27
28
namespace
QuantExt
{
29
using namespace
QuantLib
;
30
31
//! Variance swap
32
/*! \warning This class does not manage seasoned variance swaps.
33
34
\ingroup instruments
35
*/
36
class
VarianceSwap2
:
public
QuantLib::VarianceSwap {
37
public
:
38
class
arguments
;
39
class
results
;
40
class
engine
;
41
VarianceSwap2
(Position::Type position, Real strike, Real notional,
const
Date& startDate,
const
Date& maturityDate,
42
const
Calendar&
calendar
,
bool
addPastDividends
);
43
//! \name Additional interface
44
//@{
45
// inspectors
46
Calendar
calendar
()
const
;
47
bool
addPastDividends
()
const
;
48
//@}
49
// other
50
void
setupArguments
(
PricingEngine::arguments
* args)
const override
;
51
52
protected
:
53
// data members
54
Calendar
calendar_
;
55
bool
addPastDividends_
;
56
};
57
58
//! %Arguments for forward fair-variance calculation
59
class
VarianceSwap2::arguments
:
public
virtual
QuantLib::VarianceSwap::arguments
{
60
public
:
61
arguments
() :
calendar
(NullCalendar()),
addPastDividends
(false) {}
62
Calendar
calendar
;
63
bool
addPastDividends
;
64
};
65
66
//! %Results from variance-swap calculation
67
class
VarianceSwap2::results
:
public
QuantLib::VarianceSwap::results
{};
68
69
//! base class for variance-swap engines
70
class
VarianceSwap2::engine
:
public
GenericEngine<QuantExt::VarianceSwap2::arguments, QuantExt::VarianceSwap2::results> {
71
};
72
73
// inline definitions
74
75
inline
Calendar
VarianceSwap2::calendar
()
const
{
return
calendar_
; }
76
77
inline
bool
VarianceSwap2::addPastDividends
()
const
{
return
addPastDividends_
; }
78
79
}
// namespace QuantExt
QuantExt::VarianceSwap2::arguments
Arguments for forward fair-variance calculation
Definition:
varianceswap.hpp:59
QuantExt::VarianceSwap2::arguments::addPastDividends
bool addPastDividends
Definition:
varianceswap.hpp:63
QuantExt::VarianceSwap2::arguments::arguments
arguments()
Definition:
varianceswap.hpp:61
QuantExt::VarianceSwap2::arguments::calendar
Calendar calendar
Definition:
varianceswap.hpp:62
QuantExt::VarianceSwap2::engine
base class for variance-swap engines
Definition:
varianceswap.hpp:70
QuantExt::VarianceSwap2::results
Results from variance-swap calculation
Definition:
varianceswap.hpp:67
QuantExt::VarianceSwap2
Variance swap.
Definition:
varianceswap.hpp:36
QuantExt::VarianceSwap2::calendar_
Calendar calendar_
Definition:
varianceswap.hpp:54
QuantExt::VarianceSwap2::calendar
Calendar calendar() const
Definition:
varianceswap.hpp:75
QuantExt::VarianceSwap2::setupArguments
void setupArguments(PricingEngine::arguments *args) const override
Definition:
varianceswap.cpp:28
QuantExt::VarianceSwap2::addPastDividends
bool addPastDividends() const
Definition:
varianceswap.hpp:77
QuantExt::VarianceSwap2::addPastDividends_
bool addPastDividends_
Definition:
varianceswap.hpp:55
QuantLib::PricingEngine::arguments
QuantLib::VarianceSwap::arguments
QuantLib::VarianceSwap::results
QuantExt
Definition:
namespaces.docs:19
QuantLib
Definition:
colombia.cpp:21
Generated by
Doxygen
1.9.5