QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
cliquetoption.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) 2003, 2004, 2007 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
20/*! \file cliquetoption.hpp
21 \brief Cliquet option
22*/
23
24#ifndef ql_cliquet_option_hpp
25#define ql_cliquet_option_hpp
26
29#include <ql/time/date.hpp>
30#include <vector>
31
32namespace QuantLib {
33
34 class EuropeanExercise;
35
36 //! cliquet (Ratchet) option
37 /*! A cliquet option, also known as Ratchet option, is a series of
38 forward-starting (a.k.a. deferred strike) options where the
39 strike for each forward start option is set equal to a fixed
40 percentage of the spot price at the beginning of each period.
41
42 \todo
43 - add local/global caps/floors
44 - add accrued coupon and last fixing
45
46 \ingroup instruments
47 */
49 public:
50 class arguments;
51 class engine;
52 CliquetOption(const ext::shared_ptr<PercentageStrikePayoff>&,
53 const ext::shared_ptr<EuropeanExercise>& maturity,
54 std::vector<Date> resetDates);
55 void setupArguments(PricingEngine::arguments*) const override;
56
57 private:
58 std::vector<Date> resetDates_;
59 };
60
61 //! %Arguments for cliquet option calculation
62 // should inherit from a strikeless version of VanillaOption::arguments
63 class CliquetOption::arguments : public OneAssetOption::arguments {
64 public:
67 localCap(Null<Real>()),
70 globalFloor(Null<Real>()) {}
71 void validate() const override;
74 std::vector<Date> resetDates;
75 };
76
77 //! Cliquet %engine base class
79 : public GenericEngine<CliquetOption::arguments,
80 CliquetOption::results> {};
81
82}
83
84
85#endif
Arguments for cliquet option calculation
Cliquet engine base class.
cliquet (Ratchet) option
void setupArguments(PricingEngine::arguments *) const override
std::vector< Date > resetDates_
template base class for option pricing engines
template class providing a null value for a given type.
Definition: null.hpp:76
Base class for options on a single asset.
date- and time-related classes, typedefs and enumerations
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35
Option on a single asset.
Payoffs for various options.