QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
varianceoption.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 StatPro Italia srl
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_variance_option_hpp
25#define quantlib_variance_option_hpp
26
27#include <ql/processes/blackscholesprocess.hpp>
28#include <ql/instruments/payoffs.hpp>
29#include <ql/option.hpp>
30#include <ql/position.hpp>
31
32namespace QuantLib {
33
35
39 class VarianceOption : public Instrument {
40 public:
41 class arguments;
42 class results;
43 class engine;
44 VarianceOption(ext::shared_ptr<Payoff> payoff,
46 const Date& startDate,
47 const Date& maturityDate);
49
50 bool isExpired() const override;
52
54 Date startDate() const;
55 Date maturityDate() const;
56 Real notional() const;
57 ext::shared_ptr<Payoff> payoff() const;
59 void setupArguments(PricingEngine::arguments* args) const override;
60
61 protected:
62 // data members
63 ext::shared_ptr<Payoff> payoff_;
66 };
67
68
71 public:
73 void validate() const override;
74 ext::shared_ptr<Payoff> payoff;
78 };
79
80
83
86 public GenericEngine<VarianceOption::arguments,
87 VarianceOption::results> {};
88
89
90 // inline definitions
91
93 return startDate_;
94 }
95
97 return maturityDate_;
98 }
99
101 return notional_;
102 }
103
104 inline ext::shared_ptr<Payoff> VarianceOption::payoff() const {
105 return payoff_;
106 }
107
108}
109
110
111#endif
Concrete date class.
Definition: date.hpp:125
template base class for option pricing engines
Abstract instrument class.
Definition: instrument.hpp:44
template class providing a null value for a given type.
Definition: null.hpp:76
Arguments for forward fair-variance calculation
ext::shared_ptr< Payoff > payoff
base class for variance-option engines
Results from variance-option calculation
bool isExpired() const override
returns whether the instrument might have value greater than zero.
ext::shared_ptr< Payoff > payoff_
ext::shared_ptr< Payoff > payoff() const
void setupArguments(PricingEngine::arguments *args) const override
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35