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 qle/instruments/equityforward.hpp
20\brief equityforward instrument
21
22\ingroup instruments
23*/
24
25#ifndef quantext_equity_forward_hpp
26#define quantext_equity_forward_hpp
27
28#include <ql/currency.hpp>
29#include <ql/exchangerate.hpp>
30#include <ql/instrument.hpp>
31#include <ql/money.hpp>
32#include <ql/position.hpp>
33#include <ql/quote.hpp>
34
35namespace QuantExt {
36using namespace QuantLib;
37
38/*! This class holds the term sheet data for an Equity Forward instrument.
39
40\ingroup instruments
41*/
42class EquityForward : public Instrument {
43public:
44 class arguments;
45 class engine;
46 //! \name Constructors
47 //@{
48 EquityForward( //! Equity Name
49 const std::string& name,
50 //! Currency
51 const Currency& currency,
52 //! if true, we are long the forward
53 const Position::Type& longShort,
54 //! Quantity (number of lots \f$times\f$ lot size)
55 const Real& quantity,
56 //! Maturity date
57 const Date& maturityDate,
58 //! Strike
59 const Real& strike);
60 //! \name Instrument interface
61 //@{
62 bool isExpired() const override;
63 void setupArguments(PricingEngine::arguments*) const override;
64 //@}
65
66 //! \name Additional interface
67 //@{
68 const std::string& name() const { return name_; }
69 Currency currency() const { return currency_; }
70 Position::Type longShort() const { return longShort_; }
71 Real quantity() const { return quantity_; }
72 Date maturityDate() const { return maturityDate_; }
73 Real strike() const { return strike_; }
74 //@}
75private:
76 // data members
77 std::string name_;
78 Currency currency_;
79 Position::Type longShort_;
82 Real strike_;
83};
84
85//! \ingroup instruments
87public:
88 std::string name;
89 Currency currency;
90 Position::Type longShort;
93 Real strike;
94 void validate() const override;
95};
96
97//! \ingroup instruments
98class EquityForward::engine : public GenericEngine<EquityForward::arguments, Instrument::results> {};
99} // namespace QuantExt
100
101#endif
const std::string & name() const
void setupArguments(PricingEngine::arguments *) const override
bool isExpired() const override
Position::Type longShort_
Position::Type longShort() const
Currency currency() const