asyncio.get_event_loop().run_until_complete(asyncio.sleep(1))
i'm using asyncio loop to remain the ek.StreamingPrices function to remain the data stream open
i need to know since i'm continuously keeping the stream open and sleeping for one second
streaming_prices = ek.StreamingPrices(
instruments = newlist,
fields = ['BID','ASK','TRDPRC_1','ACVOL_1'],
on_refresh = lambda streaming_price, instrument_name, fields :
display_refreshed_fields(streaming_price, instrument_name, fields),
on_update = lambda streaming_price, instrument_name, fields :
display_updated_fields(streaming_price, instrument_name, fields)
)
streaming_prices.open()
while(true):
asyncio.get_event_loop().run_until_complete(asyncio.sleep(1))
streaming_prices.close()
If we go like above ...and put asyncio call in continuous while loop ....will after 1 second the code will again request for new streaming.open() request and it will be counted as 1 more request or it will just keep the current stream open and will not count it as a seperate request. This i'm asking in context of the number of streaming.open requests we can send in a day ..Also in one request how many instruments i can send for streaming prices . I need to get the AT THE MONEY strike prices of a particular option during a session ...instead of subscribing to all strikes is there a way i can subscribe to ATM strike RIC's in between the session ...I have used above streamingPrices open request only at start of the session .
In addition to that if I want to add one instrument during ongoing streaming prices stream ...how can i do that ....