Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
multilegoption.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 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 multilegoption.hpp
20 \brief Multileg Option data model
21*/
22
23#pragma once
24
28
29namespace ore {
30namespace data {
31
32class MultiLegOption : public Trade {
33public:
34 // default ctor
35 MultiLegOption() : Trade("MultiLegOption"), hasOption_(false) {}
36
37 // trade consists only of the underlying
38 MultiLegOption(const Envelope& env, const vector<LegData>& underlyingData)
39 : Trade("MultiLegOption", env), hasOption_(false), underlyingData_(underlyingData) {}
40
41 // trade is an option to exercise into an underlying
42 MultiLegOption(const Envelope& env, const OptionData& optionData, const vector<LegData>& underlyingData)
43 : Trade("MultiLegOption", env), optionData_(optionData), hasOption_(true), underlyingData_(underlyingData) {}
44
45 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
46
47 const OptionData& option() { return optionData_; }
48 const bool& hasOption() { return hasOption_; }
49 const vector<LegData>& underlying() { return underlyingData_; }
50
51 void fromXML(XMLNode* node) override;
52 XMLNode* toXML(XMLDocument& doc) const override;
53
54private:
57 vector<LegData> underlyingData_;
58};
59
60} // namespace data
61} // namespace ore
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
const OptionData & option()
vector< LegData > underlyingData_
const vector< LegData > & underlying()
MultiLegOption(const Envelope &env, const OptionData &optionData, const vector< LegData > &underlyingData)
MultiLegOption(const Envelope &env, const vector< LegData > &underlyingData)
Serializable object holding option data.
Definition: optiondata.hpp:42
Trade base class.
Definition: trade.hpp:55
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
leg data model and serialization
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization
base trade data model and serialization