fxNonDeliverableForwardPricer
First introduced in version 3.00.6
Syntax
fxNonDeliverableForwardPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve)
Details
Calculates the net present value (NPV) of a foreign exchange non-deliverable forward contract based on the specified spot exchange rate, domestic and foreign discount curves, and pricing date.
Parameters
instrument is an INSTRUMENT object that specifies the non-deliverable foreign exchange forward to be priced. For field requirements, see the product field description.
pricingDate is a DATE scalar that specifies the pricing date.
spot is a DOUBLE scalar that specifies the spot exchange rate.
domesticCurve is a MKTDATA object that specifies the domestic discount curve (IrYieldCurve).
foreignCurve is a MKTDATA object that specifies the foreign discount curve (IrYieldCurve).
Returns
A DOUBLE scalar, indicating the NPV of a foreign exchange non-deliverable forward contract.
Examples
This example constructs a non-deliverable forward contract with USD as the notional currency and defines the CNY and USD risk-free yield curves as the discount curves. The pricing function calculates the contract NPV based on the spot exchange rate, pricing date, and the two discount curves. The example then manually calculates the NPV using discount factors to verify the pricing result.
pricingDate = 2025.08.18
strike = 4
yearConv = "Actual365"
delivery = 2025.12.18
notionalAmount = 1E6
fxNonDeliverableForward = {
"productType": "Forward",
"forwardType": "FxNonDeliverableForward",
"expiry": 2025.12.16,
"delivery": delivery,
"currencyPair": "USDCNY",
"direction": "Buy",
"notionalAmount": notionalAmount,
"notionalCurrency": "USD",
// "settlementCurrency": "CNY",
"settlementCurrency": "USD",
"strike": strike
}
curveDates = [2025.08.21,
2025.08.27,
2025.09.03,
2025.09.10,
2025.09.22,
2025.10.20,
2025.11.20,
2026.02.24,
2026.05.20,
2026.08.20,
2027.02.22,
2027.08.20,
2028.08.21]
domesticCurveInfo = {
"mktDataType": "Curve",
"curveType": "IrYieldCurve",
"referenceDate": pricingDate,
"currency": "CNY",
"dayCountConvention": yearConv,
"compounding": "Continuous",
"interpMethod": "Linear",
"extrapMethod": "Flat",
"frequency": "Annual",
"dates": curveDates,
"values":[1.5113,
1.5402,
1.5660,
1.5574,
1.5556,
1.5655,
1.5703,
1.5934,
1.6040,
1.6020,
1.5928,
1.5842,
1.6068]/100
}
foreignCurveInfo = {
"mktDataType": "Curve",
"curveType": "IrYieldCurve",
"referenceDate": pricingDate,
"currency": "USD",
"dayCountConvention": yearConv,
"compounding": "Continuous",
"interpMethod": "Linear",
"extrapMethod": "Flat",
"frequency": "Annual",
"dates": curveDates,
"values":[4.3345,
4.3801,
4.3119,
4.3065,
4.2922,
4.2196,
4.1599,
4.0443,
4.0244,
3.9698,
3.7740,
3.6289,
3.5003]/100
}
instrument = parseInstrument(fxNonDeliverableForward)
domesticCurve = parseMktData(domesticCurveInfo)
foreignCurve = parseMktData(foreignCurveInfo)
spot = 7.1
npv = fxNonDeliverableForwardPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve)
print(npv)
domes_discount = 1.0 / exp(curvePredict(domesticCurve, delivery) * yearFrac(yearConv, pricingDate, delivery))
foreign_discount = 1.0 / exp(curvePredict(foreignCurve, delivery) * yearFrac(yearConv, pricingDate, delivery))
/*Foreign-currency settlement, where settlementCurrency is USD
(-1.0/spot * domes_discount + 1.0/strike * foreign_discount) * notionalAmount * spot*/
/*Domestic-currency settlement, where settlementCurrency is CNY
(spot * foreign_discount - strike * domes_discount) * notionalAmount*/
Related functions: parseInstrument and parseMktData
Product Field Description
| Field Name | Type | Description | Required |
|---|---|---|---|
| productType | STRING | Must be "Forward". | Yes |
| forwardType | STRING | Must be "FxNonDeliverableForward". | Yes |
| notionalAmount | DOUBLE | Notional amount, for example, 1E7. | Yes |
| notionalCurrency | STRING | Notional currency, for example, "USD". | Yes |
| instrumentId | STRING | Instrument ID | No |
| expiry | DATE | Expiry date | Yes |
| delivery | DATE | Delivery date | Yes |
| currencyPair | STRING | Currency pair, in a format such as "EURUSD", "EUR.USD", or
"EUR/USD". The following currency pairs are supported:
|
Yes |
| direction | STRING | Trade direction. Valid values: "Buy", "Sell" | Yes |
| strike | DOUBLE | Strike price | Yes |
| settlementCurrency | STRING | Settlement currency | Yes |
| domesticCurve | STRING | Name of the domestic discount curve referenced for pricing | No |
| foreignCurve | STRING | Name of the foreign discount curve referenced for pricing | No |
