Is there any boilerplate Python code available for retrieving the underlying instruments of a (self created) chain on ATS? Thanks!
Hello @Joris H.
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.
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.