question

Upvotes
Accepted
1 1 4 8

I am stuck while trying TRTH Python code. How can I get help in this?

tick-history-rest-apirest-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.

@sreedhanya.kavunkara, please tell us exactly:

  • What code you are using (is this an existing sample, or something you made). If it is your own code, or if you modified an existing sample, then please post it as an attachment.
  • What makes you say it is "stuck". What are the symptoms or error messages you observe ?

@sreedhanya.kavunkara

Is this still be an outstanding question for you? Can you provided requested information?

@moragodkrit, I am able to run the code. It works at times, and sometimes it pulls an error also. I shared the screenshot with Christiaan, and according to him it is a connection issue, TRTH server being unavailable.

Now, my requirement is to pull not the intraday data, but end of day data available in IDN for a set of Commodities and derivatives RICs. I wanted to compare the NDA timeseries data and IDN data for a quality check purpose, as we get client queries on this very frequently. I need to check the last_price and TRADE_DATE from IDN. Please let me know how you can help me.

Here are 2 example RICs - WPBEURYZ9, FROTC-B-DA=ARG.

I have to pull the TRADE_DATE and LAST_PRICE for around 25000 RICs everyday.

Hi,

can anyone help me on this?

Sree

@sreedhanya.kavunkara

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Hi @sreedhanya.kavunkara

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

If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
13.7k 26 8 12

@sreedhanya.kavunkara,

You want to pull end of day data (TRADE_DATE and LAST_PRICE) for around 25000 RICs everyday.

How to identify the API call that delivers the fields you want

You can use the data dictionary to identify which calls deliver the fields you want. In sheet Field Descriptions, search in column Field Name for Last, and you will see that the Elektron Timeseries call delivers it. It also delivers a Trade Date.

A call can be done On Demand or be scheduled. These 2 approaches are described in the Tutorials Introduction.

The Elektron TimeSeries call

The Elektron Timeseries call delivers End of Day data. REST API Tutorial 7 describes this call and its parameters, done using an On Demand request, with the 2 fields you are interested in (and a few more). You can refer to the API Reference Tree for additional information on the parameters (you must first select the appropriate call in the first parameter's dropdown, i.e. ElektronTimeSeriesExtractionRequest).

Implement the call in your Python code

We do not have a Python sample for this call, but it would be easy for you to make one, using the TRTH_OnDemand_IntradayBars sample (available in the downloads) as a starting point. In step 2 you need to implement a way to populate the InstrumentIdentifiers array. You must change the requestBody to do an Elektron Timeseries call, with your parameters. As you have 25k instruments, delete step 4. Step 5 will save the data to file. Step 6 can be deleted as well, it is purely cosmetic.

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.

@sreedhanya.kavunkara, a new version of the on demand Python sample is available under the downloads tab. It has been enhanced to manage an eventual initial HTTP 200 response (which is rare but could happen, as you saw when changing the type of request). Hope this helps.

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.