Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fxtouchoption.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 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/fxtouchoption.hpp
20 \brief FX One-Touch/No-Touch Option data model and serialization
21 \ingroup portfolio
22*/
23
24#pragma once
25
29#include <ql/instruments/barriertype.hpp>
30
31namespace ore {
32namespace data {
33using std::string;
34
35//! Serializable FX One-Touch/No-Touch Option
36/*!
37 \ingroup tradedata
38*/
40public:
41 //! Default constructor
42 FxTouchOption() : ore::data::Trade("FxTouchOption"), FxSingleAssetDerivative("") {}
43 //! Constructor
45 string domesticCurrency, string payoffCurrency, double payoffAmount, string startDate = "",
46 string calendar = "", string fxIndex = "");
47
48 //! Build QuantLib/QuantExt instrument, link pricing engine
49 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
50
51 //! \name Inspectors
52 //@{
53 const OptionData& option() const { return option_; }
54 const BarrierData& barrier() const { return barrier_; }
55 double payoffAmount() const { return payoffAmount_; }
56 const string& type() const { return type_; }
57 const string& payoffCurrency() const { return payoffCurrency_; }
58 const string& startDate() const { return startDate_; }
59 const string& calendar() const { return calendar_; }
60 const string& fxIndex() const { return fxIndex_; }
61 //@}
62
63 //! \name Serialisation
64 //@{
65 virtual void fromXML(XMLNode* node) override;
66 virtual XMLNode* toXML(XMLDocument& doc) const override;
67 //@}
68private:
69 bool checkBarrier(Real spot, Barrier::Type type, Real level);
70
73 string startDate_;
74 string calendar_;
75 string fxIndex_;
77 string type_;
79};
80} // namespace data
81} // 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 FX Derivaties.
const std::string & domesticCurrency() const
const std::string & foreignCurrency() const
Serializable FX One-Touch/No-Touch Option.
const BarrierData & barrier() const
const OptionData & option() const
const string & startDate() const
double payoffAmount() const
virtual void fromXML(XMLNode *node) override
FxTouchOption()
Default constructor.
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & type() const
const string & fxIndex() const
bool checkBarrier(Real spot, Barrier::Type type, Real level)
const string & payoffCurrency() const
const string & calendar() const
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
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