LSEG Data Library for TypeScript

HistoricalPricing.Metadata.ViewList.Definition methods

getData

The getData function is used to send a request to the Delivery Platform (formerly Refinitiv Data Platform) to retrieve the historical pricing data described by HistoricalPricing.Metadata.ViewList objects.

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 demonstrates how to retrieve the historical pricing view list data for specific instrument.

const definition = HistoricalPricing.Metadata.Viewlist.Definition({
    name: 'TRI.N'
});

const response = await definition.getData();

console.log(response.data.raw);
{
    "events":{
        "name":"Trade",
        "fields":["EVENT_TYPE","RTL","SOURCE_DATETIME","SEQNUM","TRDXID_1","TRDPRC_1","TRDVOL_1","VWAP","BID","BIDSIZE","ASK","ASKSIZE","PRCTCK_1","YIELD","UPLIMIT","LOLIMIT","PCTCHNG","TRADE_ID","TRD_STATUS","HALT_RSN","NETCHNG_1","OPEN_PRC","HIGH_1","LOW_1","TRD_AUCTYP","OF_VWAP_FL","MK_VWAP_FL","RF_VWAP_FL","ELIGBL_TRD","TC_TRD_FLG","QUALIFIERS","TAG"],"displayUnits":["","","","","","D6","D0","D6","D6","D0","D6","D0","","","D6","D6","D6","","","","D6","D6","D6","D6","","","","","","","",""]
    },
    "summaries":[{
        "intervalCode":"TICK","interval":"Tick","defaultView":"TRDPRC_1",
        "views":[{"name":"YIELD","desc":"Yield","fields":["VALUE","VOLUME"],"mapTo":["YIELD","TRDVOL_1"],"type":["Yield","Volume"],"displayUnits":["","D0"],"event":"Trade"},{"name":"TRDPRC_1","desc":"Trade Price","fields":["VALUE","VOLUME"],"mapTo":["TRDPRC_1","TRDVOL_1"],"type":["Price","Volume"],"displayUnits":["D6","D0"],"event":"Trade"},{"name":"BID","desc":"Bid","fields":["VALUE","VOLUME"],"mapTo":["BID","BIDSIZE"],"type":["Price","Volume"],"displayUnits":["D6","D0"],"event":"Quote"},{"name":"ASK","desc":"Ask","fields":["VALUE","VOLUME"],"mapTo":["ASK","ASKSIZE"],"type":["Price","Volume"],"displayUnits":["D6","D0"],"event":"Quote"},{"name":"VWAP","desc":"VWAP","fields":["VALUE"],"mapTo":["VWAP"],"type":["Price"],"displayUnits":["D6"],"event":"Trade"},{"name":"MID_PRICE","desc":"Mid Price","fields":["VALUE"],"mapTo":["MID_PRICE"],"type":["Price"],"displayUnits":["D6"],"event":"Quote"},{"name":"PCTCHNG","desc":"Percentage Change","fields":["VALUE"],"mapTo":["PCTCHNG"],"type":["Price"],"displayUnits":["D6"],"event":"Trade"},{"name":"NETCHNG_1","desc":"Net Change","fields":["VALUE"],"mapTo":["NETCHNG_1"],"type":["Price"],"displayUnits":["D6"],"event":"Trade"},{"name":"LOLIMIT","desc":"Lower Limit","fields":["VALUE"],"mapTo":["LOLIMIT"],"type":["Price"],"displayUnits":["D6"],"event":"Trade"},{"name":"UPLIMIT","desc":"Upper Limit","fields":["VALUE"],"mapTo":["UPLIMIT"],"type":["Price"],"displayUnits":["D6"],"event":"Trade"}]
    }]
}

None.

72 words (0:23 mins)