QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
oneassetoption.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) 2000, 2001, 2002, 2003 RiskMap srl
5 Copyright (C) 2003 Ferdinando Ametrano
6 Copyright (C) 2007 StatPro Italia srl
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
22/*! \file oneassetoption.hpp
23 \brief Option on a single asset
24*/
25
26#ifndef quantlib_oneasset_option_hpp
27#define quantlib_oneasset_option_hpp
28
29#include <ql/option.hpp>
30
31namespace QuantLib {
32
33 //! Base class for options on a single asset
34 class OneAssetOption : public Option {
35 public:
36 class engine;
37 class results;
38 OneAssetOption(const ext::shared_ptr<Payoff>&,
39 const ext::shared_ptr<Exercise>&);
40 //! \name Instrument interface
41 //@{
42 bool isExpired() const override;
43 //@}
44 //! \name greeks
45 //@{
46 Real delta() const;
47 Real deltaForward() const;
48 Real elasticity() const;
49 Real gamma() const;
50 Real theta() const;
51 Real thetaPerDay() const;
52 Real vega() const;
53 Real rho() const;
54 Real dividendRho() const;
55 Real strikeSensitivity() const;
57 //@}
58 void fetchResults(const PricingEngine::results*) const override;
59
60 protected:
61 void setupExpired() const override;
62 // results
66 };
67
68 //! %Results from single-asset option calculation
70 public Greeks,
71 public MoreGreeks {
72 public:
73 void reset() override {
77 }
78 };
79
81 public GenericEngine<OneAssetOption::arguments,
82 OneAssetOption::results> {};
83
84}
85
86
87#endif
88
template base class for option pricing engines
additional option results
Definition: option.hpp:69
void reset() override
Definition: option.hpp:71
more additional option results
Definition: option.hpp:79
void reset() override
Definition: option.hpp:81
Results from single-asset option calculation
Base class for options on a single asset.
bool isExpired() const override
returns whether the instrument might have value greater than zero.
void setupExpired() const override
void fetchResults(const PricingEngine::results *) const override
base option class
Definition: option.hpp:36
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35
Base option class.