Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
paymentdiscountingengine.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 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/pricingengines/paymentdiscountingengine.hpp
20 \brief Single payment discounting engine
21 \ingroup engines
22*/
23
24#ifndef quantext_payment_discounting_engine_hpp
25#define quantext_payment_discounting_engine_hpp
26
27#include <ql/termstructures/yieldtermstructure.hpp>
28
30
31namespace QuantExt {
32
33//! Payment discounting engine
34
35/*! This class implements a discounting engine for a single cash flow.
36 The cash flow is discounted using its currency's discount curve.
37 Optionally, the NPV is converted into a different NPV currency.
38 The FX spot rate for that purpose converts the in-currency NPV by multiplication.
39
40 \ingroup engines
41*/
43public:
44 //! \name Constructors
45 //@{
46 /*! \param discountCurve
47 Discount curve for the cash flow
48 \param spotFX
49 The market spot rate quote for multiplicative conversion into the NPV currency, can be empty
50 \param includeSettlementDateFlows, settlementDate
51 If includeSettlementDateFlows is true (false), cashflows
52 on the settlementDate are (not) included in the NPV.
53 If not given the settlement date is set to the
54 npv date.
55 \param npvDate
56 Discount to this date. If not given the npv date
57 is set to the evaluation date
58 */
59 PaymentDiscountingEngine(const Handle<YieldTermStructure>& discountCurve,
60 const Handle<Quote>& spotFX = Handle<Quote>(),
61 boost::optional<bool> includeSettlementDateFlows = boost::none,
62 const Date& settlementDate = Date(), const Date& npvDate = Date());
63 //@}
64
65 //! \name PricingEngine interface
66 //@{
67 void calculate() const override;
68 //@}
69
70 //! \name Inspectors
71 //@{
72 const Handle<YieldTermStructure>& discountCurve() const { return discountCurve_; }
73 const Handle<Quote>& spotFX() const { return spotFX_; }
74 //@}
75
76private:
77 Handle<YieldTermStructure> discountCurve_;
78 Handle<Quote> spotFX_;
79 boost::optional<bool> includeSettlementDateFlows_;
82};
83} // namespace QuantExt
84
85#endif
Handle< YieldTermStructure > discountCurve_
const Handle< Quote > & spotFX() const
boost::optional< bool > includeSettlementDateFlows_
const Handle< YieldTermStructure > & discountCurve() const
payment instrument