Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
equityoutperformanceoption.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/equityoutperformanceoption.hpp
20 \brief EQ Outperformance Option data model and serialization
21 \ingroup portfolio
22*/
23
24#pragma once
25
28
30
31namespace ore {
32namespace data {
33using std::string;
34
35//! Serializable EQ Outperformance Option
36/*!
37 \ingroup tradedata
38*/
40public:
41 //! Default constructor
42 EquityOutperformanceOption() : Trade("EquityOutperformanceOption") {}
43 //! Constructor
45 const QuantLib::ext::shared_ptr<ore::data::Underlying>& underlying1, const QuantLib::ext::shared_ptr<ore::data::Underlying>& underlying2,
46 Real initialPrice1, Real initialPrice2, Real strike, const string& initialPriceCurrency1 = "", const string& initialPriceCurrency2 = "",
47 Real knockInPrice = Null<Real>(), Real knockOutPrice = Null<Real>(), string fxIndex1 = "", string fxIndex2 = "" );
48
49 //! Build QuantLib/QuantExt instrument, link pricing engine
50 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
51
52 //! \name Inspectors
53 //@{
54 const OptionData& option() const { return option_; }
55 const string& currency() const { return currency_; }
56 const std::string& name1() const { return underlying1_->name(); }
57 const QuantLib::ext::shared_ptr<ore::data::Underlying>& underlying1() const { return underlying1_; }
58 const std::string& name2() const { return underlying2_->name(); }
59 const QuantLib::ext::shared_ptr<ore::data::Underlying>& underlying2() const { return underlying2_; }
60
61 const Real& initialPrice1() const { return initialPrice1_; }
62 const Real& initialPrice2() const { return initialPrice2_; }
63
64 const string& initialPriceCurrency1() const { return initialPriceCurrency1_; }
65 const string& initialPriceCurrency2() const { return initialPriceCurrency2_; }
66
67 const Real& strikeReturn() const { return strikeReturn_; }
68
69 const Real& knockInPrice() const { return knockInPrice_; }
70 const Real& knockOutPrice() const { return knockOutPrice_; }
71
72 const string& fxIndex1() const { return fxIndex1_; }
73 const string& fxIndex2() const { return fxIndex2_; }
74 //@}
75
76 //! \name Serialisation
77 //@{
78 virtual void fromXML(XMLNode* node) override;
79 virtual XMLNode* toXML(XMLDocument& doc) const override;
80 //@}
81private:
83 string currency_;
84 Real amount_;
85 QuantLib::ext::shared_ptr<ore::data::Underlying> underlying1_;
86 QuantLib::ext::shared_ptr<ore::data::Underlying> underlying2_;
94 string fxIndex1_ = "";
95 string fxIndex2_ = "";
96
97};
98} // namespace data
99} // namespace ore
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Serializable EQ Outperformance Option.
const QuantLib::ext::shared_ptr< ore::data::Underlying > & underlying1() const
const QuantLib::ext::shared_ptr< ore::data::Underlying > & underlying2() const
QuantLib::ext::shared_ptr< ore::data::Underlying > underlying2_
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
QuantLib::ext::shared_ptr< ore::data::Underlying > underlying1_
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Build QuantLib/QuantExt instrument, link pricing engine.
Serializable object holding option data.
Definition: optiondata.hpp:42
Trade base class.
Definition: trade.hpp:55
virtual QuantLib::Real notional() const
Return the current notional in npvCurrency. See individual sub-classes for the precise definition.
Definition: trade.hpp:153
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
EQ base trade classes.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization