What is a "universe" in the rdp.steamingPrices API for news headlines

streaming_prices = rdp.StreamingPrices(

universe = ['NFCP_UBMS'],

on_update = lambda streaming_price, instrument_name, fields :

display_news_headline(streaming_prices, instrument_name, fields)

)


So the code block above has a universe. And I'm not sure what it means and what values it takes in. Could someone help me out please?


Thank you!

Best Answer

  • nick.zincone
    nick.zincone admin
    Answer ✓

    Hi @bregarious,

    The universe parameter in the rdp.StreamingPrices() refers to the list of instruments or RICs that provide real-time, streaming updates. In your case, you are specifying a streaming news headline RIC ('NFCP_UBMS') which will return headlines and some other metadata fields.

    If you simply want to use the 'NFCP_UBMS' streaming RIC to retrieve streaming headlines, try this:

    sp = rdp.StreamingPrices(universe = ['NFCP_UBMS'], 
    on_update = lambda streaming_price, instrument_name, fields :
    print(f'Headline => {fields["HEADLINE1"]}'))

Answers