QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
makeois.hpp
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
26#ifndef quantlib_makeois_hpp
27#define quantlib_makeois_hpp
28
29#include <ql/instruments/overnightindexedswap.hpp>
30#include <ql/time/dategenerationrule.hpp>
31#include <ql/termstructures/yieldtermstructure.hpp>
32
33namespace QuantLib {
34
36
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);
57
62
63 MakeOIS& withEndOfMonth(bool flag = true);
64
66
68
70 const Handle<YieldTermStructure>& discountingTermStructure);
71
72 MakeOIS &withTelescopicValueDates(bool telescopicValueDates);
73
75
77 const ext::shared_ptr<PricingEngine>& engine);
78 private:
80 ext::shared_ptr<OvernightIndex> overnightIndex_;
83
87
92
94 bool endOfMonth_ = false, isDefaultEOM_ = true;
95
98
101
102 ext::shared_ptr<PricingEngine> engine_;
103
106 };
107
108}
109
110#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:79
ext::shared_ptr< OvernightIndex > overnightIndex_
Definition: makeois.hpp:80
Calendar calendar_
Definition: makeois.hpp:86
BusinessDayConvention paymentAdjustment_
Definition: makeois.hpp:90
bool telescopicValueDates_
Definition: makeois.hpp:104
MakeOIS & withPaymentAdjustment(BusinessDayConvention convention)
Definition: makeois.cpp:174
MakeOIS & withDiscountingTermStructure(const Handle< YieldTermStructure > &discountingTermStructure)
Definition: makeois.cpp:196
MakeOIS & withType(Swap::Type type)
Definition: makeois.cpp:140
MakeOIS & withSettlementDays(Natural settlementDays)
Definition: makeois.cpp:150
Calendar paymentCalendar_
Definition: makeois.hpp:89
DayCounter fixedDayCount_
Definition: makeois.hpp:100
MakeOIS & receiveFixed(bool flag=true)
Definition: makeois.cpp:135
Period forwardStart_
Definition: makeois.hpp:82
MakeOIS & withPaymentFrequency(Frequency f)
Definition: makeois.cpp:167
Date terminationDate_
Definition: makeois.hpp:85
Natural paymentLag_
Definition: makeois.hpp:91
MakeOIS & withFixedLegDayCount(const DayCounter &dc)
Definition: makeois.cpp:210
MakeOIS & withRule(DateGeneration::Rule r)
Definition: makeois.cpp:189
MakeOIS & withPaymentLag(Natural lag)
Definition: makeois.cpp:179
MakeOIS & withPricingEngine(const ext::shared_ptr< PricingEngine > &engine)
Definition: makeois.cpp:204
DateGeneration::Rule rule_
Definition: makeois.hpp:93
Natural settlementDays_
Definition: makeois.hpp:84
RateAveraging::Type averagingMethod_
Definition: makeois.hpp:105
MakeOIS & withPaymentCalendar(const Calendar &cal)
Definition: makeois.cpp:184
MakeOIS & withTerminationDate(const Date &)
Definition: makeois.cpp:161
MakeOIS & withEffectiveDate(const Date &)
Definition: makeois.cpp:156
MakeOIS & withOvernightLegSpread(Spread sp)
Definition: makeois.cpp:221
ext::shared_ptr< PricingEngine > engine_
Definition: makeois.hpp:102
Swap::Type type_
Definition: makeois.hpp:96
MakeOIS & withEndOfMonth(bool flag=true)
Definition: makeois.cpp:215
MakeOIS & withNominal(Real n)
Definition: makeois.cpp:145
MakeOIS & withAveragingMethod(RateAveraging::Type averagingMethod)
Definition: makeois.cpp:231
MakeOIS & withTelescopicValueDates(bool telescopicValueDates)
Definition: makeois.cpp:226
Frequency paymentFrequency_
Definition: makeois.hpp:88
Spread overnightSpread_
Definition: makeois.hpp:99
template class providing a null value for a given type.
Definition: null.hpp:76
Overnight indexed swap: fix vs compounded overnight rate.
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
Real Spread
spreads on interest rates
Definition: types.hpp:74
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35