QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
overnightindexedswap.hpp
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
27#ifndef quantlib_overnight_indexed_swap_hpp
28#define quantlib_overnight_indexed_swap_hpp
29
30#include <ql/cashflows/rateaveraging.hpp>
31#include <ql/instruments/fixedvsfloatingswap.hpp>
32#include <ql/time/businessdayconvention.hpp>
33#include <ql/time/calendar.hpp>
34#include <ql/time/daycounter.hpp>
35#include <ql/time/schedule.hpp>
36
37namespace QuantLib {
38
39 class OvernightIndex;
40
43 public:
46 const Schedule& schedule,
48 DayCounter fixedDC,
49 const ext::shared_ptr<OvernightIndex>& overnightIndex,
50 Spread spread = 0.0,
51 Natural 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 Natural 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 Natural 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 Natural paymentLag = 0,
94 BusinessDayConvention paymentAdjustment = Following,
95 const Calendar& paymentCalendar = Calendar(),
96 bool telescopicValueDates = false,
98
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
113
115
116 Real overnightLegBPS() const { return floatingLegBPS(); }
117 Real overnightLegNPV() const { return floatingLegNPV(); }
119 private:
120 void setupFloatingArguments(arguments* args) const override;
121
122 ext::shared_ptr<OvernightIndex> overnightIndex_;
124 };
125
126}
127
128#endif
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
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
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