QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
forwardrateagreement.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Allen Kuo
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
24#ifndef quantlib_forward_rate_agreement_hpp
25#define quantlib_forward_rate_agreement_hpp
26
27#include <ql/instruments/forward.hpp>
28
29namespace QuantLib {
30
31 class IborIndex;
32
34
67 public:
71 QL_DEPRECATED
73 const Date& valueDate,
74 const Date& maturityDate,
75 Position::Type type,
76 Rate strikeForwardRate,
77 Real notionalAmount,
78 const ext::shared_ptr<IborIndex>& index,
80 bool useIndexedCoupon = true);
81
85 QL_DEPRECATED
87 const Date& valueDate,
88 Position::Type type,
89 Rate strikeForwardRate,
90 Real notionalAmount,
91 const ext::shared_ptr<IborIndex>& index,
93
99 const ext::shared_ptr<IborIndex>& index,
100 const Date& valueDate,
101 Position::Type type,
102 Rate strikeForwardRate,
103 Real notionalAmount,
105
113 const ext::shared_ptr<IborIndex>& index,
114 const Date& valueDate,
115 const Date& maturityDate,
116 Position::Type type,
117 Rate strikeForwardRate,
118 Real notionalAmount,
120
122
123
124 bool isExpired() const override;
126 Real amount() const;
127
128 const Calendar& calendar() const;
130 const DayCounter& dayCounter() const;
133
134 Date fixingDate() const;
135
139
140 protected:
141 void setupExpired() const override;
142 void performCalculations() const override;
149 ext::shared_ptr<IborIndex> index_;
151
155
161
162 private:
163 void calculateForwardRate() const;
164 void calculateAmount() const;
165 mutable Real amount_;
166 };
167
168 inline const Calendar& ForwardRateAgreement::calendar() const { return calendar_; }
169
172 }
173
175
177 return discountCurve_;
178 }
179
180}
181
182
183#endif
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Forward rate agreement (FRA) class
void performCalculations() const override
Handle< YieldTermStructure > discountCurve_
InterestRate strikeForwardRate_
aka FRA fixing rate, contract rate
bool isExpired() const override
A FRA expires/settles on the value date.
const DayCounter & dayCounter() const
Handle< YieldTermStructure > discountCurve() const
term structure relevant to the contract (e.g. repo curve)
InterestRate forwardRate_
aka FRA rate (the market forward rate)
BusinessDayConvention businessDayConvention() const
Date maturityDate_
maturityDate of the underlying index; not the date the FRA is settled.
Real amount() const
The payoff on the value date.
Date valueDate_
the valueDate is the date the underlying index starts accruing and the FRA is settled.
InterestRate forwardRate() const
Returns the relevant forward rate associated with the FRA term.
BusinessDayConvention businessDayConvention_
ext::shared_ptr< IborIndex > index_
Shared handle to an observable.
Definition: handle.hpp:41
Abstract instrument class.
Definition: instrument.hpp:44
Concrete interest rate class.
BusinessDayConvention
Business Day conventions.
QL_REAL Real
real number
Definition: types.hpp:50
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35