stdBondForwardPricer
First introduced in version: 3.00.6
Syntax
stdBondForwardPricer(instrument, pricingDate, discountCurve)
Details
Prices a standard bond forward and returns the net present value (NPV) of the standard bond forward on the specified pricing date.
Parameters
instrument is an INSTRUMENT scalar or vector of type StdBondForward specifying the standard bond forward(s) to be priced. See Product Field Specifications for the required keys.
pricingDate is a DATE scalar or vector indicating the pricing date(s).
discountCurve is an MKTDATA scalar or vector of type IrYieldCurve specifying the discount curve(s) used for pricing.
Returns
A DOUBLE scalar or vector indicating the pricing result of the standard bond forward, namely the NPV.
Examples
Example 1: This example first constructs an interest-rate yield curve dictionary, curveDict, and parses it into the discount curve discountCurve required for pricing by using parseMktData. It then defines a fixed-rate bond dictionary, bondDict, as the deliverable underlying bond of the standard bond forward. Next, stdBondForwardDict is used to specify the key terms of the standard bond forward, including the notional amount, notional bond tenor, maturity date, settlement date, settlement type, notional coupon rate, and underlying bond, and parseInstrument parses the dictionary into stdBondForward. Finally, stdBondForwardPricer is called with the pricing date and discount curve to calculate the net present value (NPV) of the standard bond forward.
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)
bondDict = {
"productType": "Cash",
"assetType": "Bond",
"bondType": "FixedRateBond",
"instrumentId": "BOND1",
"start": 2021.05.24,
"maturity": 2031.05.24,
"coupon": 0.0352,
"frequency": "Annual",
"dayCountConvention": "ActualActualISDA"
}
stdBondForwardDict = {
"productType": "Forward",
"forwardType": "StdBondForward",
"instrumentId": "SBF_EXAMPLE",
"nominal": 100.0,
"yearLength": 10,
"maturity": 2025.08.18,
"settlement": 2025.12.18,
"settlementType": "PhysicalSettlement",
"nominalCouponRate": 0.03,
"underlying": [bondDict]
}
stdBondForward = parseInstrument(stdBondForwardDict)
npv = stdBondForwardPricer(stdBondForward, pricingDate, discountCurve)
npv
// output: 106.4315066
Example 2: This example demonstrates vectorized pricing. It reuses the standard bond forward object stdBondForward and the discount curve discountCurve created in Example 1, and constructs vectors of instruments, pricing dates, and discount curves. When stdBondForwardPricer is called, the function matches the elements of the three vectors by position and returns a vector of NPV results, one for each standard bond forward.
instruments = [stdBondForward, stdBondForward]
pricingDates = [2025.08.18, 2025.08.18]
discountCurves = [discountCurve, discountCurve]
npv = stdBondForwardPricer(instruments, pricingDates, discountCurves)
npv
// output: [106.431507,106.431507]
Related functions: parseInstrument, parseMktData, bondForwardPricer
Product Field Specifications
| Field | Type | Description | Required |
|---|---|---|---|
| productType | STRING | Must be "Forward". | Yes |
| forwardType | STRING | Must be "StdBondForward". | Yes |
| nominal | DOUBLE | The notional amount. The default value is 100. | No |
| instrumentId | STRING | The standard bond forward identifier, e.g., "CDB3". | No |
| yearLength | INT | The tenor of the notional bond, typically 3-year, 5-year, or 10-year. | Yes |
| maturity | DATE | The maturity date (T-1, adjusted to a trading day). | Yes |
| settlement | DATE | The settlement date (T), the third Wednesday of the contract month. | Yes |
| underlying | DICTIONARY/TUPLE of INSTRUMENT objects | The basket of deliverable fixed-rate bonds underlying the contract(s). Can be generated by parsing bond dictionaries via parseInstrument. | Yes |
| settlementType | STRING |
The settlement type. Supported values are:
|
Yes |
| nominalCouponRate | DOUBLE | The notional coupon rate of the notional bond. The default value is 0.03, i.e., 3%. | No |
