Streaming Previous Values when fail to consume streaming prices

Because of heavy load on application, we have observed that if we fail to read Streaming data on time, application receive many previous values callbacks as part of Sync.


Can We have one flag segregating that values are real Update type or part of "Sync". So from application we can ignore all flag = 'Sync' and we can work on real update values.

Best Answer

  • umer.nalla
    umer.nalla LSEG
    Answer ✓

    Hi @mehul.gautambhai

    For the benefit of anyone interested in the StreamingPrice Cache feature in RDP Python Lib, the following snippets are examples (using library v1.0.0a6)

    Assuming you have already created a session, the following created and opens the stream:

    streaming_prices = rdp.StreamingPrices(universe=['VOD.L'], fields=['BID','ASK','ACVOL_1', 'OFFCL_CODE'])
    streaming_prices.open()

    and then whenever you want to query the cache you can call:

    streaming_prices.get_snapshot()

    to get the latest values for all the fields in the cache e.g.

    image

    Or you could do something like this to get a single field:

    streaming_prices['VOD.L']['BID']

    or to get the values in a dataframe:

    df.to_dict('records')

    to give you something like:

    [{'Instrument': 'VOD.L',  'BID': 108.82,  'ASK': 108.86,  'ACVOL_1': 39056252,  'OFFCL_CODE': 'BH4HKS3'}]


Answers