Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
basketvarianceswap.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/europeanoptionbarrier.hpp
20 \brief European option with barrier wrapper for scripted trade
21 \ingroup portfolio
22*/
23
24#pragma once
25
28
29namespace ore {
30namespace data {
31
32using namespace ore::data;
33
35public:
36 explicit BasketVarianceSwap(const string& tradeType = "BasketVarianceSwap") : ScriptedTrade(tradeType) {}
37 BasketVarianceSwap(const Envelope& env, const string& longShort, const string& notional, const string& strike,
38 const string& currency, const string& cap, const string& floor, const string& settlementDate,
39 const ScheduleData& valuationSchedule, bool squaredPayoff,
40 const vector<QuantLib::ext::shared_ptr<Underlying>> underlyings)
41 : longShort_(longShort), notional_(notional), strike_(strike), currency_(currency), cap_(cap), floor_(floor),
42 settlementDate_(settlementDate), valuationSchedule_(valuationSchedule), squaredPayoff_(squaredPayoff),
43 underlyings_(underlyings) {
45 }
46 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
47 // This is called within ScriptedTrade::build()
48 void setIsdaTaxonomyFields() override;
49 void fromXML(XMLNode* node) override;
50 XMLNode* toXML(XMLDocument& doc) const override;
51
52private:
53 void initIndices();
54
59 vector<QuantLib::ext::shared_ptr<Underlying>> underlyings_;
60};
61
63public:
64 EquityBasketVarianceSwap() : BasketVarianceSwap("EquityBasketVarianceSwap") {}
65};
66
68public:
69 FxBasketVarianceSwap() : BasketVarianceSwap("FxBasketVarianceSwap") {}
70};
71
73public:
74 CommodityBasketVarianceSwap() : BasketVarianceSwap("CommodityBasketVarianceSwap") {}
75};
76
77} // namespace data
78} // namespace ore
vector< QuantLib::ext::shared_ptr< Underlying > > underlyings_
BasketVarianceSwap(const string &tradeType="BasketVarianceSwap")
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
BasketVarianceSwap(const Envelope &env, const string &longShort, const string &notional, const string &strike, const string &currency, const string &cap, const string &floor, const string &settlementDate, const ScheduleData &valuationSchedule, bool squaredPayoff, const vector< QuantLib::ext::shared_ptr< Underlying > > underlyings)
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Serializable schedule data.
Definition: schedule.hpp:202
QuantLib::Real notional() const override
Return the current notional in npvCurrency. See individual sub-classes for the precise definition.
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