Pricing engine for European vanilla options using analytical formulae.
More...
#include <qle/pricingengines/analyticeuropeanengine.hpp>
Pricing engine for European vanilla options using analytical formulae.
Definition at line 36 of file analyticeuropeanengine.hpp.
◆ AnalyticEuropeanEngine() [1/2]
◆ AnalyticEuropeanEngine() [2/2]
AnalyticEuropeanEngine |
( |
ext::shared_ptr< GeneralizedBlackScholesProcess > |
process, |
|
|
Handle< YieldTermStructure > |
discountCurve, |
|
|
const bool |
flipResults = false |
|
) |
| |
◆ calculate()
Definition at line 31 of file analyticeuropeanengine.cpp.
31 {
32
33 QuantLib::AnalyticEuropeanEngine::calculate();
34
36
37
38
39 auto resToInvert = vector<string>({"spot", "forward", "strike"});
40 for (const string& res : resToInvert) {
41 auto it =
results_.additionalResults.find(res);
42 if (it !=
results_.additionalResults.end())
43 it->second = 1. / boost::any_cast<Real>(it->second);
44 }
45
46
47
48 Real rfDiscount = Null<Real>();
49 Real divDiscount = Null<Real>();
50
51 if (
auto tmp =
results_.additionalResults.find(
"riskFreeDiscount"); tmp !=
results_.additionalResults.end())
52 rfDiscount = boost::any_cast<Real>(tmp->second);
53 if (
auto tmp =
results_.additionalResults.find(
"dividendDiscount"); tmp !=
results_.additionalResults.end())
54 divDiscount = boost::any_cast<Real>(tmp->second);
55
56 results_.additionalResults[
"riskFreeDiscount"] = divDiscount;
57 results_.additionalResults[
"dividendDiscount"] = rfDiscount;
58
59 }
60}
const Instrument::results * results_
◆ process_
ext::shared_ptr<GeneralizedBlackScholesProcess> process_ |
|
private |
◆ discountCurve_
Handle<YieldTermStructure> discountCurve_ |
|
private |
◆ flipResults_