Hello. I am trying to retrieve current prices using the Python example you provided, but getting responds every 3 sec, while in the Eikon I see few ticks every sec.
import eikon as ek
from datetime import datetime
def display_fields(streaming_prices, instrument_name, fields):
print(datetime.now(), " Fields received for", instrument_name, ":", fields)
if __name__ == "__main__":
print("Starting")
ek.set_app_key('xxx)
print("Connected")
streaming = ek.StreamingPrices(
instruments=['EUR='],
service = 'IDN_RDFNTS_CF',
fields=['SALTIM', 'CF_BID', 'CF_ASK', 'OPEN_PRC', 'CF_HIGH', 'CF_LOW', 'CF_CLOSE'],
on_refresh=lambda streaming_prices, instrument_name, fields:
display_fields(streaming_prices, instrument_name, fields),
on_update=lambda streaming_prices, instrument_name, fields:
display_fields(streaming_prices, instrument_name, fields)
)
streaming.open()
while True:
if streaming.state != "Open":
streaming.open()
streaming.close()