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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
201 3 2 2

defining FIDs in websocket API for streaming prices

I use the Python example : market_price_edpgw_authentication

I can run the example but I want to optimize the solution. There is no need to get in the initialization all the available FIDs. I only want to see with the initialization 10-15 FIDs and only want to receive updates for these FIDS. How do I define the FIDS in the request . In the demo video "view" was used but that isn't supported in the Python example.

treprdp-apiwebsocketsrrto
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.

Hello @wim.ooms,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Hello @wim.ooms

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks,


AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


Upvote
Accepted
9.6k 10 7 7

Hello @wim.ooms

You can add 'View' in the request to specify your preference fields. The example below show how to request BID(FID 22) and ASK(FID 25) field below:

 mp_req_json = {
        'ID': 2,
        'Key': {
            'Name': ric_name,
            'Service': service
        },
         'View': [
            22,
            25
        ]
    }

The example output:

SENT:
{
  "ID":2,
  "Key":{
    "Name":"JPY=",
    "Service":"ELEKTRON_DD"
  },
  "View":[
    22,
    25
  ]
}
RECEIVED: 
[
  {
    "Fields":{
      "ASK":106.86,
      "BID":106.83
    },
    "ID":2,
    "Key":{
      "Name":"JPY=",
      "Service":"ELEKTRON_DD"
    },
    "PermData":"AwEBUmw=",
    "Qos":{
      "Rate":"JitConflated",
      "Timeliness":"Realtime"
    },
    "SeqNumber":9406,
    "State":{
      "Data":"Ok",
      "Stream":"Open",
      "Text":"*All is well"
    },
    "Type":"Refresh"
  }
]

You can find view Python example in market_price_batch_view.py shipped with WebSocket API Sample Applications

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
24.6k 54 17 14

Hello @wim.ooms

Please refer to this Filtering the Field List – specifying a View tutorial regarding the View feature in Elektron WebSocket API.

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.