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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
9 5 4 4

How to get correct Factor of ABS by REST API

I used REST API to get ABS's Factor infomation. But it seems i did not get corrected number.

On gui the Factor decimal places is 8. But the decimal places of Factor which I get by REST API is 6. How can i get corrected Factor by REST API.

I attach my source code here, can you help me to fix it to get 8 decimal places Factor.

My source code is:

var ExtractionsContext = ReutersServiceConnect<ExtractionsContext>();

var identiferList = InstrumentIdentifierList.Create(new ThomsonReuters.Dss.Core.RestApi.DssCollection<InstrumentIdentifier>());
if (referenceType == ISINValue)
{
identiferList.InstrumentIdentifiers.Add(new InstrumentIdentifier { Identifier = referenceCode, IdentifierType = IdentifierType.Isin });
}
else if (referenceType == RICValue)
{
identiferList.InstrumentIdentifiers.Add(new InstrumentIdentifier { Identifier = referenceCode, IdentifierType = IdentifierType.Ric });
}
else if (referenceType == CUSIPValue)
{
identiferList.InstrumentIdentifiers.Add(new InstrumentIdentifier { Identifier = referenceCode, IdentifierType = IdentifierType.Cusip });
}

var extractionRequest = new TrancheFactorHistoryExtractionRequest
{
IdentifierList = identiferList,
ContentFieldNames = new[] { "Factor", "Factor Date" },
};

var extractionResult = ExtractionsContext.ExtractWithNotes(extractionRequest);
var extractedRowsResult = extractionResult.Contents;

dss-rest-apidatascope-selectdssrest-api
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.

@shigekawa.shuichi.rr4, how did you extract this in the GUI ?

I just tried creating a scheduled extraction for RIC 23323CCP8=FINR, it delivered the same number of decimals as the API (for the API I used an HTTP On Demand request in Postman). In both cases I received 6 decimals, like in the latest value here: .019576

If you edit the decimal places of Factor to 14 in report template, you get 8 decemals factor.

editfield.png (24.7 KiB)
decimalplaces.png (20.3 KiB)

@shigekawa.shuichi.rr4, ok, yes, of course, thank you.

That is the GUI equivalent of customizing the report template through the API, using the DecimalPlaces property, as discussed in this other query.

Such customization is not possible for an On Demand call (which is what your code is making).

Hello @shigekawa.shuichi.rr4,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
13.7k 26 8 12

@shigekawa.shuichi.rr4, see the answer to this other query, the number of decimals returned for an On Demand request cannot be customized.

Edit: it can be done if you use a scheduled extraction. That requires creating an instrument list, report template and schedule on the server, the workflow is different from an On Demand request (which is what your code is doing).

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.