Logo Search packages:      
Sourcecode: quantlib version File versions  Download package

QuantLib::FixedRateBondForward Class Reference

#include <fixedratebondforward.hpp>

Inheritance diagram for QuantLib::FixedRateBondForward:

QuantLib::Forward QuantLib::Instrument QuantLib::LazyObject QuantLib::Observable QuantLib::Observer

List of all members.


Detailed Description

Forward contract on a fixed-rate bond

1. valueDate refers to the settlement date of the bond forward contract. maturityDate is the delivery (or repurchase) date for the underlying bond (not the bond's maturity date).

2. Relevant formulas used in the calculations ($P$ refers to a price):

a. $ P_{CleanFwd}(t) = P_{DirtyFwd}(t) - AI(t=deliveryDate) $ where $ AI $ refers to the accrued interest on the underlying bond.

b. $ P_{DirtyFwd}(t) = \frac{P_{DirtySpot}(t) - SpotIncome(t)} {discountCurve->discount(t=deliveryDate)} $

c. $ SpotIncome(t) = \sum_i \left( CF_i \times incomeDiscountCurve->discount(t_i) \right) $ where $ CF_i $ represents the ith bond cash flow (coupon payment) associated with the underlying bond falling between the settlementDate and the deliveryDate. (Note the two different discount curves used in b. and c.)

Example: valuation of a repo on a fixed-rate bond

Todo:
Add preconditions and tests
Todo:
Create switch- if coupon goes to seller is toggled on, don't consider income in the $ P_{DirtyFwd}(t) $ calculation.
Todo:
Verify this works when the underlying is paper (in which case ignore all AI.)
Warning:
This class still needs to be rigorously tested

Definition at line 73 of file fixedratebondforward.hpp.


Public Member Functions

virtual void fetchResults (const PricingEngine::results *) const
void notifyObservers ()
void registerWith (const boost::shared_ptr< Observable > &)
virtual void setupArguments (PricingEngine::arguments *) const
void unregisterWith (const boost::shared_ptr< Observable > &)
Inspectors
const std::map< std::string,
boost::any > & 
additionalResults () const
 returns all additional result returned by the pricing engine.
Real errorEstimate () const
 returns the error estimate on the NPV when available.
Real NPV () const
 returns the net present value of the instrument.
template<typename T>
result (const std::string &tag) const
 returns any additional result returned by the pricing engine.
Inspectors
BusinessDayConvention businessDayConvention () const
const Calendarcalendar () const
const DayCounterdayCounter () const
Handle< YieldTermStructurediscountCurve () const
 term structure relevant to the contract (e.g. repo curve)
Handle< YieldTermStructureincomeDiscountCurve () const
 term structure that discounts the underlying's income cash flows
bool isExpired () const
 returns whether the instrument is still tradable.
virtual Date settlementDate () const
Calculations
Real cleanForwardPrice () const
 (dirty) forward bond price minus accrued on bond at delivery
Real forwardPrice () const
 (dirty) forward bond price
Real spotIncome (const Handle< YieldTermStructure > &incomeDiscountCurve) const
 NPV of bond coupons discounted using incomeDiscountCurve.
Real spotValue () const
 NPV of underlying bond.
Constructors
 FixedRateBondForward (const Date &valueDate, const Date &maturityDate, Position::Type type, Real strike, Natural settlementDays, const DayCounter &dayCounter, const Calendar &calendar, BusinessDayConvention businessDayConvention, const boost::shared_ptr< FixedRateBond > &fixedCouponBond, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const Handle< YieldTermStructure > &incomeDiscountCurve=Handle< YieldTermStructure >())
Calculations
virtual Real forwardValue () const
 forward value/price of underlying, discounting income/dividends
InterestRate impliedYield (Real underlyingSpotValue, Real forwardValue, Date settlementDate, Compounding compoundingConvention, DayCounter dayCounter)
Calculations
These methods do not modify the structure of the object and are therefore declared as const. Data members which will be calculated on demand need to be declared as mutable.

void freeze ()
void recalculate ()
void unfreeze ()
Modifiers
void setPricingEngine (const boost::shared_ptr< PricingEngine > &)
 set the pricing engine to be used.
Observer interface
void update ()

Protected Member Functions

void performCalculations () const
Calculations
void calculate () const
virtual void setupExpired () const

Protected Attributes

BusinessDayConvention businessDayConvention_
bool calculated_
Calendar calendar_
DayCounter dayCounter_
Handle< YieldTermStructurediscountCurve_
boost::shared_ptr< PricingEngineengine_
boost::shared_ptr< FixedRateBondfixedCouponBond_
bool frozen_
Handle< YieldTermStructureincomeDiscountCurve_
Date maturityDate_
 maturityDate of the forward contract or delivery date of underlying
boost::shared_ptr< Payoffpayoff_
Natural settlementDays_
Real underlyingIncome_
Real underlyingSpotValue_
Date valueDate_
Results
The value of this attribute and any other that derived classes might declare must be set during calculation.

std::map< std::string, boost::any > additionalResults_
Real errorEstimate_
Real NPV_

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index