DSWS C# API : how to use the LatestDate function in a DSDataRequest

Hello,

Following the question asked in this thread : https://community.developers.refinitiv.com/questions/45289/dsws-net-api-get-latest-value-of-a-time-series.html, could I get a sample explaining how to use the LatestDate function in a DSDataRequest ?

var request = new DSDataRequest()
{
Instrument = new DSInstrument(isin),
DataTypes = new DSDataTypes(dataTypes),
//Date = new DSTimeSeriesDate(dsDate, dsDate, DSDateFrequency.Daily)
Date = ????
};

I checked the API documentation but it won't help (http://product.datastream.com/DswsClient/Docs/soapapihelp/EnumDetails.html#DSDateNames)

Thank you for your help

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @ammeggs

    Sorry for the confusion.

    I used the example code from here. I think it generates the DataStream classes from the WSDL file.

    If you use the library from http://product.datastream.com/DswsClient/Docs/Downloads.aspx, the code should look like this:

    var request = new DSDataRequest()
    {
        Instrument = new DSInstrument("VOD"),
        DataTypes = new DSDataTypes("PL", "PH"),
        Date = new DSTimeSeriesDate(DSDateType.Literal(DSDateLiterals.BaseDate), DSDateType.Literal(DSDateLiterals.LatestDate), DSDateFrequency.Daily)
    };


Answers