Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
worstofbasketswap.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 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
33public:
34 explicit WorstOfBasketSwap(const string& tradeType = "WorstOfBasketSwap") : ScriptedTrade(tradeType) {}
35 WorstOfBasketSwap(const Envelope& env, const string& longShort, const string& quantity, const string& strike,
36 const string& initialFixedRate, const vector<string>& initialPrices, const string& fixedRate,
37 const ScriptedTradeEventData& floatingPeriodSchedule,
38 const ScriptedTradeEventData& floatingFixingSchedule,
39 const ScriptedTradeEventData& fixedDeterminationSchedule,
40 const ScriptedTradeEventData& floatingPayDates, const ScriptedTradeEventData& fixedPayDates,
41 const ScriptedTradeEventData& knockOutDeterminationSchedule,
42 const ScriptedTradeEventData& knockInDeterminationSchedule, const string& knockInPayDate,
43 const string& initialFixedPayDate, const bool bermudanKnockIn,
44 const bool accumulatingFixedCoupons, const bool accruingFixedCoupons, const bool isAveraged,
45 const string& floatingIndex, const string& floatingSpread, const string& floatingRateCutoff,
46 // const string& inArrears,
47 const DayCounter& floatingDayCountFraction, const Period& floatingLookback,
48 const bool includeSpread, const string& currency,
49 const vector<QuantLib::ext::shared_ptr<Underlying>> underlyings, const string& knockInLevel,
50 const vector<string> fixedTriggerLevels, const vector<string> knockOutLevels,
51 const ScriptedTradeEventData& fixedAccrualSchedule)
52 : longShort_(longShort), quantity_(quantity), strike_(strike), initialFixedRate_(initialFixedRate),
53 initialPrices_(initialPrices), fixedRate_(fixedRate), floatingPeriodSchedule_(floatingPeriodSchedule),
54 floatingFixingSchedule_(floatingFixingSchedule), fixedDeterminationSchedule_(fixedDeterminationSchedule),
55 knockOutDeterminationSchedule_(knockOutDeterminationSchedule), floatingPayDates_(floatingPayDates),
56 knockInDeterminationSchedule_(knockInDeterminationSchedule), fixedPayDates_(fixedPayDates),
57 knockInPayDate_(knockInPayDate), initialFixedPayDate_(initialFixedPayDate), bermudanKnockIn_(bermudanKnockIn),
58 accumulatingFixedCoupons_(accumulatingFixedCoupons), accruingFixedCoupons_(accruingFixedCoupons),
59 isAveraged_(isAveraged), floatingIndex_(floatingIndex), floatingSpread_(floatingSpread),
60 floatingRateCutoff_(floatingRateCutoff), // inArrears_(inArrears),
61 floatingDayCountFraction_(floatingDayCountFraction), floatingLookback_(floatingLookback),
62 includeSpread_(includeSpread), currency_(currency), underlyings_(underlyings), knockInLevel_(knockInLevel),
63 fixedTriggerLevels_(fixedTriggerLevels), knockOutLevels_(knockOutLevels),
64 fixedAccrualSchedule_(fixedAccrualSchedule) {
66 }
67 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
68 void setIsdaTaxonomyFields() override;
69 void fromXML(XMLNode* node) override;
70 XMLNode* toXML(XMLDocument& doc) const override;
71
72private:
73 void initIndices();
74
76 vector<string> initialPrices_;
77 string fixedRate_;
86 string currency_;
87 vector<QuantLib::ext::shared_ptr<Underlying>> underlyings_;
91 // <scheduleName, <stEventData, fallbackSchedule> >
92 map<string, pair<ScriptedTradeEventData, string>> schedules_;
93};
94
96public:
97 EquityWorstOfBasketSwap() : WorstOfBasketSwap("EquityWorstOfBasketSwap") {}
98};
99
101public:
102 FxWorstOfBasketSwap() : WorstOfBasketSwap("FxWorstOfBasketSwap") {}
103};
104
106public:
107 CommodityWorstOfBasketSwap() : WorstOfBasketSwap("CommodityWorstOfBasketSwap") {}
108};
109
110} // namespace data
111} // namespace ore
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
const string & tradeType() const
Definition: trade.hpp:133
vector< QuantLib::ext::shared_ptr< Underlying > > underlyings_
map< string, pair< ScriptedTradeEventData, string > > schedules_
ScriptedTradeEventData floatingPeriodSchedule_
ScriptedTradeEventData fixedDeterminationSchedule_
ScriptedTradeEventData floatingFixingSchedule_
void fromXML(XMLNode *node) override
ScriptedTradeEventData fixedAccrualSchedule_
XMLNode * toXML(XMLDocument &doc) const override
ScriptedTradeEventData floatingPayDates_
WorstOfBasketSwap(const string &tradeType="WorstOfBasketSwap")
ScriptedTradeEventData knockOutDeterminationSchedule_
WorstOfBasketSwap(const Envelope &env, const string &longShort, const string &quantity, const string &strike, const string &initialFixedRate, const vector< string > &initialPrices, const string &fixedRate, const ScriptedTradeEventData &floatingPeriodSchedule, const ScriptedTradeEventData &floatingFixingSchedule, const ScriptedTradeEventData &fixedDeterminationSchedule, const ScriptedTradeEventData &floatingPayDates, const ScriptedTradeEventData &fixedPayDates, const ScriptedTradeEventData &knockOutDeterminationSchedule, const ScriptedTradeEventData &knockInDeterminationSchedule, const string &knockInPayDate, const string &initialFixedPayDate, const bool bermudanKnockIn, const bool accumulatingFixedCoupons, const bool accruingFixedCoupons, const bool isAveraged, const string &floatingIndex, const string &floatingSpread, const string &floatingRateCutoff, const DayCounter &floatingDayCountFraction, const Period &floatingLookback, const bool includeSpread, const string &currency, const vector< QuantLib::ext::shared_ptr< Underlying > > underlyings, const string &knockInLevel, const vector< string > fixedTriggerLevels, const vector< string > knockOutLevels, const ScriptedTradeEventData &fixedAccrualSchedule)
ScriptedTradeEventData fixedPayDates_
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
ScriptedTradeEventData knockInDeterminationSchedule_
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