getInstrumentCurrencyPair

Syntax

getInstrumentCurrencyPair(instrument)

Details

Get the currency pair of the input instrument(s).

Arguments

instrument is an INSTRUMENT scalar/vector indicating one or more instrument objects.

Returns

A scalar/vector of STRING type.

Examples

forward = {
    "productType": "Forward",
    "forwardType": "FxForward",
    "version": 0,
    "expiry": 2025.09.24,
    "delivery": 2025.09.26,
    "currencyPair": "USDCNY",
    "direction": "Buy",
    "notional": ["USD", 1E8],
    "strike": 7.2
}
ins = parseInstrument(forward)
getInstrumentCurrencyPair(ins)
// output: USDCNY

Related functions: parseInstrument, getInstrumentField, getInstrumentKeys