Issue with Subscribing to Economic Data Stream (if possible?) - Status Remains 'Pending'

hyang
hyang Newcomer

Hi,

I'm working with the pricing stream API and I've encountered an issue specifically with subscribing to economic data.

I am able to successfully create a stream for bid and ask of EUR=. The stream opens correctly, the status changes to 'Live', and I receive updates as expected.

However, when I try to subscribe to economic data indicators, the stream status perpetually remains 'Pending' and never seems to go live. I don't receive any updates, nor do I get any error messages.
Here is the Python code snippet I'm using to define and open the stream for economic data (I only changed ticker and fields):

```Python
stream_definition = pricing.Definition( universe=["USJOB=ECI", "USOILC=ECI"],fields=["ECON_ACT", "RTR_POLL", "ECON_PRIOR"])
# Bind all necessary callbacks for verification stream = stream_definition.get_stream()
stream.on_status(self._on_status_change)
stream.on_update(self._on_update_received)
stream.on_error(self._on_error)
# Open the stream stream.open(with_updates=True) ```


I confirmed the status is Pending, but it never progresses beyond that.


Given that economic data is not continuous and is released at specific, scheduled times, should the stream correctly remain in a 'Pending' state until the moment of the data release? Or should it become 'Live' immediately after opening, and then just wait to send an update?


Any clarification or guidance on how to properly stream economic data would be greatly appreciated.


Thank you in advance!

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @hyang

    Thank you for reaching out to us.

    I ran the following code and could get the data properly.

    universes = [
        "USJOB=ECI", "USOILC=ECI"
    ]
    stream = pricing.Definition(universe=universes, fields=["ECON_ACT", "RTR_POLL", "ECON_PRIOR"]).get_stream()
    
    def on_message(data, instrument, stream):
        print("Message: ", instrument, data)
     
    stream.on_update(on_message)
    stream.on_refresh(on_message)
    stream.on_status(on_message)
    
    
    stream.open(with_updates=True)
    
    image.png

    You may need to enable the debug log by running the following code before opening a session.

    config = ld.get_config()
    config.set_param("logs.transports.file.enabled", True)
    config.set_param("logs.transports.file.name", "lseg-data-lib.log")
    config.set_param("logs.level", "debug")

    Please share the log file (lseg-data-lib.log) when the problem occurred.