QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
complexchooseroption.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 complexchooseroption.hpp
21 \brief Complex chooser option
22*/
23
24#ifndef quantlib_complex_chooser_option_hpp
25#define quantlib_complex_chooser_option_hpp
26
28
29namespace QuantLib{
30
31 //! Complex chooser option
32 /*! This option gives the holder the right to choose, at a future
33 date prior to exercise, whether the option should be a call or
34 a put. The exercise date and strike are different for the
35 call and put option.
36 */
38 public:
39 class arguments;
40 class engine;
41 ComplexChooserOption(Date choosingDate,
42 Real strikeCall,
43 Real strikePut,
44 const ext::shared_ptr<Exercise>& exerciseCall,
45 ext::shared_ptr<Exercise> exercisePut);
46 void setupArguments(PricingEngine::arguments*) const override;
47
48 private:
52 ext::shared_ptr<Exercise> exerciseCall_;
53 ext::shared_ptr<Exercise> exercisePut_;
54 };
55
56 //! Extra %arguments for complex chooser option
57 class ComplexChooserOption::arguments : public OneAssetOption::arguments {
58 public:
59 void validate() const override;
63 ext::shared_ptr<Exercise> exerciseCall;
64 ext::shared_ptr<Exercise> exercisePut;
65 };
66
67 //! Complex-chooser-option %engine base class
68 class ComplexChooserOption::engine : public GenericEngine<ComplexChooserOption::arguments,
69 ComplexChooserOption::results> {};
70
71}
72
73#endif
Extra arguments for complex chooser option.
Complex-chooser-option engine base class.
void setupArguments(PricingEngine::arguments *) const override
ext::shared_ptr< Exercise > exercisePut_
ext::shared_ptr< Exercise > exerciseCall_
Concrete date class.
Definition: date.hpp:125
template base class for option pricing engines
Base class for options on a single asset.
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35
Option on a single asset.