/usr/include/ql/instruments/lookbackoption.hpp is in libquantlib0-dev 1.12-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2006 Warren Chou
Copyright (C) 2007 StatPro Italia srl
Copyright (C) 2014 Francois Botha
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license. You should have received a
copy of the license along with this program; if not, please email
<quantlib-dev@lists.sf.net>. The license is also available online at
<http://quantlib.org/license.shtml>.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
/*! \file lookbackoption.hpp
\brief Lookback option on a single asset
*/
#ifndef quantlib_lookback_option_hpp
#define quantlib_lookback_option_hpp
#include <ql/instruments/oneassetoption.hpp>
#include <ql/instruments/payoffs.hpp>
#include <ql/exercise.hpp>
namespace QuantLib {
//! Continuous-floating lookback option
/*! \ingroup instruments */
class ContinuousFloatingLookbackOption : public OneAssetOption {
public:
class arguments;
class engine;
ContinuousFloatingLookbackOption(
Real currentMinmax,
const boost::shared_ptr<TypePayoff>& payoff,
const boost::shared_ptr<Exercise>& exercise);
void setupArguments(PricingEngine::arguments*) const;
protected:
// arguments
Real minmax_;
};
//! Continuous-fixed lookback option
/*! \ingroup instruments */
class ContinuousFixedLookbackOption : public OneAssetOption {
public:
class arguments;
class engine;
ContinuousFixedLookbackOption(
Real currentMinmax,
const boost::shared_ptr<StrikedTypePayoff>& payoff,
const boost::shared_ptr<Exercise>& exercise);
void setupArguments(PricingEngine::arguments*) const;
protected:
// arguments
Real minmax_;
};
//! Continuous-partial-floating lookback option
/*! From http://help.rmetrics.org/fExoticOptions/LookbackOptions.html :
For a partial-time floating strike lookback option, the
lookback period starts at time zero and ends at an arbitrary
date before expiration. Except for the partial lookback
period, the option is similar to a floating strike lookback
option. The partial-time floating strike lookback option is
cheaper than a similar standard floating strike lookback
option. Partial-time floating strike lookback options can be
priced analytically using a model introduced by Heynen and Kat
(1994).
\ingroup instruments
*/
class ContinuousPartialFloatingLookbackOption : public ContinuousFloatingLookbackOption {
public:
class arguments;
class engine;
ContinuousPartialFloatingLookbackOption(
Real currentMinmax,
Real lambda,
Date lookbackPeriodEnd,
const boost::shared_ptr<TypePayoff>& payoff,
const boost::shared_ptr<Exercise>& exercise);
void setupArguments(PricingEngine::arguments*) const;
protected:
// arguments
Real lambda_;
Date lookbackPeriodEnd_;
};
//! Continuous-partial-fixed lookback option
/*! From http://help.rmetrics.org/fExoticOptions/LookbackOptions.html :
For a partial-time fixed strike lookback option, the lookback
period starts at a predetermined date after the initialization
date of the option. The partial-time fixed strike lookback
call option payoff is given by the difference between the
maximum observed price of the underlying asset during the
lookback period and the fixed strike price. The partial-time
fixed strike lookback put option payoff is given by the
difference between the fixed strike price and the minimum
observed price of the underlying asset during the lookback
period. The partial-time fixed strike lookback option is
cheaper than a similar standard fixed strike lookback
option. Partial-time fixed strike lookback options can be
priced analytically using a model introduced by Heynen and Kat
(1994).
\ingroup instruments
*/
class ContinuousPartialFixedLookbackOption : public ContinuousFixedLookbackOption {
public:
class arguments;
class engine;
ContinuousPartialFixedLookbackOption(
Date lookbackPeriodStart,
const boost::shared_ptr<StrikedTypePayoff>& payoff,
const boost::shared_ptr<Exercise>& exercise);
void setupArguments(PricingEngine::arguments*) const;
protected:
// arguments
Date lookbackPeriodStart_;
};
//! %Arguments for continuous floating lookback option calculation
class ContinuousFloatingLookbackOption::arguments
: public OneAssetOption::arguments {
public:
Real minmax;
void validate() const;
};
//! %Arguments for continuous fixed lookback option calculation
class ContinuousFixedLookbackOption::arguments
: public OneAssetOption::arguments {
public:
Real minmax;
void validate() const;
};
//! %Arguments for continuous partial floating lookback option calculation
class ContinuousPartialFloatingLookbackOption::arguments
: public ContinuousFloatingLookbackOption::arguments {
public:
Real lambda;
Date lookbackPeriodEnd;
void validate() const;
};
//! %Arguments for continuous partial fixed lookback option calculation
class ContinuousPartialFixedLookbackOption::arguments
: public ContinuousFixedLookbackOption::arguments {
public:
Date lookbackPeriodStart;
void validate() const;
};
//! %Continuous floating lookback %engine base class
class ContinuousFloatingLookbackOption::engine
: public GenericEngine<ContinuousFloatingLookbackOption::arguments,
ContinuousFloatingLookbackOption::results> {};
//! %Continuous fixed lookback %engine base class
class ContinuousFixedLookbackOption::engine
: public GenericEngine<ContinuousFixedLookbackOption::arguments,
ContinuousFixedLookbackOption::results> {};
//! %Continuous partial floating lookback %engine base class
class ContinuousPartialFloatingLookbackOption::engine
: public GenericEngine<ContinuousPartialFloatingLookbackOption::arguments,
ContinuousPartialFloatingLookbackOption::results> {};
//! %Continuous partial fixed lookback %engine base class
class ContinuousPartialFixedLookbackOption::engine
: public GenericEngine<ContinuousPartialFixedLookbackOption::arguments,
ContinuousPartialFixedLookbackOption::results> {};
}
#endif
|