QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
custom.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3#ifndef quantlib_custom_ibor_hpp
4#define quantlib_custom_ibor_hpp
5
7
8namespace QuantLib {
9
10 /*! LIBOR-like index that allows specifying custom calendars for value
11 and maturity dates calculations:
12
13 * valueDate() advances on the valueCalendar and adjusts on the
14 maturityCalendar.
15
16 * maturityDate() advances on the maturityCalendar.
17
18 * fixingDate() goes back on the valueCalendar.
19
20 Typical LIBOR indexes use:
21
22 * fixingCalendar = valueCalendar = UK, maturityCalendar =
23 JoinHolidays(UK, CurrencyCalendar) for non-EUR currencies.
24
25 * fixingCalendar = JoinHolidays(UK, TARGET), valueCalendar =
26 maturityCalendar = TARGET for EUR.
27 */
28 class CustomIborIndex : public IborIndex {
29 public:
30 CustomIborIndex(const std::string& familyName,
31 const Period& tenor,
32 Natural settlementDays,
33 const Currency& currency,
37 BusinessDayConvention convention,
38 bool endOfMonth,
40 const Handle<YieldTermStructure>& h = {});
41 //! \name InterestRateIndex interface
42 //@{
43 Date fixingDate(const Date& valueDate) const override;
44 Date valueDate(const Date& fixingDate) const override;
45 Date maturityDate(const Date& valueDate) const override;
46 // @}
47 //! \name IborIndex interface
48 //@{
49 ext::shared_ptr<IborIndex> clone(const Handle<YieldTermStructure>& h) const override;
50 // @}
51 //! \name Other inspectors
52 //@{
55 // @}
56 private:
59 };
60
61}
62
63#endif
calendar class
Definition: calendar.hpp:61
Currency specification
Definition: currency.hpp:36
Date valueDate(const Date &fixingDate) const override
Definition: custom.cpp:28
Calendar maturityCalendar_
Definition: custom.hpp:58
Calendar valueCalendar() const
Definition: custom.hpp:53
Date maturityDate(const Date &valueDate) const override
Definition: custom.cpp:37
ext::shared_ptr< IborIndex > clone(const Handle< YieldTermStructure > &h) const override
returns a copy of itself linked to a different forwarding curve
Definition: custom.cpp:42
Date fixingDate(const Date &valueDate) const override
Definition: custom.cpp:22
Calendar maturityCalendar() const
Definition: custom.hpp:54
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Shared handle to an observable.
Definition: handle.hpp:41
base class for Inter-Bank-Offered-Rate indexes (e.g. Libor, etc.)
Definition: iborindex.hpp:35
bool endOfMonth() const
Definition: iborindex.hpp:54
const DayCounter & dayCounter() const
Calendar fixingCalendar() const override
returns the calendar defining valid fixing dates
const Currency & currency() const
std::string familyName() const
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
base class for Inter-Bank-Offered-Rate indexes
Definition: any.hpp:37