|
QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
|
Forward rate agreement (FRA) class More...
#include <forwardrateagreement.hpp>
Inheritance diagram for ForwardRateAgreement:
Collaboration 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 | |
| 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 ()=default | |
| 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 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 28 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 39 of file forwardrateagreement.cpp.
Here is the call graph for this function:
|
overridevirtual |
A FRA expires/settles on the value date.
Implements Instrument.
Definition at line 70 of file forwardrateagreement.cpp.
Here is the call graph for this function:| Real amount | ( | ) | const |
The payoff on the value date.
Definition at line 74 of file forwardrateagreement.cpp.
Here is the call graph for this function:| const Calendar & calendar | ( | ) | const |
Definition at line 142 of file forwardrateagreement.hpp.
| BusinessDayConvention businessDayConvention | ( | ) | const |
Definition at line 144 of file forwardrateagreement.hpp.
| const DayCounter & dayCounter | ( | ) | const |
Definition at line 148 of file forwardrateagreement.hpp.
| Handle< YieldTermStructure > discountCurve | ( | ) | const |
term structure relevant to the contract (e.g. repo curve)
Definition at line 150 of file forwardrateagreement.hpp.
| Date fixingDate | ( | ) | const |
| InterestRate forwardRate | ( | ) | const |
Returns the relevant forward rate associated with the FRA term.
Definition at line 79 of file forwardrateagreement.cpp.
Here is the call graph for this function:
|
overrideprotectedvirtual |
This method must leave the instrument in a consistent state when the expiration condition is met.
Reimplemented from Instrument.
Definition at line 84 of file forwardrateagreement.cpp.
Here is the call graph for this function:
|
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 89 of file forwardrateagreement.cpp.
Here is the call graph for this function:
|
private |
Definition at line 96 of file forwardrateagreement.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 110 of file forwardrateagreement.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 117 of file forwardrateagreement.hpp.
|
mutableprotected |
aka FRA rate (the market forward rate)
Definition at line 119 of file forwardrateagreement.hpp.
|
protected |
aka FRA fixing rate, contract rate
Definition at line 121 of file forwardrateagreement.hpp.
|
protected |
Definition at line 122 of file forwardrateagreement.hpp.
|
protected |
Definition at line 123 of file forwardrateagreement.hpp.
|
protected |
Definition at line 124 of file forwardrateagreement.hpp.
|
protected |
Definition at line 126 of file forwardrateagreement.hpp.
|
protected |
Definition at line 127 of file forwardrateagreement.hpp.
|
protected |
Definition at line 128 of file forwardrateagreement.hpp.
|
protected |
the valueDate is the date the underlying index starts accruing and the FRA is settled.
Definition at line 131 of file forwardrateagreement.hpp.
|
protected |
maturityDate of the underlying index; not the date the FRA is settled.
Definition at line 133 of file forwardrateagreement.hpp.
|
protected |
Definition at line 134 of file forwardrateagreement.hpp.
|
mutableprivate |
Definition at line 139 of file forwardrateagreement.hpp.