QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
cliquetoption.hpp
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
24#ifndef ql_cliquet_option_hpp
25#define ql_cliquet_option_hpp
26
27#include <ql/instruments/oneassetoption.hpp>
28#include <ql/instruments/payoffs.hpp>
29#include <ql/time/date.hpp>
30#include <vector>
31
32namespace QuantLib {
33
34 class EuropeanExercise;
35
37
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
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
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.
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35