quantlib.instruments.bondforward.

BondForward

class BondForward(Date value_date, Date maturity_date, Position position_type, Real strike, Natural settlement_days, DayCounter day_counter, Calendar calendar, BusinessDayConvention convention, Bond bond, HandleYieldTermStructure discount_curve, HandleYieldTermStructure income_discount_curve)

Bases: Forward

Forward contract on a bond

value_date

refers to the settlement date of the bond forward contract.

maturity_date
this is the delivery (or repurchase date) for the underlying bond

(not the bond’s maturity date).

Attributes:
clean_forward_price

(dirty) forward bond price minus accrued on bond at delivery

error_estimate

Real: error estimate on the NPV when available

forward_price

(dirty) forward bond price

forward_value

The forward value/price of the underlying, discounting income/dividends.

is_expired

bool: whether the instrument might have value greater than zero.

net_present_value

The net present value of the instrument.

npv

A shortcut to the net_present_value property.

spot_value

The spot value/price of the underlying financial instrument.

valuation_date

Date: the date the net present value refers to.

Methods

implied_yield(self, ...)

Calculates the implied yield of the forward contract.

set_pricing_engine(self, PricingEngine engine)

Sets the pricing engine to be used.

spot_income(self, ...)

The NPV of income/dividends/storage-costs etc.

Notes

Relevant formulas used in the calculations (P refers to a price): pomme

  1. Clearn forward price:

    P_{\text{CleanFwd}}(t) = P_{\text{DirtyFwd}}(t) - AI(t=\text{deliveryDate})

    where AI refers to the accrued interest on the underlying bond.

  2. Dirty forward price:

    P_{\text{DirtyFwd}}(t) = \frac{P_{DirtySpot}(t) - \text{SpotIncome}(t)}{\text{discountCurve}\rightarrow \text{discount}(t=\text{deliveryDate})}

  3. Spot income:

    SpotIncome(t) = \sum_i \left( CF_i \times \text{incomeDiscountCurve}\rightarrow \text{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 1. and 2.)