Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fxaverageforward.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 Skandinaviska Enskilda Banken AB (publ)
3 All rights reserved.
4 This file is part of ORE, a free-software/open-source library
5 for transparent pricing and risk analysis - http://opensourcerisk.org
6 ORE is free software: you can redistribute it and/or modify it
7 under the terms of the Modified BSD License. You should have received a
8 copy of the license along with this program.
9 The license is also available online at <http://opensourcerisk.org>
10 This program is distributed on the basis that it will form a useful
11 contribution to risk analytics and model standardisation, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
14 */
15
16 /*! \file portfolio/fxaverageforward.hpp
17 \brief Fx Average Forward data model and serialization
18 \ingroup tradedata
19 */
20
21 #pragma once
22
24
25 namespace ore {
26 namespace data {
27
28 //! Serializable Fx Average Forward
29 /*!
30 Payoff: (fixedPayer ? 1 : -1) * (referenceNotional * averageFX - settlementNotional)
31 \ingroup tradedata
32 */
33 class FxAverageForward : public Trade {
34 public:
35 //! Default constructor
36 FxAverageForward() : Trade("FxAverageForward") {}
37 //! Constructor
39 bool fixedPayer,
40 const std::string& referenceCurrency, double referenceNotional,
41 const std::string settlementCurrency, double settlementNotional,
42 const std::string& fxIndex, const string& settlement = "Cash")
43 : Trade("FxAverageForward", env),
48
49 //! Build QuantLib/QuantExt instrument, link pricing engine
50 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
51
52 //! \name Inspectors
53 //@{
55 const string& paymentDate() const { return paymentDate_; }
56 bool fixedPayer() const { return fixedPayer_; }
57 const string& referenceCurrency() const { return referenceCurrency_; }
58 double referenceNotional() const { return referenceNotional_; }
59 const string& settlementCurrency() const { return settlementCurrency_; }
60 double settlementNotional() const { return settlementNotional_; }
61 const std::string& fxIndex() const { return fxIndex_; }
62 const string& settlement() const { return settlement_; }
63 //@}
64
65 //! \name Serialisation
66 //@{
67 virtual void fromXML(XMLNode* node) override;
68 virtual XMLNode* toXML(XMLDocument& doc) const override;
69 //@}
70
71 const std::map<std::string,boost::any>& additionalData() const override;
72
73 private:
81 //! Needed for past fixings
82 std::string fxIndex_;
83 std::string settlement_;
84 bool inverted_ = false; // set during build()
85 };
86
87 } // namespace data
88 } // namespace ore
Asian option representation.
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Serializable Fx Average Forward.
FxAverageForward()
Default constructor.
const string & referenceCurrency() const
const string & settlement() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & paymentDate() const
FxAverageForward(const Envelope &env, const ScheduleData &observationDates, const string &paymentDate, bool fixedPayer, const std::string &referenceCurrency, double referenceNotional, const std::string settlementCurrency, double settlementNotional, const std::string &fxIndex, const string &settlement="Cash")
Constructor.
std::string fxIndex_
Needed for past fixings.
const string & settlementCurrency() const
const std::string & fxIndex() const
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Build QuantLib/QuantExt instrument, link pricing engine.
const std::map< std::string, boost::any > & additionalData() const override
returns all additional data returned by the trade once built
const ScheduleData & observationDates() const
Serializable schedule data.
Definition: schedule.hpp:202
Trade base class.
Definition: trade.hpp:55
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23