Screener formula does not work in Eikon API

I am trying to use the same formula than Excel is retrieving me in Python and it is not working.

=TR("SCREEN(U(IN(Private(OrgType(COM, UNK, MKP)))/*UNV:Private*/), IN(TR.TRBCActivityCode,""5430102016""), IN(TR.HeadquartersRegion,""Europe""), BETWEEN(ZAV(TR.PCSmartRatiosLiquidityGlobalRank), 1.00, 20.00), CURN=USD)","TR.CommonName;TR.TRBCActivity"&";TR.HeadquartersRegion;ZAV(TR.PCSmartRatiosLiquidityGlobalRank)","curn=USD RH=In CH=Fd")


image


Best Answer

  • Gurpreet
    Answer ✓

    Hi @miriam.benito, Can you try this and see if it works for you:

    exp = "SCREEN(U(IN(Private(OrgType(COM, UNK, MKP)))), IN(TR.TRBCActivityCode,""5430102016""), IN(TR.HeadquartersRegion,""Europe""), BETWEEN(ZAV(TR.PCSmartRatiosLiquidityGlobalRank), 1.00, 20.00), CURN=USD)" fields = ['TR.COmmonName', 'TR.TRBCActivity', 'TR.HeadquartersRegion', 'ZAV(TR.PCSmartRatiosLiquidityGlobalRank)'] 

    df, e = ek.get_data(exp, fields)

    print(df)

    Here is my output:

         Instrument  ... ZAV(TR.PCSmartRatiosLiquidityGlobalRank)
    0 4298157373 ... 9
    1 4298203137 ... 18
    2 4298232673 ... 14
    3 4298253815 ... 14
    4 4298266156 ... 14
    5 4298270206 ... 3

Answers

  • @miriam.benito Can you post your instrument list and complete script. I tried it with few instruments and the formula worked ok.

  • @Gurpreet. Thanks for your response. I think that the question is wrongly posed. I wanted to retrieve the private companies of the activity with the code 5430102016 (Food markets) with those filters. There is no more than 5000 companies with those filters (already checked it via Screener), hence, I do not have the instrument list I want that list :)

    The code is:

    exp = "SCREEN(U(IN(Private(OrgType(COM, UNK, MKP)))/*UNV:Private*/), IN(TR.TRBCActivityCode,""5430102016""), IN(TR.HeadquartersRegion,""Europe""), BETWEEN(ZAV(TR.PCSmartRatiosLiquidityGlobalRank), 1.00, 20.00), CURN=USD)"

    ek.get_data(instruments=[exp], fields=["TR.CommonName","TR.TRBCActivity","TR.HeadquartersRegion","TR.PCSmartRatiosLiquidityGlobalRank"])

    Thanks a lot!

  • Hi @Gurpreet.

    image

    I do not know why I cannot run the same command...

  • Hi @miriam.benito Can you please confirm that you are using the latest version of Eikon API ?

    >>> import eikon as ek
    >>> ek.__version__
    '1.0.1'

  • Hi @Gurpreet.,

    It was the version.. thank you for the point!