Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fxdigitaloption.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 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/fxdigitaloption.hpp
18 \brief FX 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 FX Digital Option
32/*!
33 \ingroup tradedata
34*/
36public:
37 //! Default constructor
38 FxDigitalOption() : ore::data::Trade("FxDigitalOption"), FxSingleAssetDerivative("") {}
39
40 //! Constructor
42 const string& foreignCurrency, const string& domesticCurrency)
43 : ore::data::Trade("FxDigitalOption", env),
46
47 //! Legacy Constructor
49 const string& domesticCurrency)
50 : ore::data::Trade("FxDigitalOption", env),
53
54 //! Build QuantLib/QuantExt instrument, link pricing engine
55 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
56
57 //! \name Inspectors
58 //@{
59 const OptionData& option() const { return option_; }
60 double strike() const { return strike_; }
61 const string& payoffCurrency() const { return payoffCurrency_; }
62 double payoffAmount() const { return payoffAmount_; }
63 //@}
64
65 //! \name Serialisation
66 //@{
67 virtual void fromXML(XMLNode* node) override;
68 virtual XMLNode* toXML(XMLDocument& doc) const override;
69 //@}
70private:
72 Real strike_;
75};
76} // namespace data
77} // namespace oreplus
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Serializable FX Digital Option.
const OptionData & option() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & payoffCurrency() const
FxDigitalOption()
Default constructor.
FxDigitalOption(Envelope &env, OptionData option, double strike, double payoffAmount, const string &foreignCurrency, const string &domesticCurrency)
Legacy Constructor.
FxDigitalOption(Envelope &env, OptionData option, double strike, const string &payoffCurrency, double payoffAmount, const string &foreignCurrency, const string &domesticCurrency)
Constructor.
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Build QuantLib/QuantExt instrument, link pricing engine.
Base class for all single asset FX Derivaties.
const std::string & domesticCurrency() const
const std::string & foreignCurrency() 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
FX base trade classes.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization