How to use symbol_conversion.Definition for a specific date?

I'm using the following to convert from ISIN to RIC:

ld.open_session()
response = symbol_conversion.Definition(symbols = ['TH8319010Z06'],
from_symbol_type = symbol_conversion.SymbolTypes.ISIN,
to_symbol_types = symbol_conversion.SymbolTypes.RIC,
asset_class = symbol_conversion.AssetClass.EQUITIES,
).get_data()

eikon_map = response.data.df
ld.close_session()

It used to work but then I think because the stock has become delisted it doesn't return a value.

Ideally I'd like to specify an as of date / effective date to run the query for so I can reliably reproduce the same data and not be impacted by delistings.

Kind Regards

Jasdeep

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @Jasdeep

    Thank you for reaching out to us.

    Please try this one:

    response = symbol_conversion.Definition(symbols = ['TH8319010Z06'],
        from_symbol_type = symbol_conversion.SymbolTypes.ISIN,
        to_symbol_types = symbol_conversion.SymbolTypes.RIC,
        asset_class = symbol_conversion.AssetClass.EQUITIES,
        asset_state=symbol_conversion.AssetState.INACTIVE                                     
        ).get_data()
    
    response.data.df
    

Answers

  • Jasdeep
    Jasdeep Newcomer

    Thank you for this - this symbol is part of a long list (most of which are still active), so is there a wat to query the both the active and inactive symbols, and where in active one doesn't exist, use the inactive one?

    Kind regards,

    Jas

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Jasdeep

    The symbol_conversion module sets the asset_state to ACTIVE by default.

    I couldn't find a way to unset it.

    To query both active and inactive, you need to use the search.lookup instead. For example:

    response = search.lookup.Definition(
        view=search.Views.SEARCH_ALL,                         
        scope="IssueISIN",                                                      
        terms="TH8319010Z06,US5949181045",                
        select="BusinessEntity,DocumentTitle,RIC",               
    ).get_data()
    
    response.data.df
    

    The example is on GitHub.