Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fxforward.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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 portfolio/fxforward.hpp
20 \brief FX Forward data model and serialization
21 \ingroup tradedata
22*/
23
24#pragma once
25
28
29namespace ore {
30namespace data {
31
32//! Serializable FX Forward
33/*!
34 \ingroup tradedata
35*/
36class FxForward : public Trade {
37public:
38 //! Default constructor
39 FxForward() : Trade("FxForward"), boughtAmount_(0.0), soldAmount_(0.0) {}
40 //! Constructor
41 FxForward(const Envelope& env, const string& maturityDate, const string& boughtCurrency, double boughtAmount,
42 const string& soldCurrency, double soldAmount, const string& settlement = "Physical",
43 const string& fxIndex = "", const string& payDate = "")
44 : Trade("FxForward", env), maturityDate_(maturityDate), boughtCurrency_(boughtCurrency),
45 boughtAmount_(boughtAmount), soldCurrency_(soldCurrency), soldAmount_(soldAmount), settlement_(settlement),
47
48 bool isExpired(const Date& d) override;
49
50 //! Build QuantLib/QuantExt instrument, link pricing engine
51 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
52 QuantLib::Real notional() const override;
53 std::string notionalCurrency() const override;
54
55 //! \name Inspectors
56 //@{
57 const string& maturityDate() const { return maturityDate_; }
58 const string& boughtCurrency() const { return boughtCurrency_; }
59 double boughtAmount() const { return boughtAmount_; }
60 const string& soldCurrency() const { return soldCurrency_; }
61 double soldAmount() const { return soldAmount_; }
62 //! Settlement Type can be set to "Cash" for NDF. Default value is "Physical"
63 const string& settlement() const { return settlement_; }
64 const string& fxIndex() const { return fxIndex_; }
65 const string& paymentDate() const { return payDate_; }
66 //@}
67
68 //! \name Serialisation
69 //@{
70 virtual void fromXML(XMLNode* node) override;
71 virtual XMLNode* toXML(XMLDocument& doc) const override;
72 //@}
73
74private:
82 string fxIndex_;
83 string payDate_;
84 string payLag_;
88};
89} // namespace data
90} // namespace ore
Date maturityDate() const
boost::shared_ptr< QuantExt::FxIndex > fxIndex() const
Date payDate() const
boost::shared_ptr< FxIndex > fxIndex_
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
std::string notionalCurrency() const override
Definition: fxforward.cpp:187
double soldAmount() const
Definition: fxforward.hpp:61
FxForward()
Default constructor.
Definition: fxforward.hpp:39
const string & soldCurrency() const
Definition: fxforward.hpp:60
QuantLib::Real notional() const override
Return the current notional in npvCurrency. See individual sub-classes for the precise definition.
Definition: fxforward.cpp:175
const string & settlement() const
Settlement Type can be set to "Cash" for NDF. Default value is "Physical".
Definition: fxforward.hpp:63
bool isExpired(const Date &d) override
const string & paymentDate() const
Definition: fxforward.hpp:65
const string & fxIndex() const
Definition: fxforward.hpp:64
FxForward(const Envelope &env, const string &maturityDate, const string &boughtCurrency, double boughtAmount, const string &soldCurrency, double soldAmount, const string &settlement="Physical", const string &fxIndex="", const string &payDate="")
Constructor.
Definition: fxforward.hpp:41
const string & boughtCurrency() const
Definition: fxforward.hpp:58
bool includeSettlementDateFlows_
Definition: fxforward.hpp:87
double boughtAmount() const
Definition: fxforward.hpp:59
const string & maturityDate() const
Definition: fxforward.hpp:57
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Build QuantLib/QuantExt instrument, link pricing engine.
Definition: fxforward.cpp:33
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
base trade data model and serialization
Trade Factory.