Websocket api. How to get MID rates for FX rates

Options

Good Day!

We are currently receiving BID and ASK information for FX rates via weboscket api. C#
We have a need to get the MID-market exchange rate using the Refinitiv Real-time optimised product.

We could not find a suitable field in the protocol specification (https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/refinitiv-websocket-api)

How can we get a mid-market exchange rate? If we can't get it through the websocket api, what api can we use to get it?

Tagged:

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @Valery

    I just want to add some information added to my colleague's answer.

    You can use the WebSocket API View Feature to request only interested fields from the Refinitiv Real-Time.


    Example Code:

        string view = "{"
            + "\"ID\": 2,"
            + "\"Key\": {\"Name\":\"" + _ric + "\",\"Service\":\"" + _service + "\"},"
            + "\"View\":[\"BID\",\"ASK\",\"MID_PRICE\",\"MID_NET_CH\",\"MID_CLOSE\"]"
            + "}";
        SendMessage(view);

    Result:

    RECEIVED on Session1:
    [
      {
        "ID": 2,
        "Type": "Refresh",
        "Key": {
          "Service": "ELEKTRON_DD",
          "Name": "EUR="
        },
        "State": {
          "Stream": "Open",
          "Data": "Ok"
        },
        "Qos": {
          "Timeliness": "Realtime",
          "Rate": "JitConflated"
        },
        "PermData": "AwEBUmw=",
        "SeqNumber": 40558,
        "Fields": {
          "BID": 1.0531,
          "ASK": 1.0535,
          "MID_PRICE": 1.0533,
          "MID_NET_CH": 0.0008,
          "MID_CLOSE": 1.0525
        }
      }
    ]

    An example of the View feature in C# is the MarketPriceBatchViewExample.cs example file in the GitHub https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/CSharp link. The file is for the deployed RTDS connection but the View logic is the same as the RTO connection.

Answers