Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
equitydigitaloption.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 ORE is free software: you can redistribute it and/or modify it
8 under the terms of the Modified BSD License. You should have received a
9 copy of the license along with this program.
10 The license is also available online at <http://opensourcerisk.org>
11 This program is distributed on the basis that it will form a useful
12 contribution to risk analytics and model standardisation, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
15 */
16
17/*! \file ored/portfolio/equitydigitaloption.hpp
18 \brief EQ Digital Option data model and serialization
19 \ingroup portfolio
20*/
21
22#pragma once
23
26
27namespace ore {
28namespace data {
29using std::string;
30
31//! Serializable EQ Digital Option
32/*!
33 \ingroup tradedata
34*/
36public:
37 //! Default constructor
39 : ore::data::Trade("EquityDigitalOption"), EquitySingleAssetDerivative("") {}
40 //! Constructor
42 const EquityUnderlying& equityUnderlying, double quantity)
43 : ore::data::Trade("EquityDigitalOption", env),
44 EquitySingleAssetDerivative("", env, equityUnderlying), option_(option),
46
47 //! Build QuantLib/QuantExt instrument, link pricing engine
48 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
49
50 //! \name Inspectors
51 //@{
52 const OptionData& option() const { return option_; }
53 double strike() const { return strike_; }
54 const string& payoffCurrency() const { return payoffCurrency_; }
55 double payoffAmount() const { return payoffAmount_; }
56 double quantity() const { return quantity_; }
57 //@}
58
59 //! \name Serialisation
60 //@{
61 virtual void fromXML(XMLNode* node) override;
62 virtual XMLNode* toXML(XMLDocument& doc) const override;
63 //@}
64private:
66 Real strike_;
70};
71} // namespace data
72} // namespace oreplus
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Serializable EQ Digital Option.
const OptionData & option() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & payoffCurrency() const
EquityDigitalOption(Envelope &env, OptionData option, double strike, const string &payoffCurrency, double payoffAmount, const EquityUnderlying &equityUnderlying, double quantity)
Constructor.
EquityDigitalOption()
Default constructor.
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Build QuantLib/QuantExt instrument, link pricing engine.
Base class for all single asset Equity Derivaties.
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
EQ base trade classes.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization