QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
holderextensibleoption.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) 2014 Master IMAFA - Polytech'Nice Sophia - Université de Nice Sophia Antipolis
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 holderextensibleoption.hpp
21 \brief Holder-extensible option
22*/
23
24#ifndef quantlib_holder_extensible_option_hpp
25#define quantlib_holder_extensible_option_hpp
26
29
30namespace QuantLib {
31
32 //! Holder-extensible %option
33 /*! This option can be exercised on maturity date, or it can be
34 extended by its holder until a second maturity date by paying
35 a premium to the writer of the option. In case of extension,
36 the strike can also be changed.
37
38 \ingroup instruments
39 */
41 public:
42 class arguments;
43 class engine;
45 Option::Type type,
46 Real premium,
47 Date secondExpiryDate,
48 Real secondStrike,
49 const ext::shared_ptr<StrikedTypePayoff>& payoff,
50 const ext::shared_ptr<Exercise>& exercise);
51 void setupArguments(PricingEngine::arguments*) const override;
52
53 protected:
57 };
58
59 //! %Arguments for holder-extensible option
60 class HolderExtensibleOption::arguments : public OneAssetOption::arguments {
61 public:
65
66 void validate() const override;
67 };
68
69 //! Base class for holder-extensible option engine
71 : public GenericEngine<HolderExtensibleOption::arguments,
72 HolderExtensibleOption::results> {};
73
74}
75
76
77#endif
Concrete date class.
Definition: date.hpp:125
template base class for option pricing engines
Arguments for holder-extensible option
Base class for holder-extensible option engine.
void setupArguments(PricingEngine::arguments *) const override
Base class for options on a single asset.
ext::shared_ptr< Payoff > payoff() const
Definition: option.hpp:45
ext::shared_ptr< Exercise > exercise() const
Definition: option.hpp:46
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:37
Option on a single asset.
Payoffs for various options.