How to convert the ticker to RIC and then retrieve the market cap?

Hi, I encountered a problem as mentioned in the title. Currently, I have two ways:

1. rdp.convert_symbols(), where rdp is refinitiv.dataplatform

2. ek.symbology().

Take ['AAPL' , 'MSFT'] as an example. I found method 1 always requires a login and requires to open a session. Is that possible to avoid this issue. I mean only providing app key, say. Is there any converting function in refinitiv.data package?

If I turn bestmatch to True, the function always returns me an error but if False, it's a list. Should I simply select the first component of the list?

Then, for retrieving market cap, which function can I use to complete it more efficiently? Is that possible to only use eikon built-in functions to implement this?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @CharlesYan

    Thank you for reaching out to us.

    You can use the Refinitiv Data Library for Python instead. The library can be configured to use the desktop session that retrieves data via Eikon or Refinitiv Workspace by using the application key.

    The code to convert tickers to RICs looks like this.

    response = symbol_conversion.Definition(
        symbols=["AAPL","MSFT"],
        from_symbol_type=symbol_conversion.SymbolTypes.TICKER_SYMBOL,
        to_symbol_types=[
            symbol_conversion.SymbolTypes.RIC
        ],
    ).get_data()

    response.data.df

    The sample code is on GitHub.

    Then you can use the retrived RICs with the get_data method to retrieve the market cap.

    rd.get_data(["AAPL.O","MSFT.O"],fields=["TR.F.MktCap"])

Answers