Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
floatingannuitynominal.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 floatingannuitynominal.hpp
20 \brief Nominal flow associated with a floating annuity coupon
21 \ingroup cashflows
22*/
23
24#ifndef quantext_floating_annuity_nominal_hpp
25#define quantext_floating_annuity_nominal_hpp
26
27#include <ql/cashflow.hpp>
29
30namespace QuantExt {
31using namespace QuantLib;
32
33//! Nominal flows associated with the FloatingAnnuityCoupon
34//! \ingroup cashflows
35class FloatingAnnuityNominal : public CashFlow {
36public:
37 FloatingAnnuityNominal(const QuantLib::ext::shared_ptr<FloatingAnnuityCoupon>& floatingAnnuityCoupon)
38 : coupon_(floatingAnnuityCoupon) {}
39
40 //! \name Cashflow interface
41 Rate amount() const override;
42 Date date() const override;
43
44private:
45 QuantLib::ext::shared_ptr<FloatingAnnuityCoupon> coupon_;
46};
47
48inline Date FloatingAnnuityNominal::date() const { return coupon_->accrualStartDate(); }
49
50inline Real FloatingAnnuityNominal::amount() const { return coupon_->previousNominal() - coupon_->nominal(); }
51
52Leg makeFloatingAnnuityNominalLeg(const Leg& floatingAnnuityLeg);
53
54} // namespace QuantExt
55
56#endif
QuantLib::ext::shared_ptr< FloatingAnnuityCoupon > coupon_
FloatingAnnuityNominal(const QuantLib::ext::shared_ptr< FloatingAnnuityCoupon > &floatingAnnuityCoupon)
Coupon paying a Libor-type index.
Leg makeFloatingAnnuityNominalLeg(const Leg &floatingAnnuityLeg)