irCrossCurrencyCurveBuilder

First introduced in version: 3.00.4

Syntax

irCrossCurrencyCurveBuilder(referenceDate, currency, instNames, instTypes, terms, quotes, currencyPair, spot, dayCountConvention, discountCurve, [compounding='Continuous'], [frequency='Annual'], [curveName])

Details

Builds a cross-currency interest rate swap yield curve.

Parameters

referenceDate A DATE scalar specifying the reference date of the yield curve.

currency A STRING scalar specifying the currency code of the curve. Supported values: "CNY", "USD", "EUR", "GBP", "JPY", "HKD".

instNames A STRING vector indicating the instrument names.

instTypes A STRING vector indicating the instrument types.

Currently instTypes only supports "FxSwap", and instNames should be currency pairs, e.g., "USDCNY".

terms A vector of STRING or DURATION type, indicating the remaining maturity, e.g., "1M".

quotes A numeric vector indicating the market quotes.

currencyPair A STRING scalar specifying the currency pair, in the format "EURUSD", "EUR.USD", or "EUR/USD". Supported currency pairs include:

  • "EURUSD": Euro to US Dollar

  • "USDCNY": US Dollar to Chinese Yuan

  • "EURCNY": Euro to Chinese Yuan

  • "GBPCNY": British Pound to Chinese Yuan

  • "JPYCNY": Japanese Yen to Chinese Yuan

  • "HKDCNY": Hong Kong Dollar to Chinese Yuan

spot A DOUBLE scalar specifying the spot exchange rate on the reference date.

dayCountConvention is a STRING scalar or vector indicating the day count convention to use. It can be:

  • "ActualActual": actual/actual

  • "Actual360": actual/360

  • "Actual365": actual/365

  • "ActualActualISMA": actual/actual according to ISMA (International Securities Market Association) convention

  • "ActualActualISDA": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.

  • "Thirty360EU": European 30/360

  • "Thirty360US": US (NASD) 30/360

discountCurveA MKTDATA object of type IrYieldCurve, indicating discount curve for the other currency in the currency pair, which must be a yield curve built using the bootstrap method. See Curve Field Specifications for details.

compounding (optional) A STRING scalar defining the compounding method. Options:

  • "Compounded": Discrete compounding

  • "Simple": Simple interest

  • "Continuous" (default): Continuous compounding

frequency (optional) A STRING scalar specifying the interest payment frequency. Supported values:

  • "NoFrequency": No payment frequency

  • "Annual": Annually

  • "Semiannual": Semiannually

  • "EveryFourthMonth": Every four months

  • "Quarterly": Quarterly

  • "BiMonthly": Every two months

  • "Monthly": Monthly

  • "EveryFourthWeek": Every four weeks

  • "BiWeekly": Every two weeks

  • "Weekly": Weekly

  • "Daily": Daily

  • "Other": Other frequencies

curveName (optional) A STRING scalar indicating the yield curve name. The default value is NULL.

Returns

A MKTDATA object.

Examples

refDate = 2025.08.18
spotDate1 = temporalAdd(refDate, 2, "XNYS")  
spotDate2 = temporalAdd(refDate, 2, "CFET")  
spotDate = max(spotDate1, spotDate2)
instNames = take("USDCNY", 13)
instTypes = take("FxSwap", 13)
terms = ["1d", "1w", "2w", "3w", "1M", "2M", "3M", "6M", "9M", "1y", "18M", "2y", "3y"]
curveDates = array(DATE)
for(term in terms){
    dur = duration(term)
    days1 = transFreq(temporalAdd(spotDate, dur), "XNYS", "right", "right")
    days2 = transFreq(temporalAdd(spotDate, dur), "CFET", "right", "right")
    curveDates.append!(max(transFreq(temporalAdd(spotDate, dur), "XNYS", "right", "right"), transFreq(temporalAdd(spotDate, dur), "CFET", "right", "right")))
 }
quotes = [-5.54, 
          -39.00, 
          -75.40, 
          -113.20, 
          -177.00, 
          -317.00, 
          -466.00, 
          -898.50, 
          -1284.99, 
          -1676.00, 
          -2320.00, 
          -2870.00, 
          -3962.50] \ 10000  // fx swap points

cnyShibor3m = {
    "mktDataType": "Curve",
    "curveType": "IrYieldCurve",
    "referenceDate": refDate,
    "currency": "CNY",
    "dayCountConvention": "Actual365",
    "compounding": "Continuous",
    "interpMethod": "Linear",
    "extrapMethod": "Flat",
    "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,
    "settlement": spotDate
}

cnyShibor3m = parseMktData(cnyShibor3m)

spot = 7.1627
curve = irCrossCurrencyCurveBuilder(refDate, "USD", instNames, instTypes, terms, quotes, "USDCNY", spot, "Actual365", cnyShibor3m, "Continuous")
curveDict = extractMktData(curve)
for(i in 0..(size(quotes)-1) ){
    print(curveDict["values"][i]*100)
}

Releated functions: bondYieldCurveBuilder, irSingleCurrencyCurveBuilder, parseMktData

Curve Field Specifications