Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
equityforward.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/equityforward.hpp
20\brief Equity Forward data model and serialization
21\ingroup tradedata
22*/
23
24#pragma once
25
29
30namespace ore {
31namespace data {
32using std::string;
33
34//! Serializable Equity Forward contract
35/*!
36\ingroup tradedata
37*/
38class EquityForward : public Trade {
39public:
40 EquityForward() : Trade("EquityForward"), quantity_(0.0), strike_(0.0) {}
41 EquityForward(Envelope& env, string longShort, EquityUnderlying equityUnderlying, string currency,
42 QuantLib::Real quantity, string maturityDate, QuantLib::Real strike, string strikeCurrency = "")
43 : Trade("EquityForward", env), longShort_(longShort), equityUnderlying_(equityUnderlying), currency_(currency),
45
46 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
47
48 //! Add underlying Equity names
49 std::map<AssetClass, std::set<std::string>>
50 underlyingIndices(const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager = nullptr) const override;
51
52 string longShort() { return longShort_; }
53 const string& eqName() const { return equityUnderlying_.name(); }
54 string currency() { return currency_; }
55 double quantity() { return quantity_; }
56 string maturityDate() { return maturityDate_; }
57 double strike() { return strike_; }
58 string strikeCurrency() { return strikeCurrency_; }
59
60 virtual void fromXML(XMLNode* node) override;
61 virtual XMLNode* toXML(XMLDocument& doc) const override;
62
63private:
64 string longShort_;
66 string currency_;
67 QuantLib::Real quantity_;
69 QuantLib::Real strike_;
71};
72} // namespace data
73} // namespace ore
Position::Type longShort_
Date maturityDate() const
Position::Type longShort() const
Currency currency() const
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
const string & eqName() const
EquityForward(Envelope &env, string longShort, EquityUnderlying equityUnderlying, string currency, QuantLib::Real quantity, string maturityDate, QuantLib::Real strike, string strikeCurrency="")
EquityUnderlying equityUnderlying_
const std::string & name() const override
Definition: underlying.hpp:109
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
trade option data model and serialization
base trade data model and serialization
underlying data model