QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Forward rate agreement (FRA) class More...
#include <forwardrateagreement.hpp>
Public Member Functions | |
QL_DEPRECATED | ForwardRateAgreement (const Date &valueDate, const Date &maturityDate, Position::Type type, Rate strikeForwardRate, Real notionalAmount, const ext::shared_ptr< IborIndex > &index, Handle< YieldTermStructure > discountCurve={}, bool useIndexedCoupon=true) |
QL_DEPRECATED | ForwardRateAgreement (const Date &valueDate, Position::Type type, Rate strikeForwardRate, Real notionalAmount, const ext::shared_ptr< IborIndex > &index, Handle< YieldTermStructure > discountCurve={}) |
ForwardRateAgreement (const ext::shared_ptr< IborIndex > &index, const Date &valueDate, Position::Type type, Rate strikeForwardRate, Real notionalAmount, Handle< YieldTermStructure > discountCurve={}) | |
ForwardRateAgreement (const ext::shared_ptr< IborIndex > &index, const Date &valueDate, const Date &maturityDate, Position::Type type, Rate strikeForwardRate, Real notionalAmount, Handle< YieldTermStructure > discountCurve={}) | |
Public Member Functions inherited from Instrument | |
Instrument () | |
Real | NPV () const |
returns the net present value of the instrument. More... | |
Real | errorEstimate () const |
returns the error estimate on the NPV when available. More... | |
const Date & | valuationDate () const |
returns the date the net present value refers to. More... | |
template<typename T > | |
T | result (const std::string &tag) const |
returns any additional result returned by the pricing engine. More... | |
const std::map< std::string, ext::any > & | additionalResults () const |
returns all additional result returned by the pricing engine. More... | |
void | setPricingEngine (const ext::shared_ptr< PricingEngine > &) |
set the pricing engine to be used. More... | |
virtual void | setupArguments (PricingEngine::arguments *) const |
virtual void | fetchResults (const PricingEngine::results *) const |
Public Member Functions inherited from LazyObject | |
LazyObject () | |
~LazyObject () override=default | |
void | update () override |
bool | isCalculated () const |
void | forwardFirstNotificationOnly () |
void | alwaysForwardNotifications () |
void | recalculate () |
void | freeze () |
void | unfreeze () |
Public Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Public Member Functions inherited from Observer | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &) |
void | registerWithObservables (const ext::shared_ptr< Observer > &) |
Size | unregisterWith (const ext::shared_ptr< Observable > &) |
void | unregisterWithAll () |
virtual void | update ()=0 |
virtual void | deepUpdate () |
Calculations | |
Position::Type | fraType_ |
InterestRate | forwardRate_ |
aka FRA rate (the market forward rate) More... | |
InterestRate | strikeForwardRate_ |
aka FRA fixing rate, contract rate More... | |
Real | notionalAmount_ |
ext::shared_ptr< IborIndex > | index_ |
bool | useIndexedCoupon_ |
DayCounter | dayCounter_ |
Calendar | calendar_ |
BusinessDayConvention | businessDayConvention_ |
Date | valueDate_ |
the valueDate is the date the underlying index starts accruing and the FRA is settled. More... | |
Date | maturityDate_ |
maturityDate of the underlying index; not the date the FRA is settled. More... | |
Handle< YieldTermStructure > | discountCurve_ |
Real | amount_ |
bool | isExpired () const override |
A FRA expires/settles on the value date. More... | |
Real | amount () const |
The payoff on the value date. More... | |
const Calendar & | calendar () const |
BusinessDayConvention | businessDayConvention () const |
const DayCounter & | dayCounter () const |
Handle< YieldTermStructure > | discountCurve () const |
term structure relevant to the contract (e.g. repo curve) More... | |
Date | fixingDate () const |
InterestRate | forwardRate () const |
Returns the relevant forward rate associated with the FRA term. More... | |
void | setupExpired () const override |
void | performCalculations () const override |
void | calculateForwardRate () const |
void | calculateAmount () const |
Additional Inherited Members | |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Protected Member Functions inherited from Instrument | |
void | calculate () const override |
Protected Member Functions inherited from LazyObject | |
Protected Attributes inherited from Instrument | |
Real | NPV_ |
Real | errorEstimate_ |
Date | valuationDate_ |
std::map< std::string, ext::any > | additionalResults_ |
ext::shared_ptr< PricingEngine > | engine_ |
Protected Attributes inherited from LazyObject | |
bool | calculated_ = false |
bool | frozen_ = false |
bool | alwaysForward_ |
Forward rate agreement (FRA) class
Example: valuation of a forward-rate agreement
Definition at line 66 of file forwardrateagreement.hpp.
ForwardRateAgreement | ( | const Date & | valueDate, |
const Date & | maturityDate, | ||
Position::Type | type, | ||
Rate | strikeForwardRate, | ||
Real | notionalAmount, | ||
const ext::shared_ptr< IborIndex > & | index, | ||
Handle< YieldTermStructure > | discountCurve = {} , |
||
bool | useIndexedCoupon = true |
||
) |
Definition at line 28 of file forwardrateagreement.cpp.
ForwardRateAgreement | ( | const Date & | valueDate, |
Position::Type | type, | ||
Rate | strikeForwardRate, | ||
Real | notionalAmount, | ||
const ext::shared_ptr< IborIndex > & | index, | ||
Handle< YieldTermStructure > | discountCurve = {} |
||
) |
Definition at line 41 of file forwardrateagreement.cpp.
ForwardRateAgreement | ( | const ext::shared_ptr< IborIndex > & | index, |
const Date & | valueDate, | ||
Position::Type | type, | ||
Rate | strikeForwardRate, | ||
Real | notionalAmount, | ||
Handle< YieldTermStructure > | discountCurve = {} |
||
) |
When using this constructor, the forward rate will be forecast by the passed index. This corresponds to useIndexedCoupon=true in the FraRateHelper class.
Definition at line 50 of file forwardrateagreement.cpp.
ForwardRateAgreement | ( | const ext::shared_ptr< IborIndex > & | index, |
const Date & | valueDate, | ||
const Date & | maturityDate, | ||
Position::Type | type, | ||
Rate | strikeForwardRate, | ||
Real | notionalAmount, | ||
Handle< YieldTermStructure > | discountCurve = {} |
||
) |
When using this constructor, a par-rate approximation will be used, i.e., the forward rate will be forecast from value date to maturity date by the forecast curve contained in the index. This corresponds to useIndexedCoupon=false in the FraRateHelper class.
Definition at line 61 of file forwardrateagreement.cpp.
|
overridevirtual |
A FRA expires/settles on the value date.
Implements Instrument.
Definition at line 92 of file forwardrateagreement.cpp.
Real amount | ( | ) | const |
The payoff on the value date.
Definition at line 96 of file forwardrateagreement.cpp.
const Calendar & calendar | ( | ) | const |
Definition at line 168 of file forwardrateagreement.hpp.
BusinessDayConvention businessDayConvention | ( | ) | const |
Definition at line 170 of file forwardrateagreement.hpp.
const DayCounter & dayCounter | ( | ) | const |
Definition at line 174 of file forwardrateagreement.hpp.
Handle< YieldTermStructure > discountCurve | ( | ) | const |
term structure relevant to the contract (e.g. repo curve)
Definition at line 176 of file forwardrateagreement.hpp.
Date fixingDate | ( | ) | const |
InterestRate forwardRate | ( | ) | const |
Returns the relevant forward rate associated with the FRA term.
Definition at line 101 of file forwardrateagreement.cpp.
|
overrideprotectedvirtual |
This method must leave the instrument in a consistent state when the expiration condition is met.
Reimplemented from Instrument.
Definition at line 106 of file forwardrateagreement.cpp.
|
overrideprotectedvirtual |
In case a pricing engine is not used, this method must be overridden to perform the actual calculations and set any needed results. In case a pricing engine is used, the default implementation can be used.
Reimplemented from Instrument.
Definition at line 111 of file forwardrateagreement.cpp.
|
private |
Definition at line 118 of file forwardrateagreement.cpp.
|
private |
Definition at line 132 of file forwardrateagreement.cpp.
|
protected |
Definition at line 143 of file forwardrateagreement.hpp.
|
mutableprotected |
aka FRA rate (the market forward rate)
Definition at line 145 of file forwardrateagreement.hpp.
|
protected |
aka FRA fixing rate, contract rate
Definition at line 147 of file forwardrateagreement.hpp.
|
protected |
Definition at line 148 of file forwardrateagreement.hpp.
|
protected |
Definition at line 149 of file forwardrateagreement.hpp.
|
protected |
Definition at line 150 of file forwardrateagreement.hpp.
|
protected |
Definition at line 152 of file forwardrateagreement.hpp.
|
protected |
Definition at line 153 of file forwardrateagreement.hpp.
|
protected |
Definition at line 154 of file forwardrateagreement.hpp.
|
protected |
the valueDate is the date the underlying index starts accruing and the FRA is settled.
Definition at line 157 of file forwardrateagreement.hpp.
|
protected |
maturityDate of the underlying index; not the date the FRA is settled.
Definition at line 159 of file forwardrateagreement.hpp.
|
protected |
Definition at line 160 of file forwardrateagreement.hpp.
|
mutableprivate |
Definition at line 165 of file forwardrateagreement.hpp.