Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
doubledigitaloption.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/doubledigitaloption.hpp
20 \brief double digital option wrapper for scripted trade
21 \ingroup portfolio
22*/
23
24#pragma once
25
27
29
30namespace ore {
31namespace data {
32
33using namespace ore::data;
34
36public:
37 DoubleDigitalOption() : ScriptedTrade("DoubleDigitalOption") {}
38 DoubleDigitalOption(const Envelope& env, const string& expiry, const string& settlement, const string& binaryPayout,
39 const string& binaryLevel1, const string& binaryLevel2, const string& type1,
40 const string& type2, const string& position,
41 const QuantLib::ext::shared_ptr<Underlying>& underlying1,
42 const QuantLib::ext::shared_ptr<Underlying>& underlying2,
43 const QuantLib::ext::shared_ptr<Underlying>& underlying3,
44 const QuantLib::ext::shared_ptr<Underlying>& underlying4, const string& payCcy,
45 const QuantLib::ext::shared_ptr<Conventions>& conventions = nullptr,
46 const std::string& binaryLevelUpper1 = std::string(),
47 const std::string& binaryLevelUpper2 = std::string())
48 : ScriptedTrade("DoubleDigitalOption", env), expiry_(expiry), settlement_(settlement),
49 binaryPayout_(binaryPayout), binaryLevel1_(binaryLevel1), binaryLevel2_(binaryLevel2), type1_(type1),
50 type2_(type2), position_(position), payCcy_(payCcy), binaryLevelUpper1_(binaryLevelUpper1),
51 binaryLevelUpper2_(binaryLevelUpper2), underlying1_(underlying1),
52 underlying2_(underlying2), underlying3_(underlying3), underlying4_(underlying4) {
54 }
55 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
56 void fromXML(XMLNode* node) override;
57 XMLNode* toXML(XMLDocument& doc) const override;
58
59private:
60 void initIndices();
63 QuantLib::ext::shared_ptr<Underlying> underlying1_, underlying2_, underlying3_, underlying4_;
64};
65
66} // namespace data
67} // namespace ore
QuantLib::ext::shared_ptr< Underlying > underlying4_
QuantLib::ext::shared_ptr< Underlying > underlying1_
QuantLib::ext::shared_ptr< Underlying > underlying3_
DoubleDigitalOption(const Envelope &env, const string &expiry, const string &settlement, const string &binaryPayout, const string &binaryLevel1, const string &binaryLevel2, const string &type1, const string &type2, const string &position, const QuantLib::ext::shared_ptr< Underlying > &underlying1, const QuantLib::ext::shared_ptr< Underlying > &underlying2, const QuantLib::ext::shared_ptr< Underlying > &underlying3, const QuantLib::ext::shared_ptr< Underlying > &underlying4, const string &payCcy, const QuantLib::ext::shared_ptr< Conventions > &conventions=nullptr, const std::string &binaryLevelUpper1=std::string(), const std::string &binaryLevelUpper2=std::string())
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
QuantLib::ext::shared_ptr< Underlying > underlying2_
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
scripted trade data model
base trade data model and serialization