Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fxkikobarrieroption.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 portfolio/fxdoublebarrieroption.hpp
20 \brief FX Double Barrier 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 KIKO Barrier Option
36/*!
37 \ingroup tradedata
38*/
40public:
41 //! Default constructor
43 : ore::data::Trade("FxKIKOBarrierOption"), FxSingleAssetDerivative(""),
44 boughtAmount_(0.0), soldAmount_(0.0) {}
45 //! Constructor
47 double boughtAmount, string soldCurrency, double soldAmount, string startDate = "",
48 string calendar = "", string fxIndex = "")
49 : ore::data::Trade("FxKIKOBarrierOption", 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 const vector<BarrierData>& barriers() const { return barriers_; }
61 double boughtAmount() const { return boughtAmount_; }
62 double soldAmount() const { return soldAmount_; }
63 const string& startDate() const { return startDate_; }
64 const string& calendar() const { return calendar_; }
65 const string& fxIndex() const { return fxIndex_; }
66 //@}
67
68 //! \name Serialisation
69 //@{
70 virtual void fromXML(XMLNode* node) override;
71 virtual XMLNode* toXML(XMLDocument& doc) const override;
72 //@}
73private:
74 bool checkBarrier(Real spot, Barrier::Type type, Real level);
76 vector<BarrierData> barriers_;
77 string startDate_;
78 string calendar_;
79 string fxIndex_;
82};
83} // namespace data
84} // namespace oreplus
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Serializable FX KIKO Barrier Option.
const OptionData & option() const
const vector< BarrierData > & barriers() const
FxKIKOBarrierOption(Envelope &env, OptionData option, vector< BarrierData > barriers, string boughtCurrency, double boughtAmount, string soldCurrency, double soldAmount, string startDate="", string calendar="", string fxIndex="")
Constructor.
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
bool checkBarrier(Real spot, Barrier::Type type, Real level)
FxKIKOBarrierOption()
Default 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 & soldCurrency() const
const std::string & boughtCurrency() 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