QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
ForwardRateAgreement Class Reference

Forward rate agreement (FRA) class More...

#include <ql/instruments/forwardrateagreement.hpp>

Inheritance diagram for ForwardRateAgreement:

Public Member Functions

 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
Real NPV () const
 returns the net present value of the instrument.
Real errorEstimate () const
 returns the error estimate on the NPV when available.
const DatevaluationDate () const
 returns the date the net present value refers to.
template<typename T>
result (const std::string &tag) const
 returns any additional result returned by the pricing engine.
const std::map< std::string, ext::any > & additionalResults () const
 returns all additional result returned by the pricing engine.
void setPricingEngine (const ext::shared_ptr< PricingEngine > &)
 set the pricing engine to be used.
virtual void setupArguments (PricingEngine::arguments *) const
virtual void fetchResults (const PricingEngine::results *) const
Public Member Functions inherited from LazyObject
void update () override
bool isCalculated () const
void forwardFirstNotificationOnly ()
void alwaysForwardNotifications ()
void recalculate ()
void freeze ()
void unfreeze ()
Public Member Functions inherited from Observable
 Observable (const Observable &)
Observableoperator= (const Observable &)
 Observable (Observable &&)=delete
Observableoperator= (Observable &&)=delete
void notifyObservers ()
Public Member Functions inherited from Observer
 Observer (const Observer &)
Observeroperator= (const 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 deepUpdate ()

Calculations

Position::Type fraType_
InterestRate forwardRate_
 aka FRA rate (the market forward rate)
InterestRate strikeForwardRate_
 aka FRA fixing rate, contract rate
Real notionalAmount_
ext::shared_ptr< IborIndexindex_
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.
Date maturityDate_
 maturityDate of the underlying index; not the date the FRA is settled.
Handle< YieldTermStructurediscountCurve_
bool isExpired () const override
 A FRA expires/settles on the value date.
Real amount () const
 The payoff on the value date.
const Calendarcalendar () const
BusinessDayConvention businessDayConvention () const
const DayCounterdayCounter () const
Handle< YieldTermStructurediscountCurve () const
 term structure relevant to the contract (e.g. repo curve)
Date fixingDate () const
InterestRate forwardRate () const
 Returns the relevant forward rate associated with the FRA term.
void setupExpired () const override
void performCalculations () const override

Additional Inherited Members

Public Types inherited from Observer
typedef set_type::iterator iterator
Protected Member Functions inherited from Instrument
void calculate () const override
void performCalculations () const override
Protected Attributes inherited from Instrument
Real NPV_
Real errorEstimate_
Date valuationDate_
std::map< std::string, ext::any > additionalResults_
ext::shared_ptr< PricingEngineengine_
bool calculated_ = false
bool frozen_ = false
bool alwaysForward_

Detailed Description

Forward rate agreement (FRA) class

  1. Unlike the forward contract conventions on carryable financial assets (stocks, bonds, commodities), the valueDate for a FRA is taken to be the day when the forward loan or deposit begins and when full settlement takes place (based on the NPV of the contract on that date). maturityDate is the date when the forward loan or deposit ends. In fact, the FRA settles and expires on the valueDate, not on the (later) maturityDate. It follows that (maturityDate - valueDate) is the tenor/term of the underlying loan or deposit
  2. Choose position type = Long for an "FRA purchase" (future long loan, short deposit [borrower])
  3. Choose position type = Short for an "FRA sale" (future short loan, long deposit [lender])

Example: valuation of a forward-rate agreement

Warning
This class still needs to be rigorously tested
Examples
FRA.cpp.

Constructor & Destructor Documentation

◆ ForwardRateAgreement() [1/2]

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.

◆ ForwardRateAgreement() [2/2]

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.

Member Function Documentation

◆ isExpired()

bool isExpired ( ) const
overridevirtual

A FRA expires/settles on the value date.

Implements Instrument.

◆ setupExpired()

void setupExpired ( ) const
overrideprotectedvirtual

This method must leave the instrument in a consistent state when the expiration condition is met.

Reimplemented from Instrument.

◆ performCalculations()

void performCalculations ( ) const
overrideprotectedvirtual

This method must implement any calculations which must be (re)done in order to calculate the desired results.

Implements LazyObject.