QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
makearithmeticaverageois.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) 2016 Stefano Fondi
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file makearithmeticaverageois.hpp
21 \brief Helper class to instantiate overnight indexed swaps.
22*/
23
24#ifndef quantlib_makearithmeticaverageois_hpp
25#define quantlib_makearithmeticaverageois_hpp
26
30
31namespace QuantLib {
32
33 //! helper class
34 /*! This class provides a more comfortable way
35 to instantiate arithemtic average overnight indexed swaps.
36 */
38 public:
39 MakeArithmeticAverageOIS(const Period& swapTenor,
40 const ext::shared_ptr<OvernightIndex>& overnightIndex,
41 Rate fixedRate = Null<Rate>(),
42 const Period& fwdStart = 0*Days);
43
44 operator ArithmeticAverageOIS() const;
45 operator ext::shared_ptr<ArithmeticAverageOIS>() const;
46
47 MakeArithmeticAverageOIS& receiveFixed(bool flag = true);
50
55
59
61
63
65 const Handle<YieldTermStructure>& discountingTermStructure);
67 const ext::shared_ptr<PricingEngine>& engine);
69 Real meanReversionSpeed = 0.03,
70 Real volatility = 0.00, // NO convexity adjustment by default
71 bool byApprox = false); // TRUE to use Katsumi Takada approximation
72 private:
74 ext::shared_ptr<OvernightIndex> overnightIndex_;
77
81
86
87 bool byApprox_ = false;
88 Real mrs_ = 0.03;
89 Real vol_ = 0.00;
90
93
96
97 ext::shared_ptr<PricingEngine> engine_;
98 };
99
100}
101
102#endif
Overnight index swap paying arithmetic average of overnight vs. fixed.
Arithemtic Average OIS: fix vs arithmetic average of overnight rate.
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
ext::shared_ptr< OvernightIndex > overnightIndex_
MakeArithmeticAverageOIS & withOvernightLegSpread(Spread sp)
MakeArithmeticAverageOIS & withType(Swap::Type type)
MakeArithmeticAverageOIS & withEndOfMonth(bool flag=true)
MakeArithmeticAverageOIS & withFixedLegPaymentFrequency(Frequency f)
MakeArithmeticAverageOIS & withEffectiveDate(const Date &)
MakeArithmeticAverageOIS & withArithmeticAverage(Real meanReversionSpeed=0.03, Real volatility=0.00, bool byApprox=false)
MakeArithmeticAverageOIS & withDiscountingTermStructure(const Handle< YieldTermStructure > &discountingTermStructure)
MakeArithmeticAverageOIS & withSettlementDays(Natural settlementDays)
MakeArithmeticAverageOIS & withFixedLegDayCount(const DayCounter &dc)
MakeArithmeticAverageOIS & receiveFixed(bool flag=true)
MakeArithmeticAverageOIS & withOvernightLegPaymentFrequency(Frequency f)
ext::shared_ptr< PricingEngine > engine_
MakeArithmeticAverageOIS & withPricingEngine(const ext::shared_ptr< PricingEngine > &engine)
MakeArithmeticAverageOIS & withNominal(Real n)
MakeArithmeticAverageOIS & withRule(DateGeneration::Rule r)
MakeArithmeticAverageOIS & withTerminationDate(const Date &)
template class providing a null value for a given type.
Definition: null.hpp:76
date generation rule
Frequency
Frequency of events.
Definition: frequency.hpp:37
@ 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
ext::shared_ptr< YieldTermStructure > r
Interest-rate term structure.