For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 2 3

Retrieving chain instruments from ATS with Python

Is there any boilerplate Python code available for retrieving the underlying instruments of a (self created) chain on ATS? Thanks!

pythonelektronrefinitiv-realtimeelektron-sdktrepATS
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

Upvotes
Accepted
9.5k 10 5 7

Hello @joris.hoendervangers1

I suggest using WebSocket API. This API runs directly on your TREP infrastructure (Server Side API). It presents data in JSON format and uses WebSocket Standards-based. It can easy integration into multiple client technology including Python. Anyway, it requires TREP version 3.2.1 (or above) and enabling WebSocket API feature which is explained in ADS document. If you require further ADS or TREP helps, please submit your questions to TREP support team via Get Support

You can find Python example application in the WebSocket API Sample Applications which can be downloaded from GitHub at https://github.com/Refinitiv/websocket-api . For the developer document, please refer to WebSocket API Developer Guide .

I suggest you start with market_price.py shipped with the WebSocket API Sample Applications. Please modify host, port, user to yours and send_market_price_request(ws) function to request your chain from your ATS service on TREP. For example, I requested 0#.DJI from the service named API_ELEKTRON_EPD_RSSL:

    mp_req_json = {
        'ID': 2,
        'Key': {
            'Name': '0#.DJI',
            'Service': "API_ELEKTRON_EPD_RSSL"
        },
    }

When I run the python application, it shows the underlying instruments of the requested chain:

Hope this help.


chainresult.png (14.2 KiB)
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.

Thanks @Pimchaya for your answer. I am familiar with the WebSocket API. I am looking for some boilerplate Python code like @Olivier DAVANT created for his (Java) article https://developers.thomsonreuters.com/article/simple-chain-objects-ema-part-2. Currently I am mostly interested in retrieving the list of instruments once a day (so not setting up a channel for updates), but that might change in the future.

@joris.hoendervangers1

As far as I know, there is no boilerplate Python code for chain like created by Olivier DAVANT.