-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathquantlib.h
39 lines (32 loc) · 1.15 KB
/
quantlib.h
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
#ifndef QUANTLIB_INCLUDED_H
#define QUANTLIB_INCLUDED_H
#include <ql/instruments/vanillaoption.hpp>
#include <ql/option.hpp>
#include <ql/types.hpp>
namespace opcalc {
// namespace to contain our abstractions to encapsulate the QuantLib
// symbols. lower case to differentiate.
namespace quantlib {
struct OptionInput {
QuantLib::Option::Type type;
QuantLib::Real strike;
QuantLib::Real spot;
QuantLib::Rate dividend; // annual. [0,1]
QuantLib::Rate riskFreeRate; // annual. [0,1]
QuantLib::Time timeToMaturity; // fraction of year. [0,1]
QuantLib::Volatility volatility; // annual. [0,1]
};
QuantLib::VanillaOption value(
std::string const& engine,
std::string const& process,
OptionInput const& input);
/*
* engine must be one of "BaroneAdesiWhaley", "BjerksundStensland",
* "FDAmericanCrankNicolson", "FDDividendAmericanCrankNicolson".
*
* process must be one of "BlackScholesMerton", "GarmanKohlagen",
* "ExtendedBlackScholesMerton", or "VegaStressedBlackScholesProcess".
*
* For further descriptions, see QuantLib doxygen. */
}}
#endif