I want to get real-time stock price for S&P 500 constituents and S&P 500 Index.
I did it 2 ways, there are each problem. And there are delayed data only.
Do I need additional subscription charged?
Please check there are any problem.
1.
spx_cons = ['MMM.N', 'AOS.N', 'ABT.N', ....]
data, err = ek.get_data(spx_cons, ['CF_LAST'])
Through this way, there are not real-time price. only 15 minutes delayed data.
If I uncheck "Automatically switch to delayed data" in workspace setting, then I get real-time data? not delayed?
2.
rd.open_session()df = rd.get_data('0#.SPX',['TR.RIC'])stream = rd.open_pricing_stream(
universe= df['Instrument'].tolist(),
fields=['BID', 'ASK']
)stream.get_snapshot()
In this way, there are not real-time price, only delayed data, too
And, I want to get recently contract price, not bid or ask. Is there field?
I think Second method is more better for me. Because it's streaming.
Please help me
Thank you