bondForwardPricer
First introduced in version: 3.00.6
Syntax
bondForwardPricer(instrument, pricingDate, discountCurve)
Details
Prices a bond forward and returns its net present value (NPV) on the specified pricing date. The pricing process uses the input discount curve to calculate the forward value of the underlying bond and then determines the value of the bond forward contract based on the agreed yield to maturity (strike).
Parameters
Note: Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.
instrument is an INSTRUMENT scalar or vector object indicating the bond forward(s) to be priced. See Bond Forward Field Specifications for the required keys. Note: The underlying bond of instrument must be a bond (a fixed-rate bond or a zero-coupon bond). The maturity date of the bond forward must be the same as its settlement date, and the settlement date must be no later than the maturity date of the underlying bond.
pricingDate is a DATE scalar or vector indicating the pricing date.
discountCurve is an MKTDATA scalar or vector of IrYieldCurve type specifying the yield curve used to discount the cash flows of the underlying bond and to calculate the forward value of the bond.
Returns
Returns a DOUBLE scalar or vector indicating the NPV of the bond forward.
Examples
This example prices a bond forward contract on a fixed-rate bond. A CNY government bond yield curve is constructed as the discount curve, and bondForwardPricer is used to calculate the theoretical value of the bond forward on the pricing date.
// Construct the underlying bond
bondDict = {
"productType": "Cash",
"assetType": "Bond",
"bondType": "FixedRateBond",
"instrumentId": "220010.IB",
"start": 2020.12.25,
"maturity": 2031.12.25,
"coupon": 0.0149,
"frequency": "Annual",
"dayCountConvention": "ActualActualISDA"
}
// Construct the bond forward
bondForwardDict = {
"productType": "Forward",
"forwardType": "BondForward",
"nominal": 100.0,
"instrumentId": "BFD3M",
"maturity": 2025.09.16,
"settlement": 2025.09.16,
"strike": 0.0181,
"underlying": bondDict
}
bondForward = parseInstrument(bondForwardDict)
// Construct the discount curve
pricingDate = 2025.08.18
curveDict = {
"mktDataType": "Curve",
"curveType": "IrYieldCurve",
"curveName": "CNY_TREASURY_BOND",
"referenceDate": pricingDate,
"currency": "CNY",
"dayCountConvention": "ActualActualISDA",
"compounding": "Compounded",
"interpMethod": "Linear",
"extrapMethod": "Flat",
"frequency": "Annual",
"dates": [2025.09.18, 2025.12.18, 2026.06.18, 2027.06.18, 2028.06.18, 2030.06.18, 2032.06.18],
"values": [1.30, 1.36, 1.40, 1.46, 1.52, 1.68, 1.78] / 100.0
}
discountCurve = parseMktData(curveDict)
// Price the bond forward
npv = bondForwardPricer(bondForward, pricingDate, discountCurve)
npv
// output: 0.3156
Related functions: parseInstrument, parseMktData, instrumentPricer
Bond Forward Field Specifications
| Field | Type | Description | Required |
|---|---|---|---|
| productType | STRING | Must be "Forward". | Yes |
| forwardType | STRING | Must be "BondForward". | Yes |
| nominal | DOUBLE | Notional amount. Default value: 100. | No |
| instrumentId | STRING | Bond forward identifier, for example, "BFD3M". | No |
| maturity | DATE | Maturity date. | Yes |
| settlement | DATE | Settlement date (must be the same as maturity and no later than the maturity date of the underlying bond). | Yes |
| strike | DOUBLE | Strike price, representing the agreed yield to maturity (YTM), expressed in decimal form. | Yes |
| underlying | Dictionary or INSTRUMENT | Underlying deliverable bond (a fixed-rate bond or a zero-coupon bond). | Yes |
