Warrant data on ISIN via Eikon Data API

Dear all,

I'm too much of a noob when it comes to Python so I would need your help in the following client query. Client is trying to use ISIN for Warrants traded at Frankfurt Stock Exchange like (DE000PF2SQR3 or DE000UH5CN61) to extract CF_BID, CF_ASK etc without needing to pick out RICs everytime. My "code" to first extract RICs and then the data items looks like this:

DATA = ek.get_data(['DE000PF2SQR3', 'DE000UH5CN61'],

['TR.RIC'])

df, err = ek.get_data([DATA],

['CF_NAME','CF_BID', 'CF_ASK', 'BIDSIZE', 'ASKSIZE', 'CF_EXCHNG'])

display(df)


Unfortunately it seems to not use the RICs as DATA and therefore doesnt return any values. Your help in correcting my code would be highly appreciated :)

Kind regards,

Almir

Best Answer

  • raksina.samasiri
    Answer ✓

    Hi @Almir Purisic ,

    as ek.get_data function returns the output dataframe and error message, so it's recommended to be used like the below. Plus, it has to be converted to a Python list before being passed into ek.get_data as a list of instruments. Please see an example code below and let me know if you have any questions

    # retrieve RIC from ISIN
    DATA, err = ek.get_data(['DE000PF2SQR3', 'DE000UH5CN61'], ['TR.RIC'])

    # convert RICs to list to be used
    ric_lists = DATA['RIC'].to_list()

    # get data
    df, err = ek.get_data(ric_lists,
    ['CF_NAME','CF_BID', 'CF_ASK', 'BIDSIZE', 'ASKSIZE', 'CF_EXCHNG'])
    display(df)

    1652435048501.png

    However, I'm not sure why some of the data is <NA>, you can check the content with support team via MyRefinitiv so the content specialist can help assist you on this.

Answers

  • @Almir Purisic

    These fields (['CF_NAME','CF_BID', 'CF_ASK', 'BIDSIZE', 'ASKSIZE', 'CF_EXCHNG'])) are in the Real-Time category. Typically, we subscribe to get real-time data by using RICs. I assume that this is why those real-time fields can't be used with ISINs.

    You can use ISINs with TR fields, such as TR.ClosePrice, and TR.OpenPrice fields.

    df, err = ek.get_data(
    instruments = ['DE000PF2SQR3','DE000UH5CN61'],
    fields = ['TR.ClosePrice','TR.OpenPrice'])
    df

    1652436327135.png

    To get real-time fields, you need to convert ISINs to RICs.

    df, err = ek.get_data(
    instruments = ['DE000PF2SQR3','DEPF2SQR.F'],
    fields = ['CF_LAST'])
    df

    1652436695419.png



  • @raksina.samasiri thanks a million! This has helped us sell an Eikon Global Equities license and displace the competition. In my CodeBook it somehow was able to pull the data. I had no N/A as results. Have a nice weekend! Cheers, Almir