Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
equityoption.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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 portfolio/equityoption.hpp
20 \brief Equity Option data model and serialization
21 \ingroup tradedata
22*/
23
24#pragma once
25
29
30namespace ore {
31namespace data {
32using std::string;
33
34//! Serializable Equity Option
35/*!
36 \ingroup tradedata
37*/
39public:
40 //! Default constructor
42 //! Constructor
44 QuantLib::Real quantity, TradeStrike tradeStrike)
45 : VanillaOptionTrade(env, AssetClass::EQ, option, equityUnderlying.name(), currency, quantity, tradeStrike),
46 equityUnderlying_(equityUnderlying) {
47 tradeType_ = "EquityOption";
48 }
49
50 //! Build QuantLib/QuantExt instrument, link pricing engine
51 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
52
53 //! Add underlying Equity names
54 std::map<AssetClass, std::set<std::string>>
55 underlyingIndices(const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager = nullptr) const override;
56
57 //! \name Inspectors
58 //@{
59 const string& equityName() const { return equityUnderlying_.name(); }
60 const string& strikeCurrency() const { return strikeCurrency_; }
61 //@}
62
63 //! \name Serialisation
64 //@{
65 virtual void fromXML(XMLNode* node) override;
66 virtual XMLNode* toXML(XMLDocument& doc) const override;
67 //@}
68
69protected:
72};
73} // namespace data
74} // namespace ore
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Serializable Equity Option.
const string & equityName() const
std::map< AssetClass, std::set< std::string > > underlyingIndices(const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager=nullptr) const override
Add underlying Equity names.
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
EquityUnderlying equityUnderlying_
const string & strikeCurrency() const
EquityOption()
Default constructor.
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Build QuantLib/QuantExt instrument, link pricing engine.
EquityOption(Envelope &env, OptionData option, EquityUnderlying equityUnderlying, string currency, QuantLib::Real quantity, TradeStrike tradeStrike)
Constructor.
const std::string & name() const override
Definition: underlying.hpp:109
Serializable object holding option data.
Definition: optiondata.hpp:42
string tradeType_
Definition: trade.hpp:196
Serializable Vanilla Option.
const string & currency() const
const OptionData & option() const
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
string name
underlying data model
vanilla option representation