QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
partialtimebarrieroption.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 partialtimebarrieroption.hpp
21 \brief Partial-time barrier option
22*/
23
24#ifndef quantlib_partial_time_barrier_option_hpp
25#define quantlib_partial_time_barrier_option_hpp
26
30
31namespace QuantLib {
32
33 class GeneralizedBlackScholesProcess;
34
35 //! choice of time range for partial-time barrier options
37 enum Range { Start = 0, /*!< Monitor the barrier from the
38 start of the option lifetime
39 until the so-called cover event. */
40 EndB1 = 2, /*!< Monitor the barrier from the
41 cover event to the exercise
42 date; trigger a knock-out only
43 if the barrier is hit or crossed
44 from either side, regardless of
45 the underlying value when
46 monitoring starts. */
47 EndB2 = 3 /*!< Monitor the barrier from the
48 cover event to the exercise
49 date; immediately trigger a
50 knock-out if the underlying
51 value is on the wrong side of
52 the barrier when monitoring
53 starts. */
54 };
55 };
56
57 //! Partial-time %barrier %option
58 /*! A particular type of %barrier %option in which the barrier is
59 only monitored for a part of the option's lifetime; either
60 from start to a so-called cover event, or from the cover event
61 to the exercise date.
62 */
64 public:
65 class arguments;
66 class engine;
68 Barrier::Type barrierType,
69 PartialBarrier::Range barrierRange,
70 Real barrier,
71 Real rebate,
72 Date coverEventDate,
73 const ext::shared_ptr<StrikedTypePayoff>& payoff,
74 const ext::shared_ptr<Exercise>& exercise);
75 void setupArguments(PricingEngine::arguments*) const override;
76
77 protected:
83 };
84
85 //! %Arguments for partial-time %barrier %option calculation
88 public:
89 arguments();
95 void validate() const override;
96 };
97
98 //! Base class for partial-time %barrier %option engines
100 : public GenericEngine<PartialTimeBarrierOption::arguments,
101 PartialTimeBarrierOption::results> {
102 };
103
104}
105
106
107#endif
Barrier type.
Concrete date class.
Definition: date.hpp:125
template base class for option pricing engines
Base class for options on a single asset.
basic option arguments
Definition: option.hpp:57
ext::shared_ptr< Payoff > payoff() const
Definition: option.hpp:45
ext::shared_ptr< Exercise > exercise() const
Definition: option.hpp:46
Arguments for partial-time barrier option calculation
Base class for partial-time barrier option engines.
void setupArguments(PricingEngine::arguments *) const override
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:37
Option on a single asset.
Payoffs for various options.
choice of time range for partial-time barrier options