QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
makeois.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 Ferdinando Ametrano
5 Copyright (C) 2017 Joseph Jeisman
6 Copyright (C) 2017 Fabrice Lecuyer
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
22/*! \file makeois.hpp
23 \brief Helper class to instantiate overnight indexed swaps.
24*/
25
26#ifndef quantlib_makeois_hpp
27#define quantlib_makeois_hpp
28
32
33namespace QuantLib {
34
35 //! helper class
36 /*! This class provides a more comfortable way
37 to instantiate overnight indexed swaps.
38 */
39 class MakeOIS {
40 public:
41 MakeOIS(const Period& swapTenor,
42 const ext::shared_ptr<OvernightIndex>& overnightIndex,
43 Rate fixedRate = Null<Rate>(),
44 const Period& fwdStart = 0*Days);
45
46 operator OvernightIndexedSwap() const;
47 operator ext::shared_ptr<OvernightIndexedSwap>() const ;
48
49 MakeOIS& receiveFixed(bool flag = true);
52
53 MakeOIS& withSettlementDays(Natural settlementDays);
59
66 MakeOIS& withCalendar(const Calendar& cal);
69
76 MakeOIS& withEndOfMonth(bool flag = true);
77 MakeOIS& withFixedLegEndOfMonth(bool flag = true);
78 MakeOIS& withOvernightLegEndOfMonth(bool flag = true);
79
81
83
85 const Handle<YieldTermStructure>& discountingTermStructure);
86
87 MakeOIS &withTelescopicValueDates(bool telescopicValueDates);
88
90
92 const ext::shared_ptr<PricingEngine>& engine);
93 private:
95 ext::shared_ptr<OvernightIndex> overnightIndex_;
98
102
108
116
119
122
123 ext::shared_ptr<PricingEngine> engine_;
124
127 };
128
129}
130
131#endif
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Shared handle to an observable.
Definition: handle.hpp:41
helper class
Definition: makeois.hpp:39
Period swapTenor_
Definition: makeois.hpp:94
ext::shared_ptr< OvernightIndex > overnightIndex_
Definition: makeois.hpp:95
BusinessDayConvention paymentAdjustment_
Definition: makeois.hpp:106
BusinessDayConvention fixedConvention_
Definition: makeois.hpp:109
MakeOIS & withFixedLegRule(DateGeneration::Rule r)
Definition: makeois.cpp:245
bool telescopicValueDates_
Definition: makeois.hpp:125
MakeOIS & withPaymentAdjustment(BusinessDayConvention convention)
Definition: makeois.cpp:212
MakeOIS & withTerminationDateConvention(BusinessDayConvention bdc)
Definition: makeois.cpp:288
MakeOIS & withPaymentLag(Integer lag)
Definition: makeois.cpp:217
MakeOIS & withDiscountingTermStructure(const Handle< YieldTermStructure > &discountingTermStructure)
Definition: makeois.cpp:255
MakeOIS & withType(Swap::Type type)
Definition: makeois.cpp:171
MakeOIS & withSettlementDays(Natural settlementDays)
Definition: makeois.cpp:181
Calendar paymentCalendar_
Definition: makeois.hpp:105
DateGeneration::Rule overnightRule_
Definition: makeois.hpp:114
DayCounter fixedDayCount_
Definition: makeois.hpp:121
MakeOIS & receiveFixed(bool flag=true)
Definition: makeois.cpp:166
Period forwardStart_
Definition: makeois.hpp:97
MakeOIS & withPaymentFrequency(Frequency f)
Definition: makeois.cpp:198
bool overnightEndOfMonth_
Definition: makeois.hpp:115
MakeOIS & withFixedLegDayCount(const DayCounter &dc)
Definition: makeois.cpp:269
Integer paymentLag_
Definition: makeois.hpp:107
MakeOIS & withRule(DateGeneration::Rule r)
Definition: makeois.cpp:241
MakeOIS & withCalendar(const Calendar &cal)
Definition: makeois.cpp:227
MakeOIS & withPricingEngine(const ext::shared_ptr< PricingEngine > &engine)
Definition: makeois.cpp:263
MakeOIS & withFixedLegEndOfMonth(bool flag=true)
Definition: makeois.cpp:307
MakeOIS & withOvernightLegRule(DateGeneration::Rule r)
Definition: makeois.cpp:250
MakeOIS & withFixedLegConvention(BusinessDayConvention bdc)
Definition: makeois.cpp:278
BusinessDayConvention overnightConvention_
Definition: makeois.hpp:111
Frequency fixedPaymentFrequency_
Definition: makeois.hpp:103
MakeOIS & withOvernightLegTerminationDateConvention(BusinessDayConvention bdc)
Definition: makeois.cpp:298
MakeOIS & withFixedLegTerminationDateConvention(BusinessDayConvention bdc)
Definition: makeois.cpp:293
Frequency overnightPaymentFrequency_
Definition: makeois.hpp:104
Natural settlementDays_
Definition: makeois.hpp:99
RateAveraging::Type averagingMethod_
Definition: makeois.hpp:126
BusinessDayConvention overnightTerminationDateConvention_
Definition: makeois.hpp:112
MakeOIS & withFixedLegCalendar(const Calendar &cal)
Definition: makeois.cpp:231
MakeOIS & withPaymentCalendar(const Calendar &cal)
Definition: makeois.cpp:222
DateGeneration::Rule fixedRule_
Definition: makeois.hpp:113
MakeOIS & withTerminationDate(const Date &)
Definition: makeois.cpp:192
MakeOIS & withEffectiveDate(const Date &)
Definition: makeois.cpp:187
MakeOIS & withOvernightLegSpread(Spread sp)
Definition: makeois.cpp:319
ext::shared_ptr< PricingEngine > engine_
Definition: makeois.hpp:123
Calendar overnightCalendar_
Definition: makeois.hpp:101
Swap::Type type_
Definition: makeois.hpp:117
MakeOIS & withEndOfMonth(bool flag=true)
Definition: makeois.cpp:303
MakeOIS & withOvernightLegPaymentFrequency(Frequency f)
Definition: makeois.cpp:207
MakeOIS & withFixedLegPaymentFrequency(Frequency f)
Definition: makeois.cpp:202
BusinessDayConvention fixedTerminationDateConvention_
Definition: makeois.hpp:110
MakeOIS & withNominal(Real n)
Definition: makeois.cpp:176
MakeOIS & withAveragingMethod(RateAveraging::Type averagingMethod)
Definition: makeois.cpp:329
MakeOIS & withTelescopicValueDates(bool telescopicValueDates)
Definition: makeois.cpp:324
MakeOIS & withConvention(BusinessDayConvention bdc)
Definition: makeois.cpp:274
MakeOIS & withOvernightLegConvention(BusinessDayConvention bdc)
Definition: makeois.cpp:283
Spread overnightSpread_
Definition: makeois.hpp:120
Calendar fixedCalendar_
Definition: makeois.hpp:101
MakeOIS & withOvernightLegCalendar(const Calendar &cal)
Definition: makeois.cpp:236
MakeOIS & withOvernightLegEndOfMonth(bool flag=true)
Definition: makeois.cpp:313
template class providing a null value for a given type.
Definition: null.hpp:76
Overnight indexed swap: fix vs compounded overnight rate.
date generation rule
Frequency
Frequency of events.
Definition: frequency.hpp:37
BusinessDayConvention
Business Day conventions.
@ Annual
once a year
Definition: frequency.hpp:39
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:35
Overnight index swap paying compounded overnight vs. fixed.
ext::shared_ptr< YieldTermStructure > r
Interest-rate term structure.