QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
proxyibor.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) 2010 Ferdinando Ametrano
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 proxyibor.hpp
21 \brief IborIndex calculated as proxy of some other IborIndex
22*/
23
24#ifndef quantlib_proxyibor_hpp
25#define quantlib_proxyibor_hpp
26
28
29namespace QuantLib {
30
31 //! IborIndex calculated as proxy of some other IborIndex
32 class ProxyIbor : public IborIndex {
33 public:
34 ProxyIbor(const std::string& familyName,
35 const Period& tenor,
36 Natural settlementDays,
37 const Currency& currency,
39 BusinessDayConvention convention,
40 bool endOfMonth,
42 Handle<Quote> gearing,
43 ext::shared_ptr<IborIndex> iborIndex,
44 Handle<Quote> spread);
45
46 private:
47 // overload
48 Rate forecastFixing(const Date& fixingDate) const override;
49
51 ext::shared_ptr<IborIndex> iborIndex_;
53 };
54
55 inline Rate ProxyIbor::forecastFixing(const Date& fixingDate) const {
56 Rate proxy = iborIndex_->fixing(fixingDate);
57 return gearing_->value() * proxy * spread_->value();
58 }
59
60}
61
62#endif
calendar class
Definition: calendar.hpp:61
Currency specification
Definition: currency.hpp:36
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
Date fixingDate(const Date &valueDate) const
std::string familyName() const
IborIndex calculated as proxy of some other IborIndex.
Definition: proxyibor.hpp:32
Handle< Quote > spread_
Definition: proxyibor.hpp:52
ext::shared_ptr< IborIndex > iborIndex_
Definition: proxyibor.hpp:51
Handle< Quote > gearing_
Definition: proxyibor.hpp:50
Rate forecastFixing(const Date &fixingDate) const override
It can be overridden to implement particular conventions.
Definition: proxyibor.hpp:55
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
Real Rate
interest rates
Definition: types.hpp:70
base class for Inter-Bank-Offered-Rate indexes
Definition: any.hpp:35