QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
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,
58 bool applyObservationShift = false);
59
61 const std::vector<Real>& nominals,
62 const Schedule& schedule,
64 DayCounter fixedDC,
65 const ext::shared_ptr<OvernightIndex>& overnightIndex,
66 Spread spread = 0.0,
67 Integer paymentLag = 0,
68 BusinessDayConvention paymentAdjustment = Following,
69 const Calendar& paymentCalendar = Calendar(),
70 bool telescopicValueDates = false,
74 bool applyObservationShift = false);
75
80 DayCounter fixedDC,
82 const ext::shared_ptr<OvernightIndex>& overnightIndex,
83 Spread spread = 0.0,
84 Integer paymentLag = 0,
85 BusinessDayConvention paymentAdjustment = Following,
86 const Calendar& paymentCalendar = Calendar(),
87 bool telescopicValueDates = false,
91 bool applyObservationShift = false);
92
94 std::vector<Real> fixedNominals,
97 DayCounter fixedDC,
98 const std::vector<Real>& overnightNominals,
100 const ext::shared_ptr<OvernightIndex>& overnightIndex,
101 Spread spread = 0.0,
102 Integer paymentLag = 0,
103 BusinessDayConvention paymentAdjustment = Following,
104 const Calendar& paymentCalendar = Calendar(),
105 bool telescopicValueDates = false,
109 bool applyObservationShift = false);
110
111 //! \name Inspectors
112 //@{
114 return std::max(fixedSchedule().tenor().frequency(),
115 floatingSchedule().tenor().frequency());
116 }
117
118 const std::vector<Real>& overnightNominals() const { return floatingNominals(); }
119 const Schedule& overnightSchedule() const { return floatingSchedule(); }
120 const ext::shared_ptr<OvernightIndex>& overnightIndex() const { return overnightIndex_; }
121 const Leg& overnightLeg() const { return floatingLeg(); }
122
125 Natural lockoutDays() const { return lockoutDays_; }
127 //@}
128
129 //! \name Results
130 //@{
131 Real overnightLegBPS() const { return floatingLegBPS(); }
132 Real overnightLegNPV() const { return floatingLegNPV(); }
133 //@}
134 private:
135 void setupFloatingArguments(arguments* args) const override;
136
137 ext::shared_ptr<OvernightIndex> overnightIndex_;
142 };
143
144}
145
146#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
template class providing a null value for a given type.
Definition: null.hpp:59
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
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
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:37
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
Definition: cashflow.hpp:78
rate-averaging method
date schedule