Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
windowbarrieroption.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2023 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/windowbarrieroption.hpp
20 \brief window barrier option - wrapper for scripted trade
21 \ingroup portfolio
22*/
23
24#pragma once
25
32
33namespace ore {
34namespace data {
35
37public:
38 explicit WindowBarrierOption(const std::string& tradeType = "WindowBarrierOption") : ScriptedTrade(tradeType) {}
39 WindowBarrierOption(const std::string& currency, const std::string& fixingAmount, const TradeStrike& strike,
40 const QuantLib::ext::shared_ptr<Underlying>& underlying, const std::string& startDate,
41 const std::string& endDate, const OptionData& optionData, const BarrierData& barrier)
42 : currency_(currency), fixingAmount_(fixingAmount), strike_(strike), underlying_(underlying),
43 startDate_(startDate), endDate_(endDate), optionData_(optionData), barrier_(barrier) {
45 }
46 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
47 void setIsdaTaxonomyFields() override;
48 void fromXML(XMLNode* node) override;
49 XMLNode* toXML(XMLDocument& doc) const override;
50
51 //! \name Inspectors
52 //@{
53 const std::string& name() const { return underlying_->name(); }
54 //@}
55
56private:
57 void initIndices();
60 QuantLib::ext::shared_ptr<Underlying> underlying_;
61 std::string startDate_, endDate_;
64};
65
67public:
68 EquityWindowBarrierOption() : WindowBarrierOption("EquityWindowBarrierOption") {}
69};
70
72public:
73 FxWindowBarrierOption() : WindowBarrierOption("FxWindowBarrierOption") {}
74};
75
77public:
78 CommodityWindowBarrierOption() : WindowBarrierOption("CommodityWindowBarrierOption") {}
79};
80
81} // namespace data
82} // namespace ore
Serializable obejct holding barrier data.
Definition: barrierdata.hpp:34
Serializable object holding option data.
Definition: optiondata.hpp:42
const string & tradeType() const
Definition: trade.hpp:133
const std::string & name() const
WindowBarrierOption(const std::string &tradeType="WindowBarrierOption")
void fromXML(XMLNode *node) override
QuantLib::ext::shared_ptr< Underlying > underlying_
XMLNode * toXML(XMLDocument &doc) const override
WindowBarrierOption(const std::string &currency, const std::string &fixingAmount, const TradeStrike &strike, const QuantLib::ext::shared_ptr< Underlying > &underlying, const std::string &startDate, const std::string &endDate, const OptionData &optionData, const BarrierData &barrier)
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization
scripted trade data model
base trade data model and serialization
underlying data model