Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
flexiswap.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2018 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/flexiswap.hpp
20 \brief
21 \ingroup builders
22*/
23
24#pragma once
25
29
30#include <qle/models/lgm.hpp>
31
32#include <boost/make_shared.hpp>
33
34namespace ore {
35namespace data {
37
38//! Flexi Swap / BGS Engine Builder Base Class (id2 is used for BGS only)
40 : public CachingPricingEngineBuilder<std::string, const std::string&, const std::string&, const std::string&,
41 const std::vector<QuantLib::Date>&, const QuantLib::Date&,
42 const std::vector<QuantLib::Real>&> {
43public:
44 FlexiSwapBGSEngineBuilderBase(const std::string& tradeType, const std::string& model, const std::string& engine)
45 : CachingEngineBuilder(model, engine, {tradeType}) {}
46
47protected:
48 virtual std::string keyImpl(const std::string& id, const std::string& id2, const std::string& key,
49 const std::vector<QuantLib::Date>& dates, const QuantLib::Date& maturity,
50 const std::vector<QuantLib::Real>& strikes) override {
51 return id;
52 }
53};
54
55//! Flexi Swap / BGS Discounting Engine Builder
57public:
58 FlexiSwapBGSDiscountingEngineBuilderBase(const std::string& tradeType)
59 : FlexiSwapBGSEngineBuilderBase(tradeType, "DiscountedCashflows", "DiscountingSwapEngine") {}
60
61protected:
62 virtual QuantLib::ext::shared_ptr<QuantLib::PricingEngine> engineImpl(const std::string& id, const std::string& id2,
63 const std::string& key,
64 const std::vector<QuantLib::Date>& dates,
65 const QuantLib::Date& maturity,
66 const std::vector<QuantLib::Real>& strikes) override;
67};
68
69//! Flexi Swap / BGS Numeric LGM Grid Engine Builder Base Class
71public:
72 FlexiSwapBGSLGMGridEngineBuilderBase(const std::string& tradeType, const std::string& model)
73 : FlexiSwapBGSEngineBuilderBase(tradeType, model, "Grid") {}
74
75protected:
76 QuantLib::ext::shared_ptr<QuantExt::LGM> model(const std::string& id, const std::string& key,
77 const std::vector<QuantLib::Date>& dates, const QuantLib::Date& maturity,
78 const std::vector<QuantLib::Real>& strikes);
79};
80
81//! Flexi Swap Discounting Engine Builder
83public:
85};
86
87//! Flexi Swap LGM Grid Engine Builder
89public:
91
92protected:
93 virtual QuantLib::ext::shared_ptr<QuantLib::PricingEngine> engineImpl(const std::string& id, const std::string& id2,
94 const std::string& key,
95 const std::vector<QuantLib::Date>& dates,
96 const QuantLib::Date& maturity,
97 const std::vector<QuantLib::Real>& strikes) override;
98};
99
100} // namespace data
101} // namespace ore
Abstract template engine builder class.
Abstract template EngineBuilder class that can cache engines and coupon pricers.
const string & engine() const
Return the engine name.
const string & model() const
Return the model name.
Flexi Swap / BGS Discounting Engine Builder.
Definition: flexiswap.hpp:56
virtual QuantLib::ext::shared_ptr< QuantLib::PricingEngine > engineImpl(const std::string &id, const std::string &id2, const std::string &key, const std::vector< QuantLib::Date > &dates, const QuantLib::Date &maturity, const std::vector< QuantLib::Real > &strikes) override
Definition: flexiswap.cpp:192
FlexiSwapBGSDiscountingEngineBuilderBase(const std::string &tradeType)
Definition: flexiswap.hpp:58
Flexi Swap / BGS Engine Builder Base Class (id2 is used for BGS only)
Definition: flexiswap.hpp:42
FlexiSwapBGSEngineBuilderBase(const std::string &tradeType, const std::string &model, const std::string &engine)
Definition: flexiswap.hpp:44
virtual std::string keyImpl(const std::string &id, const std::string &id2, const std::string &key, const std::vector< QuantLib::Date > &dates, const QuantLib::Date &maturity, const std::vector< QuantLib::Real > &strikes) override
Definition: flexiswap.hpp:48
Flexi Swap / BGS Numeric LGM Grid Engine Builder Base Class.
Definition: flexiswap.hpp:70
FlexiSwapBGSLGMGridEngineBuilderBase(const std::string &tradeType, const std::string &model)
Definition: flexiswap.hpp:72
Flexi Swap Discounting Engine Builder.
Definition: flexiswap.hpp:82
Flexi Swap LGM Grid Engine Builder.
Definition: flexiswap.hpp:88
virtual QuantLib::ext::shared_ptr< QuantLib::PricingEngine > engineImpl(const std::string &id, const std::string &id2, const std::string &key, const std::vector< QuantLib::Date > &dates, const QuantLib::Date &maturity, const std::vector< QuantLib::Real > &strikes) override
Definition: flexiswap.cpp:156
Pricing Engine Factory.
Classes and functions for log message handling.
@ data
Definition: log.hpp:77
Time maturity
Definition: utilities.cpp:66
Serializable Credit Default Swap.
Definition: namespaces.docs:23