Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
zerofixedcoupon.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 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 zerofixedcoupon.hpp
20 \brief Nominal flow associated with a floating annuity coupon
21 \ingroup cashflows
22*/
23
24#ifndef quantext_zero_fixed_coupon_hpp
25#define quantext_zero_fixed_coupon_hpp
26
27#include <ql/cashflows/coupon.hpp>
28#include <ql/time/schedule.hpp>
29#include <ql/time/businessdayconvention.hpp>
30#include <ql/time/daycounter.hpp>
31#include <ql/patterns/visitor.hpp>
32#include <ql/compounding.hpp>
33#include <vector>
34
35namespace QuantExt {
36
37using namespace QuantLib;
38
39//! \ingroup cashflows
40class ZeroFixedCoupon : public Coupon {
41public:
42 ZeroFixedCoupon(const Date& paymentDate,
43 double notional,
44 double rate,
45 const DayCounter& dc,
46 const std::vector<Date>& dates,
47 const Compounding& comp,
48 bool subtractNotional);
49
50 //! \name Coupon interface
51 //@{
52 Real amount() const override;
53 Real nominal() const override;
54 Real rate() const override;
55 DayCounter dayCounter() const override;
56 Real accruedAmount(const Date& accrualEnd) const override;
57 //@}
58
59 //! \name Visitability
60 //@{
61 void accept(AcyclicVisitor&) override;
62 //@}
63
64private:
65
66 double notional_;
67 double rate_;
68 DayCounter dc_;
69 std::vector<Date> dates_;
70 Compounding comp_;
72
73 double amount_;
74};
75
76} // namespace QuantExt
77
78#endif
std::vector< Date > dates_
Real amount() const override
void accept(AcyclicVisitor &) override
Real nominal() const override
DayCounter dayCounter() const override
Real accruedAmount(const Date &accrualEnd) const override
Real rate() const override