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
-
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)
};0
Answers
-
It should be used like this:
DataRequest = new DSDataRequest()
{
Instrument = new DSInstrument() { Value = "VOD" },
DataTypes = new[] { new DSDataType() { Value = "PL" } },
Date = new DSDate()
{
Kind = DSDateKind.TimeSeries,
Start = DSDateNames.BDATE.ToString(),
End = DSDateNames.LATESTDATE.ToString(),
Frequency = DSDateFrequencyNames.D.ToString()
}
}0 -
Hello,
Thank you for your reply.
I tried to use your sample code but I get the following compilation errors in Visual Studio :'DSDate' is inaccessible due to its protection level
'DSDateKind' is inaccessible due to its protection level
DSDateNames' is inaccessible due to its protection level
'DSDateFrequencyNames' is inaccessible due to its protection levelWhen I navigate to the implementation of theses classes (DSWS API metadata) I see that their protection level is set to internal
I'm using the 1.1.1.0 version of the .NET 4.5 API that I downloaded here : http://product.datastream.com/DswsClient/Docs/Downloads.aspx (release date 24 Jul 2020)
Am I doing something wrong ?
0 -
Works like a charm, thank you !
0 -
Hello,
Could you give me the C# code to retreive the Latest Value ?
i.e. the equivalent of the following Excel formula :
=DSGRID("FR0013154002","SOTDDP018","Latest Value")
Thank you
0 -
You can try with the LastestDate.
var DataRequest = new DSDataRequest()
{
Instrument = new DSInstrument("FR0013154002"),
DataTypes = new DSDataTypes("SOTDDP018"),
Date = new DSSnapshotDate(DSDateType.Literal(DSDateLiterals.LatestDate))
};0 -
Hello,
I tried that but the C# return no value, while the Excel formula returns 9.3 on the provided example.
0 -
I have run it and it returns 9.3.
0 -
I'm sorry you are right.
Could you try with the following example ?
=DSGRID("SE0000103699","SOEQO08V","Latest Value","","","RowHeader=true;ColHeader=true;DispSeriesDescription=true;DispDatatypeDescription=true","")
=> This one returns 0.024
In C#, it returns "NA"
0 -
=DSGRID("SE0000103699","SOEQO08V","Latest Value","","","RowHeader=true;ColHeader=true;DispSeriesDescription=true;DispDatatypeDescription=true","")
From my test, the =DSGRID function also returns NA.
0 -
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 249 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛