Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
equitydigitaloption.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17 */
18
19/*! \file ored/portfolio/builders/equitydigitaloption.hpp
20 \brief
21 \ingroup portfolio
22*/
23
24#pragma once
25
26#include <boost/make_shared.hpp>
29#include <ql/pricingengines/vanilla/analyticeuropeanengine.hpp>
30#include <ql/processes/blackscholesprocess.hpp>
31
32namespace ore {
33namespace data {
34using namespace QuantLib;
35using std::string;
36
37//! Engine Builder for European EQ Digital Options
38/*! Pricing engines are cached by currency pair
39
40 \ingroup portfolio
41 */
43 : public ore::data::CachingPricingEngineBuilder<string, const string&, const Currency&> {
44public:
46 : CachingEngineBuilder("BlackScholesMerton", "AnalyticEuropeanEngine", {"EquityDigitalOption"}) {}
47
48protected:
49 virtual string keyImpl(const string& assetName, const Currency& ccy) override {
50 return assetName + "/" + ccy.code();
51 }
52
53 virtual QuantLib::ext::shared_ptr<PricingEngine> engineImpl(const string& assetName, const Currency& ccy) override {
54
55 QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess> gbsp = QuantLib::ext::make_shared<GeneralizedBlackScholesProcess>(
57 market_->equityDividendCurve(assetName, configuration(ore::data::MarketContext::pricing)),
58 market_->equityForecastCurve(assetName, configuration(ore::data::MarketContext::pricing)),
60
61 return QuantLib::ext::make_shared<QuantExt::AnalyticEuropeanEngine>(gbsp);
62 }
63};
64
65} // namespace data
66} // namespace oreplus
Abstract template engine builder class.
Abstract template EngineBuilder class that can cache engines and coupon pricers.
QuantLib::ext::shared_ptr< Market > market_
const string & configuration(const MarketContext &key)
Return a configuration (or the default one if key not found)
Engine Builder for European EQ Digital Options.
virtual QuantLib::ext::shared_ptr< PricingEngine > engineImpl(const string &assetName, const Currency &ccy) override
virtual string keyImpl(const string &assetName, const Currency &ccy) override
Pricing Engine Factory.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23