How can I add multiple instruments/RICs simultaneously to the CodeCreator?

Greetings, I am using the CodeCreator to access price and volume data for all the instruments in a particular exchange. I have the list of individual RICs/instruments, but cannot seem to enter them into the CodeCreator all at one time. I have tried several different delimiters, but the instrument search only seems to accept one search term at a time. Is it possible to paste multiple RICs into the instrument search field using a particular format?

Best Answer

  • raksina.samasiri
    Answer ✓

    Hi @rpm5495 ,

    As far as I know, pasting a list of instruments into the CodeCreator isn't supported yet. However, I'd like to suggest a workaround by clicking on the button at the bottom right of the CodeCreator, either 'Copy to Clipboard' or 'Open in CodeBook' and then add the list of instruments into the code as a Python list, for example

    In the CodeCreator, I click on the 'Copy to Clipboard'

    1674806338773.png

    And I paste the code in the CodeBook app or Jupyter Notebook with the Python environment that contains Eikon Data API Python library. Then I add the instrument list as below ('MSFT.O', 'META.O')

    df, err = ek.get_data(
    instruments = ['AAPL.O', 'MSFT.O', 'META.O'],
    fields = [
    'TR.CLOSEPRICE',
    'TR.Volume',
    'TR.LOWPRICE'
    ]
    )

    display(df)

    The output is

    1674806982457.pngHope this helps and please let me know in case you have any further questions.

Answers

  • Thanks so much for this solution. I think this will work well. I appreciate the quick assistance!