I would like to get daily closing price for multiple stocks using eikon API and display them into a data frame python
For a deeper look into our Eikon Data API, look into:
Overview | Quickstart | Documentation | Downloads | Tutorials | Articles
I would like to get daily closing price for multiple stocks using eikon API and display them into a data frame python
Check out the discussion on this previous thread.
You can pass multiple instruments to the instruments argument of get_data method as a Python list.
instruments = ['AAPL.O', 'IBM.N', 'FB.O']
But the point is that you can use CodeCreator app in Eikon, which is very helpful in creating code samples for the retrieval of most all content available through Eikon Data APIs.
The example only shows one, but it is wrapped in a list. You can specify multiple stocks, comma-separated. For example:
df, err = ek.get_data( instruments = ['stock1', 'stock2', 'stock3'], fields = ['TR.CLOSEPRICE.Date','TR.CLOSEPRICE'], parameters = {'SDate':'2021-02-01','EDate':'2021-02-28','Curn':'USD'} )