QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
oneassetoption.hpp
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
26#ifndef quantlib_oneasset_option_hpp
27#define quantlib_oneasset_option_hpp
28
29#include <ql/option.hpp>
30
31namespace QuantLib {
32
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>&);
41
42 bool isExpired() const override;
44
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;
58 void fetchResults(const PricingEngine::results*) const override;
59
60 protected:
61 void setupExpired() const override;
62 // results
66 };
67
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