How to filter out Equity/Index Warrants from search.Definition result?

igorg
igorg Advocate

We use this query to get RICs:

        res=search.Definition(
view = search.Views.EQUITY_QUOTES,
filter = "AssetState ne 'DC' and RIC eq '*.MX' and ExchangeCode eq 'MEX'",
select = 'RIC',
order_by = 'RIC asc',
top = 10000
).get_data()

It works fine, but the result contains more than 1000 RICs that look like GFN_tcR001.MX, AMD_tcR002.MX, AMZ_tvR039.MX…

These all have SecurityType = 229: Equity/Index Warrants.

Is there a way to modify the filter or query to exclude them?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @igorg

    Thank you for reaching out to us.

    You may use the AssetType field to filter out those RICs.

    res=search.Definition(
    
                view = search.Views.EQUITY_QUOTES,
    
                filter = "AssetState ne 'DC' and  RIC eq '*.MX' and ExchangeCode eq 'MEX' and AssetType eq 'EQUITY'",
    
                select = 'RIC,AssetType',
    
                order_by = 'RIC asc',
    
                top = 10000
    
            ).get_data()
    
    res.data.df
    

    You can use the metadata interface to list all available fields.

    response = search.metadata.Definition(
        view = search.Views.EQUITY_QUOTES
    ).get_data()
    
    response.data.df