Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
tarf.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 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/tarf.hpp
20 \brief tarf wrapper for scripted trade
21 \ingroup portfolio
22*/
23
24#pragma once
25
30
33
34namespace ore {
35namespace data {
36
37class TaRF : public ScriptedTrade {
38public:
39 explicit TaRF(const std::string& tradeType = "TaRF") : ScriptedTrade(tradeType) {}
40 TaRF(const std::string& currency, const std::string& fixingAmount, const std::string& targetAmount,
41 const std::string& targetPoints, const std::vector<std::string>& strikes,
42 const std::vector<std::string>& strikeDates, const QuantLib::ext::shared_ptr<Underlying>& underlying,
43 const ScheduleData& fixingDates, const std::string& settlementLag, const std::string& settlementCalendar,
44 const std::string& settlementConvention, OptionData& optionData,
45 const std::vector<std::vector<RangeBound>>& rangeBoundSet, const std::vector<std::string>& rangeBoundSetDates,
46 const std::vector<BarrierData>& barriers);
47 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) 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();
59 std::vector<std::string> strikes_, strikeDates_;
60 QuantLib::ext::shared_ptr<Underlying> underlying_;
64 std::vector<std::vector<RangeBound>> rangeBoundSet_;
65 std::vector<std::string> rangeBoundSetDates_;
66 std::vector<BarrierData> barriers_;
67};
68
69class EquityTaRF : public TaRF {
70public:
71 EquityTaRF() : TaRF("EquityTaRF") {}
72};
73
74class FxTaRF : public TaRF {
75public:
76 explicit FxTaRF() : TaRF("FxTaRF") {}
77};
78
79class CommodityTaRF : public TaRF {
80public:
81 explicit CommodityTaRF() : TaRF("CommodityTaRF") {}
82};
83
84} // namespace data
85} // namespace ore
Serializable object holding option data.
Definition: optiondata.hpp:42
Serializable schedule data.
Definition: schedule.hpp:202
std::string settlementConvention_
Definition: tarf.hpp:62
void initIndices()
Definition: tarf.cpp:433
const std::string & name() const
Definition: tarf.hpp:53
OptionData optionData_
Definition: tarf.hpp:63
std::vector< std::string > strikeDates_
Definition: tarf.hpp:59
std::string currency_
Definition: tarf.hpp:58
std::vector< std::string > strikes_
Definition: tarf.hpp:59
ScheduleData fixingDates_
Definition: tarf.hpp:61
void fromXML(XMLNode *node) override
Definition: tarf.cpp:435
QuantLib::ext::shared_ptr< Underlying > underlying_
Definition: tarf.hpp:60
XMLNode * toXML(XMLDocument &doc) const override
Definition: tarf.cpp:493
TaRF(const std::string &tradeType="TaRF")
Definition: tarf.hpp:39
std::string settlementLag_
Definition: tarf.hpp:62
std::string targetAmount_
Definition: tarf.hpp:58
std::string targetPoints_
Definition: tarf.hpp:58
std::vector< BarrierData > barriers_
Definition: tarf.hpp:66
std::vector< std::string > rangeBoundSetDates_
Definition: tarf.hpp:65
std::vector< std::vector< RangeBound > > rangeBoundSet_
Definition: tarf.hpp:64
std::string fixingAmount_
Definition: tarf.hpp:58
std::string settlementCalendar_
Definition: tarf.hpp:62
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Definition: tarf.cpp:268
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
trade option data model and serialization
rangebound data model
scripted trade data model
base trade data model and serialization
underlying data model