Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
basketoption.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/basketoption.hpp
20 \brief basket option wrapper for scripted trade
21 \ingroup portfolio
22*/
23
24#pragma once
25
27
32
33namespace ore {
34namespace data {
35
37public:
38 explicit BasketOption(const std::string& tradeType = "BasketOption") : ScriptedTrade(tradeType) {}
39 BasketOption(const std::string& currency, const std::string& notional, const TradeStrike& strike,
40 const std::vector<QuantLib::ext::shared_ptr<ore::data::Underlying>>& underlyings, const OptionData& optionData,
41 const std::string& settlement, const ScheduleData& observationDates)
42 : currency_(currency), notional_(notional), tradeStrike_(strike), underlyings_(underlyings),
43 optionData_(optionData), settlement_(settlement), observationDates_(observationDates) {
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
51protected:
52 void initIndices();
53 std::string currency_, notional_;
55 std::vector<QuantLib::ext::shared_ptr<ore::data::Underlying>> underlyings_;
57 std::string settlement_;
59};
60
62public:
64 : BasketOption("EquityBasketOption") {}
65};
66
68public:
70 : BasketOption("FxBasketOption") {}
71};
72
74public:
76 : BasketOption("CommodityBasketOption") {}
77};
78
79} // namespace data
80} // namespace ore
BasketOption(const std::string &currency, const std::string &notional, const TradeStrike &strike, const std::vector< QuantLib::ext::shared_ptr< ore::data::Underlying > > &underlyings, const OptionData &optionData, const std::string &settlement, const ScheduleData &observationDates)
void setIsdaTaxonomyFields() override
std::vector< QuantLib::ext::shared_ptr< ore::data::Underlying > > underlyings_
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
BasketOption(const std::string &tradeType="BasketOption")
ScheduleData observationDates_
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Serializable object holding option data.
Definition: optiondata.hpp:42
Serializable schedule data.
Definition: schedule.hpp:202
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