Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
knockoutswap.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 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/knockoutswap.hpp
20 \brief knock out swap wrapper for scripted trade
21 \ingroup portfolio
22*/
23
24#pragma once
25
27
30
31namespace ore {
32namespace data {
33
34using namespace ore::data;
35
37public:
38 explicit KnockOutSwap(const std::string& tradeType = "KnockOutSwap") : ScriptedTrade(tradeType) {}
39 KnockOutSwap(const std::vector<LegData>& legData, const BarrierData& barrierData,
40 const std::string& barrierStartDate)
41 : legData_(legData), barrierData_(barrierData), barrierStartDate_(barrierStartDate) {}
42 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
43 void fromXML(XMLNode* node) override;
44 XMLNode* toXML(XMLDocument& doc) const override;
45
46private:
47 std::vector<LegData> legData_;
49 std::string barrierStartDate_;
50};
51
52} // namespace data
53} // namespace ore
Serializable obejct holding barrier data.
Definition: barrierdata.hpp:34
KnockOutSwap(const std::vector< LegData > &legData, const BarrierData &barrierData, const std::string &barrierStartDate)
KnockOutSwap(const std::string &tradeType="KnockOutSwap")
std::vector< LegData > legData_
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
std::string barrierStartDate_
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
const string & tradeType() const
Definition: trade.hpp:133
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