Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
rainbowoption.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/rainbowoption.hpp
20 \brief rainbow option wrapper for scripted trade
21 \ingroup portfolio
22*/
23
24#pragma once
25
30
31namespace ore {
32namespace data {
33
35public:
36 explicit RainbowOption(const QuantLib::ext::shared_ptr<Conventions>& conventions = nullptr,
37 const std::string& tradeType = "RainbowOption")
39 RainbowOption(const std::string& currency, const std::string& notional, const std::string& strike,
40 const std::vector<QuantLib::ext::shared_ptr<Underlying>>& underlyings, const OptionData& optionData,
41 const std::string& settlement)
42 : currency_(currency), notional_(notional), strike_(strike), underlyings_(underlyings), optionData_(optionData),
43 settlement_(settlement) {
45 }
46 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
47 void setIsdaTaxonomyFields() override;
48 void fromXML(XMLNode* node) override;
49 XMLNode* toXML(XMLDocument& doc) const override;
50
51private:
52 void initIndices();
54 std::vector<QuantLib::ext::shared_ptr<Underlying>> underlyings_;
56 std::string settlement_;
57};
58
60public:
61 explicit EquityRainbowOption(const QuantLib::ext::shared_ptr<Conventions>& conventions = nullptr)
62 : RainbowOption(conventions, "EquityRainbowOption") {}
63};
64
66public:
67 explicit FxRainbowOption(const QuantLib::ext::shared_ptr<Conventions>& conventions = nullptr)
68 : RainbowOption(conventions, "FxRainbowOption") {}
69};
70
72public:
73 explicit CommodityRainbowOption(const QuantLib::ext::shared_ptr<Conventions>& conventions = nullptr)
74 : RainbowOption(conventions, "CommodityRainbowOption") {}
75};
76
77} // namespace data
78} // namespace ore
CommodityRainbowOption(const QuantLib::ext::shared_ptr< Conventions > &conventions=nullptr)
EquityRainbowOption(const QuantLib::ext::shared_ptr< Conventions > &conventions=nullptr)
FxRainbowOption(const QuantLib::ext::shared_ptr< Conventions > &conventions=nullptr)
Serializable object holding option data.
Definition: optiondata.hpp:42
RainbowOption(const std::string &currency, const std::string &notional, const std::string &strike, const std::vector< QuantLib::ext::shared_ptr< Underlying > > &underlyings, const OptionData &optionData, const std::string &settlement)
void setIsdaTaxonomyFields() override
std::vector< QuantLib::ext::shared_ptr< Underlying > > underlyings_
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
RainbowOption(const QuantLib::ext::shared_ptr< Conventions > &conventions=nullptr, const std::string &tradeType="RainbowOption")
QuantLib::Real notional() const override
Return the current notional in npvCurrency. See individual sub-classes for the precise definition.
const string & tradeType() const
Definition: trade.hpp:133
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization
scripted trade data model
base trade data model and serialization
underlying data model