question

Upvotes
Accepted
5 0 0 7

Python API refinitiv.data , how to query internal RIC (ATS)

Hi,


I would like to perform the same query(in Excel) with Python Data library API:

This return NA (but works for XAG):

1673273538232.png


Thanks for the help.


Regards

python#technology#productapiquery-string
1673273538232.png (21.9 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.

Upvote
Accepted
10.2k 18 6 9

@fabien.marcaillou I believe you would need to get a snapshot price from a websocket connection - specifying the DTS source using the service parameter.

stream = rd.open_pricing_stream(
    universe=['WMAUDCHF'],
    service = 'DTS',
    fields=['BID', 'ASK']
)
stream.open()
stream.get_snapshot()

Please see if this can work for you. I got this from the RD library Access Layer - Pricing Stream example on github here. I hope this can help.

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
79.3k 253 52 74

@fabien.marcaillou

Thanks for reaching out to us.

The RD Library can be configured to connect to the locally deployed RTDS.

 "sessions": {
        "default": "platform.deployed",
        "platform": {
            "rdp": {
                "app-key": "<app key>",
                "username": "<rdp user>",
                "password": "<rdp password>"
            },
            "deployed": {
                "app-key": "<app key>",
                "realtime-distribution-system": {
                    "url" : "127.0.0.1:15000",
                    "dacs" : {
                        "username" : "api",
                        "application-id" : 256,
                        "position" : ""
                    }
                }
            }
        },
...

Then, you can use the following code to retrieve data from the ATS or DTS service on the local RTDS.

non_streaming = rd.content.pricing.Definition(
    ['TEST.BK'],    
    service="ATS"
).get_stream()

# We want to just snap the current prices, don't need updates
# Open the instrument in non-streaming mode
non_streaming.open(with_updates=False)

# Snapshot the prices at the time of the open() call
non_streaming.get_snapshot()

The output is:

1673345953863.png

These are services available on my local ADS.

1673346004429.jpeg



1673345953863.png (33.6 KiB)
1673346004429.jpeg (24.5 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.

Upvotes
5 0 0 7

Thanks everyone for the answers, it's working now.


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.

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.