For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
3 0 1 4

Problem requesting Intraday Summary data for Historical Identifiers using .NET

Hi, I've run into a problem requesting historical intraday data for non-current identifiers.

This code works fine for the current RIC WH0:

var extractionRequest = new TickHistoryIntradaySummariesExtractionRequest()
{
IdentifierList = new InstrumentIdentifierList()
{
InstrumentIdentifiers = new[] { new InstrumentIdentifier { Identifier = "WH0", IdentifierType = IdentifierType.Ric } }
},
Condition = new TickHistoryIntradaySummariesCondition()
{
DaysAgo = null,
MessageTimeStampIn = TickHistoryTimeOptions.GmtUtc,
QueryEndDate = DateTime.UtcNow,
QueryStartDate = DateTime.UtcNow - TimeSpan.FromYears(20),
ReportDateRangeType = ReportDateRangeType.Range,
ExtractBy = TickHistoryExtractByMode.Ric,
SortBy = TickHistorySort.SingleByRic,
DisplaySourceRIC = false,
SummaryInterval = TickHistorySummaryInterval.FifteenMinutes,
TimebarPersistence = true
},
ContentFieldNames = new[]
{
"Close Ask", "Close Bid", "Volume", "Last"
}
};
extractionsContext.Options.AutomaticDecompression = true; //Decompress gzip to plain text
var extractionResult = extractionsContext.ExtractRaw(extractionRequest);


When I then try to get data for historical RIC "WH3", the above code runs but returns no data.

I then tried changing to use "HistoricalInstrumentIdentifier" instead of "InstrumentIdentifier" (line 5), but I get this error:

"Cannot use a HistoricalInstrumentIdentifier when the ReportDateRangeType is not set to PerIdentifier.'"


So, as the error suggested, I changed to use ReportDateRangeType.PerIdentifier. However, I then get this error:

"ThomsonReuters.Dss.Api.ForbiddenException: 'Not authorized to perform extraction with ReportDateRangeType set to PerIdentifer.'"


I am able to request this data via the DSS web portal manually so I don't think I am unauthorized.


What do you suggest to get this working please?

dss-rest-apidatascope-selectdsshistorical
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
13.7k 26 8 12

@rfewster,

The issue is that WH3 is a historical instrument, it was quoted between 2001 and 2013.

What is missing to handle that is to set the instrument validation options to allow historical instruments (they are not allowed by default, and the user preferences set in the GUI only apply to scheduled requests, not to on demand requests).

Below is your sample code, slightly modified, it should do the trick. I pulled out the creation of the instrument identifiers array. It is followed by an instruction to set the validation option we need. After that is your extraction request, inside which I changed the creation of the identifier list, to use 3 parameters: the instrument identifiers array, the validation options, and a 3rd parameter which is required if the second one is set (it disables user preferences):


InstrumentIdentifier[] InstrumentIdentifiers = new[] {

new InstrumentIdentifier { Identifier = "WH3", IdentifierType = IdentifierType.Ric }

};

InstrumentValidationOptions ValidationOptions = new InstrumentValidationOptions { AllowHistoricalInstruments = true };

var extractionRequest = new TickHistoryIntradaySummariesExtractionRequest()

{

IdentifierList = InstrumentIdentifierList.Create(InstrumentIdentifiers, ValidationOptions, false),

Condition = new TickHistoryIntradaySummariesCondition()

{

DaysAgo = null,

...


Hope this helps.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.