Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
cliquetoption.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 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 ORE is free software: you can redistribute it and/or modify it
8 under the terms of the Modified BSD License. You should have received a
9 copy of the license along with this program.
10 The license is also available online at <http://opensourcerisk.org>
11
12 This program is distributed on the basis that it will form a useful
13 contribution to risk analytics and model standardisation, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
16*/
17
18/*! \file portfolio/builders/cliquetoption.hpp
19 \brief Engine builder for cliquet options
20 \ingroup builders
21*/
22
23#pragma once
24
25#include <boost/make_shared.hpp>
30
31namespace ore {
32namespace data {
33
34//! Engine builder for Cliquet Options
35/*! Pricing engines are cached by currency
36 \ingroup builders
37*/
39 : public ore::data::CachingOptionEngineBuilder<std::string, const std::string&, const QuantLib::Currency&,
40 const ore::data::AssetClass&> {
41public:
42 CliquetOptionEngineBuilder(const std::string& model, const std::string& engine,
43 const std::set<std::string>& tradeTypes, const ore::data::AssetClass& assetClass)
45
46 QuantLib::ext::shared_ptr<QuantLib::PricingEngine> engine(const std::string& assetName, const QuantLib::Currency& ccy) {
47 return ore::data::CachingOptionEngineBuilder<std::string, const std::string&, const QuantLib::Currency&,
48 const ore::data::AssetClass&>::engine(assetName, ccy, assetClass_);
49 }
50
51 QuantLib::ext::shared_ptr<QuantLib::PricingEngine> engine(const QuantLib::Currency& ccy1, const QuantLib::Currency& ccy2) {
52 return ore::data::CachingOptionEngineBuilder<std::string, const std::string&, const QuantLib::Currency&,
53 const ore::data::AssetClass&>::engine(ccy1.code(), ccy2,
55 }
56
57protected:
58 virtual std::string keyImpl(const std::string& assetName, const QuantLib::Currency& ccy,
59 const ore::data::AssetClass& assetClass) override {
60 return assetName + "/" + ccy.code();
61 }
62};
63
64//! Engine Builder for Equity Cliquet Options
65/*! Pricing engines are cached by asset/currency
66 \ingroup builders
67 */
69public:
70 EquityCliquetOptionEngineBuilder(const std::string& model, const std::string& engine)
72};
73
75public:
77
78protected:
79 QuantLib::ext::shared_ptr<PricingEngine> engineImpl(const std::string& assetName, const QuantLib::Currency& ccy,
80 const ore::data::AssetClass& assetClass) override;
81};
82
83} // namespace data
84} // namespace ore
Engine builder for cliquet options.
Abstract engine builders for European and American Options.
Engine builder for Cliquet Options.
CliquetOptionEngineBuilder(const std::string &model, const std::string &engine, const std::set< std::string > &tradeTypes, const ore::data::AssetClass &assetClass)
virtual std::string keyImpl(const std::string &assetName, const QuantLib::Currency &ccy, const ore::data::AssetClass &assetClass) override
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > engine(const QuantLib::Currency &ccy1, const QuantLib::Currency &ccy2)
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > engine(const std::string &assetName, const QuantLib::Currency &ccy)
const string & engine() const
Return the engine name.
const set< string > & tradeTypes() const
Return the possible trade types.
const string & model() const
Return the model name.
Engine Builder for Equity Cliquet Options.
EquityCliquetOptionEngineBuilder(const std::string &model, const std::string &engine)
QuantLib::ext::shared_ptr< PricingEngine > engineImpl(const std::string &assetName, const QuantLib::Currency &ccy, const ore::data::AssetClass &assetClass) override
Pricing Engine Factory.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
scripted trade data model