Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
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
28namespace QuantExt {
29using namespace QuantLib;
30
31//! Variance swap
32/*! \warning This class does not manage seasoned variance swaps.
33
34 \ingroup instruments
35*/
36class VarianceSwap2 : public QuantLib::VarianceSwap {
37public:
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
52protected:
53 // data members
54 Calendar calendar_;
56};
57
58//! %Arguments for forward fair-variance calculation
60public:
61 arguments() : calendar(NullCalendar()), addPastDividends(false) {}
62 Calendar calendar;
64};
65
66//! %Results from variance-swap calculation
68
69//! base class for variance-swap engines
70class VarianceSwap2::engine : public GenericEngine<QuantExt::VarianceSwap2::arguments, QuantExt::VarianceSwap2::results> {
71};
72
73// inline definitions
74
75inline Calendar VarianceSwap2::calendar() const { return calendar_; }
76
78
79} // namespace QuantExt
Arguments for forward fair-variance calculation
base class for variance-swap engines
Results from variance-swap calculation
Calendar calendar() const
void setupArguments(PricingEngine::arguments *args) const override
bool addPastDividends() const