question

Upvotes
Accepted
262 8 9 15

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-apijavamarket-by-orderlevel-2
icon clock
10 |1500

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

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 5.0 MiB each and 10.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 5.0 MiB each and 10.0 MiB total.

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

Click below to post an Idea Post Idea