QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
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 /*! \deprecated Use MakeOIS instead.
34 Deprecated in version 1.36.
35 */
36 class [[deprecated("Use MakeOIS instead")]] MakeArithmeticAverageOIS {
37 public:
39
40 MakeArithmeticAverageOIS(const Period& swapTenor,
41 const ext::shared_ptr<OvernightIndex>& overnightIndex,
42 Rate fixedRate = Null<Rate>(),
43 const Period& fwdStart = 0*Days);
44
45 operator ArithmeticAverageOIS() const;
46 operator ext::shared_ptr<ArithmeticAverageOIS>() const;
47
48 MakeArithmeticAverageOIS& receiveFixed(bool flag = true);
50 MakeArithmeticAverageOIS& withNominal(Real n);
51
52 MakeArithmeticAverageOIS& withSettlementDays(Natural settlementDays);
53 MakeArithmeticAverageOIS& withEffectiveDate(const Date&);
54 MakeArithmeticAverageOIS& withTerminationDate(const Date&);
56
57 MakeArithmeticAverageOIS& withFixedLegPaymentFrequency(Frequency f);
58 MakeArithmeticAverageOIS& withOvernightLegPaymentFrequency(Frequency f);
59 MakeArithmeticAverageOIS& withEndOfMonth(bool flag = true);
60
61 MakeArithmeticAverageOIS& withFixedLegDayCount(const DayCounter& dc);
62
63 MakeArithmeticAverageOIS& withOvernightLegSpread(Spread sp);
64
65 MakeArithmeticAverageOIS& withDiscountingTermStructure(
66 const Handle<YieldTermStructure>& discountingTermStructure);
67 MakeArithmeticAverageOIS& withPricingEngine(
68 const ext::shared_ptr<PricingEngine>& engine);
69 MakeArithmeticAverageOIS& withArithmeticAverage(
70 Real meanReversionSpeed = 0.03,
71 Real volatility = 0.00, // NO convexity adjustment by default
72 bool byApprox = false); // TRUE to use Katsumi Takada approximation
73 private:
75 ext::shared_ptr<OvernightIndex> overnightIndex_;
78
79 Natural settlementDays_ = 2;
80 Date effectiveDate_, terminationDate_;
82
83 Frequency fixedLegPaymentFrequency_ = Annual;
84 Frequency overnightLegPaymentFrequency_ = Annual;
85 DateGeneration::Rule rule_ = DateGeneration::Backward;
86 bool endOfMonth_, isDefaultEOM_ = true;
87
88 bool byApprox_ = false;
89 Real mrs_ = 0.03;
90 Real vol_ = 0.00;
91
92 Swap::Type type_ = Swap::Payer;
93 Real nominal_ = 1.0;
94
95 Spread overnightSpread_ = 0.0;
97
98 ext::shared_ptr<PricingEngine> engine_;
99
101 };
102
103}
104
105#endif
Overnight index swap paying arithmetic average of overnight vs. fixed.
ext::shared_ptr< SimpleQuote > vol_
Definition: cdsoption.cpp:62
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_
ext::shared_ptr< PricingEngine > engine_
template class providing a null value for a given type.
Definition: null.hpp:59
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:37
ext::shared_ptr< YieldTermStructure > r
#define QL_DEPRECATED_DISABLE_WARNING
Definition: qldefines.hpp:216
#define QL_DEPRECATED_ENABLE_WARNING
Definition: qldefines.hpp:217
Interest-rate term structure.