question

Upvotes
Accepted
262 12 15 18

How to Label field for the Content Fields of Market Depth and Time/Sales report template of TRTHv2 via REST API JAVA

I have tried the following:
JSONOrderedObject reportTemplateJSONObject = new JSONOrderedObject()
                .put("@odata.type", "#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.TickHistoryTimeAndSalesReportTemplate")
                .put("ShowColumnHeaders",true)
                .put("Name", trthTickReportTemplateName )
                .put("Headers", new JSONArray() )
                .put("Trailers", new JSONArray() ) 
                .put("ContentFields", new JSONArray()
                    .put( new JSONObject()
                        .put("FieldName", "Quote - Ask Price")
                        .put( "Format", JSONObject.NULL)
                        .put("Label", "Quote - Ask Price"))
                    .put( new JSONObject()
                        .put("FieldName", "Quote - Ask Size")
                        .put( "Format", JSONObject.NULL)
                        .put("Label", "Quote - Ask Size"))
                    .put( new JSONObject()
                        .put("FieldName", "Quote - Bid Price")
                        .put( "Format", JSONObject.NULL)
                        .put("Label", "Quote - Bid Price"))
                    .put( new JSONObject()
                        .put("FieldName", "Quote - Bid Size")
                        .put( "Format", JSONObject.NULL)
                        .put("Label", "Foo - Bid Size"))
                    )
                .put("Condition", new JSONOrderedObject()
                     .put("ApplyCorrectionsAndCancellations", false)
                     .put("MessageTimeStampIn", "LocalExchangeTime") //All rics in this template are for london so extract in london time
                     .put("QueryStartDate", sdfz.format(c1.getTime()))
                     .put("QueryEndDate", sdfz.format(c2.getTime()))
                     .put("ReportDateRangeType", "Range")
                     .put("SortBy", "SingleByTimestamp")
                     );


I have done something similar for MarketDepth template as well. I understand the Depth is trickier as you can have multiple levels, but my hope is that if I specify something like the below then I would get “L1-My AskPrice”, “L2-My Ask Price” etc.


.put("ContentFields", new JSONArray()
                    .put( new JSONObject()
                        .put("FieldName", "Ask Price")
                        .put( "Format", JSONObject.NULL)
                        .put("Label", "My Ask Price"))


Client is trying to Label content fields to constrain the column headers returned so that she knew what column the respective data is in.

For example:

-when she specify FieldName “Quote – Ask Price” for Time and Sales report template the resulting column is “Ask Price”

-when she specify FieldName “Ask Price” for Market Depth report template, the resulting column is “L1-AskPrice"

She is saying "the columns in the csv are also not in the same order as she put in her JSON object. Basically, when we create interface adapters we try to avoid hard coding values, plus who’s to say your API returned column header names does not change in the future, so basically I need a way of labelling the columns so I know for each FieldName exactly what column index it will be or failing that what header name it will be.please advise why the above two code snippets are having no effect on the column headers returned?"

tick-history-rest-apijavalevel-2market-by-order
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.

@Beera.Rajesh

This is a good opportunity to suggest to your customer to use the TRDC portal and forum. It is free, he can use a pseudo to avoid sharing his identity, he can find documentation, downloads, tutorials, and post queries on the forum directly. The contents of the forum are kept up to date, and the forum is quite active, so he will usually get quick responses.

@Beera.Rajesh

I can reproduce this. After adding labels to a Tick History T&S report template using the API call I could see the labels in the GUI. But I observe the same as the customer, it had no influence on the output.

Escalated to Troy Dalldorf.

Hi @Beera.Rajesh

Thank you for your participation in the forum. Is any of the replies 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

Upvote
Accepted
36 0 2 1

As @Troy-Dalldorf says, it's not currently possible to customize field labels, nor ordering, of Tick History content.

It's certainly something which we could consider for a future release, so I'd be delighted to hear of specific use-cases which make this feature valuable, to allow for appropriate prioritization.

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.

Upvotes
465 3 5 3

It is not possible to customize the field labels for Tick History. We should be returning a validation error (400) when a custom label is attempted.

I will investigate the field ordering issue.

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.

Hi Troy, when can we expect next update on this so that I will set the expectations to client accordingly.

@Troy Dalldorf

The client would like to know when they can expect the next update on this. Please kindly respond.

I have sent a request to product management and waiting for a response. I CC'd you on the email.

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.