Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
equitytouchoption.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/equitytouchoption.hpp
18 \brief EQ One-Touch/No-Touch Option data model and serialization
19 \ingroup portfolio
20*/
21
22#pragma once
23
27
28namespace ore {
29namespace data {
30using std::string;
31
32//! Serializable EQ One-Touch/No-Touch Option
33/*!
34 \ingroup tradedata
35*/
37public:
38 //! Default constructor
40 : ore::data::Trade("EquityTouchOption"), EquitySingleAssetDerivative("") {}
41 //! Constructor
43 string payoffCurrency, double payoffAmount, string startDate = "", string calendar = "",
44 string eqIndex = "");
45
46 //! Build QuantLib/QuantExt instrument, link pricing engine
47 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
48
49 //! \name Inspectors
50 //@{
51 const OptionData& option() const { return option_; }
52 const BarrierData& barrier() const { return barrier_; }
53 double payoffAmount() const { return payoffAmount_; }
54 const string& type() const { return type_; }
55 const string& payoffCurrency() const { return payoffCurrency_; }
56 const string& startDate() const { return startDate_; }
57 const string& calendar() const { return calendar_; }
58 const string& eqIndex() const { return eqIndex_; }
59 //@}
60
61 //! \name Serialisation
62 //@{
63 virtual void fromXML(XMLNode* node) override;
64 virtual XMLNode* toXML(XMLDocument& doc) const override;
65 //@}
66private:
67 bool checkBarrier(Real spot, Barrier::Type type, Real level);
68
71 string startDate_;
72 string calendar_;
73 string eqIndex_;
75 string type_;
77};
78} // namespace data
79} // namespace oreplus
Serializable obejct holding barrier data.
Definition: barrierdata.hpp:34
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Base class for all single asset Equity Derivaties.
Serializable EQ One-Touch/No-Touch Option.
const BarrierData & barrier() const
const OptionData & option() const
const string & startDate() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & type() const
bool checkBarrier(Real spot, Barrier::Type type, Real level)
const string & payoffCurrency() const
const string & calendar() const
EquityTouchOption()
Default constructor.
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Build QuantLib/QuantExt instrument, link pricing engine.
const string & eqIndex() const
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