LSEG Data Library for TypeScript

getData

The getData function is used to send a request to the Delivery Platform (formerly Refinitiv Data Platform) to retrieve the data described by the Option.Definition object.

Syntax

definition.getData(session?: Session)

Parameters

Value Description Data type Optional Default value
session Session object. If it's not passed the default session will be used. Session Yes -

Returned value

ContentResponse object.

Usage

The following example shows how to get data for 'Fx' underlyingType:

const definition = IPA.FinancialContracts.Option.Definition({
    underlyingType: IPA.FinancialContracts.Option.UnderlyingType.Fx,
    strike: 265,
    underlyingDefinition: {
        fxCrossCode: 'AUDUSD',
    },
    notionalCcy: 'AUD',
    tenor: '5M',
    pricingParameters: {
        priceSide: IPA.FinancialContracts.Option.PriceSide.Mid,
        valuationDate: '2018-08-06',
        pricingModelType: IPA.FinancialContracts.Option.PricingModelType.BlackScholes,
        fxSpotObject: { bid: 0.7387, ask: 0.7387, mid: 0.7387 },
    },
    outputs: [IPA.FinancialContracts.Option.Outputs.Data, IPA.FinancialContracts.Option.Outputs.Headers],
    fields: ['YieldPercent'],
    extendedParams: {
        fields: ['NotionalAmount', 'DeliveryStartDate', 'ValuationDate'],
    },
});

const result = await definition.getData();

console.log(result.data);

None.

64 words (0:20 mins)