Python command to get RICs associated with a chain of contracts

I am using the following command in the Refinitiv-Excel interface in order to get all the RICs associated with a certain set of contracts.

=@TR("0#LCOG1+";"";"CH=Fd RH=IN";$A$1)

How would this command look like in Phyton (is it possible to get the result applying the "get_data" function)?

Or more generally, is there a way to translate commands from one "language" to the other?

Best Answer

  • @Peter.Winkler3 Yes you can try this which will give you the RICs in the chain:

    df, err = ek.get_data('0#LCOG1+', 'BID')
    df

    image

    In terms of general translation - the python functions eg get_data generally involve some kind of instrument(s), then some kind of field(s) and perhaps a set of parameters (such as date and/or field specific settings.

    The best way to familiarise yourself is to use either the Data Item Browser app (type DIB into the eikon search bar) or by using the Code Creator app (type codecr into eikon search bar). The you can add an instrument and select fields and have the app create the correct field/parameter settings for you (in the case of DIB app) or create the whole python code for you including the full API call which you can launch in a codebook instance or copy and paste into your Jupyter notebook or similar.

    I hope this can help.

Answers