QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
overnightindexedswap.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2009 Roland Lichters
5 Copyright (C) 2009 Ferdinando Ametrano
6 Copyright (C) 2017 Joseph Jeisman
7 Copyright (C) 2017 Fabrice Lecuyer
8
9 This file is part of QuantLib, a free-software/open-source library
10 for financial quantitative analysts and developers - http://quantlib.org/
11
12 QuantLib is free software: you can redistribute it and/or modify it
13 under the terms of the QuantLib license. You should have received a
14 copy of the license along with this program; if not, please email
15 <quantlib-dev@lists.sf.net>. The license is also available online at
16 <http://quantlib.org/license.shtml>.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the license for more details.
21*/
22
23/*! \file overnightindexedswap.hpp
24 \brief Overnight index swap paying compounded overnight vs. fixed
25*/
26
27#ifndef quantlib_overnight_indexed_swap_hpp
28#define quantlib_overnight_indexed_swap_hpp
29
33#include <ql/time/calendar.hpp>
35#include <ql/time/schedule.hpp>
36
37namespace QuantLib {
38
39 class OvernightIndex;
40
41 //! Overnight indexed swap: fix vs compounded overnight rate
43 public:
46 const Schedule& schedule,
48 DayCounter fixedDC,
49 const ext::shared_ptr<OvernightIndex>& overnightIndex,
50 Spread spread = 0.0,
51 Integer paymentLag = 0,
52 BusinessDayConvention paymentAdjustment = Following,
53 const Calendar& paymentCalendar = Calendar(),
54 bool telescopicValueDates = false,
56
58 const std::vector<Real>& nominals,
59 const Schedule& schedule,
61 DayCounter fixedDC,
62 const ext::shared_ptr<OvernightIndex>& overnightIndex,
63 Spread spread = 0.0,
64 Integer paymentLag = 0,
65 BusinessDayConvention paymentAdjustment = Following,
66 const Calendar& paymentCalendar = Calendar(),
67 bool telescopicValueDates = false,
69
74 DayCounter fixedDC,
76 const ext::shared_ptr<OvernightIndex>& overnightIndex,
77 Spread spread = 0.0,
78 Integer paymentLag = 0,
79 BusinessDayConvention paymentAdjustment = Following,
80 const Calendar& paymentCalendar = Calendar(),
81 bool telescopicValueDates = false,
83
85 std::vector<Real> fixedNominals,
88 DayCounter fixedDC,
89 const std::vector<Real>& overnightNominals,
91 const ext::shared_ptr<OvernightIndex>& overnightIndex,
92 Spread spread = 0.0,
93 Integer paymentLag = 0,
94 BusinessDayConvention paymentAdjustment = Following,
95 const Calendar& paymentCalendar = Calendar(),
96 bool telescopicValueDates = false,
98
99 //! \name Inspectors
100 //@{
102 return std::max(fixedSchedule().tenor().frequency(),
103 floatingSchedule().tenor().frequency());
104 }
105
106 const std::vector<Real>& overnightNominals() const { return floatingNominals(); }
107 const Schedule& overnightSchedule() const { return floatingSchedule(); }
108 const ext::shared_ptr<OvernightIndex>& overnightIndex() const { return overnightIndex_; }
109 const Leg& overnightLeg() const { return floatingLeg(); }
110
112 //@}
113
114 //! \name Results
115 //@{
116 Real overnightLegBPS() const { return floatingLegBPS(); }
117 Real overnightLegNPV() const { return floatingLegNPV(); }
118 //@}
119 private:
120 void setupFloatingArguments(arguments* args) const override;
121
122 ext::shared_ptr<OvernightIndex> overnightIndex_;
124 };
125
126}
127
128#endif
BusinessDayConvention enumeration.
calendar class
calendar class
Definition: calendar.hpp:61
day counter class
Definition: daycounter.hpp:44
const std::vector< Real > & fixedNominals() const
const Schedule & fixedSchedule() const
const Schedule & floatingSchedule() const
const std::vector< Real > & nominals() const
const std::vector< Real > & floatingNominals() const
Overnight indexed swap: fix vs compounded overnight rate.
ext::shared_ptr< OvernightIndex > overnightIndex_
void setupFloatingArguments(arguments *args) const override
const ext::shared_ptr< OvernightIndex > & overnightIndex() const
const std::vector< Real > & overnightNominals() const
const Schedule & overnightSchedule() const
RateAveraging::Type averagingMethod() const
Payment schedule.
Definition: schedule.hpp:40
day counter class
Fixed-rate vs floating-rate swap.
Frequency
Frequency of events.
Definition: frequency.hpp:37
BusinessDayConvention
Business Day conventions.
QL_REAL Real
real number
Definition: types.hpp:50
QL_INTEGER Integer
integer number
Definition: types.hpp:35
Real Spread
spreads on interest rates
Definition: types.hpp:74
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
Definition: cashflow.hpp:78
rate-averaging method
date schedule