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:

image

This return NA (but works for XAG):

1673273538232.png


Thanks for the help.


Regards

Best Answer

  • @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.

Answers

  • @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


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