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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 0 0 2

Field List

I am using the market_price_rdpgw_service_discovery.py and was wondering how I can get back only the Bid and Ask field? When i pass in the following, I am getting back many more attributes than i requested. What data types does the 'Field' attribute accept? Many thanks

    def _send_market_price_request(self, ric_name):
        """ Create and send simple Market Price request """
        mp_req_json = {
            'ID': 2,  # market data=2, Login=1
            'Key': {
                'Name': ric_name,
                'Service': service,
                'Field': ['BID', 'ASK']
            },
        }


websocketspython 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.

1 Answer

Upvote
Accepted
24.9k 86 10 22

hi @mark.banford-Lawrence

Please refer to the Websocket API Tutorials - where you can find one on Filtering the Field List

So for, example:

{
  "ID":2,
  "Key":{
    "Name":"VOD.L"
  },
  "View":[
    "BID",
    "ASK",
    "BIDSIZE"
  ]
}

will filter for only BID, ASK and BIDSIZE

You should be aware, however, that if the server is too busy to filter, it may ignore the request and send you an unfiltered list - rare - but it can happen and your code should be able to cope with such an occurrence.

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.