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 
27 #include <ql/instruments/payoffs.hpp>
28 #include <ql/instruments/oneassetoption.hpp>
29 
30 namespace QuantLib {
31 
32     class GeneralizedBlackScholesProcess;
33 
34     class HolderExtensibleOption : public OneAssetOption {
35       public:
36         class arguments;
37         class engine;
38         HolderExtensibleOption(
39                        Option::Type type,
40                        Real premium,
41                        Date secondExpiryDate,
42                        Real secondStrike,
43                        const ext::shared_ptr<StrikedTypePayoff>& payoff,
44                        const ext::shared_ptr<Exercise>& exercise);
45         void setupArguments(PricingEngine::arguments*) const;
46       protected:
47         Real premium_;
48         Date secondExpiryDate_;
49         Real secondStrike_;
50     };
51 
52     class HolderExtensibleOption::arguments : public OneAssetOption::arguments {
53       public:
54         Real premium;
55         Date secondExpiryDate;
56         Real secondStrike;
57 
58         void validate() const;
59     };
60 
61     class HolderExtensibleOption::engine
62         : public GenericEngine<HolderExtensibleOption::arguments,
63                                HolderExtensibleOption::results> {};
64 
65 }
66 
67 
68 #endif
69