New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
166 13 18 21

Eikon API: Screener query from Excel query

Question on behalf of a client: Is it possible to convert the following Excel query to a Python query for the Eikon API?

=TR("SCREEN(U(IN(Equity(active or inactive,public,primary))/*UNV:Public*/),
IN(TR.ExchangeCountryCode,""US""),
TR.CompanyMarketCap>=TR.CompanyMarketCap(SDate=2007-09-09),
TR.AvgDailyValTraded52W>=1000000,
CURN=USD)","TR.CommonName;TR.ExchangeCountry;"&"TR.CompanyMarketCap;TR.AvgDailyValTraded52W;TR.CompanyMarketCap(SDate=2007-09-09)","curn=USD
RH=In CH=Fd")

Thank you so much in advance for your help!

eikoneikon-data-apipythonworkspacerefinitiv-dataplatform-eikonworkspace-data-apiscreener
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
166 13 18 21

Following the answer on: https://community.developers.refinitiv.com/questions/11063/view.html

This seems to work:

screener_exp = 'SCREEN(U(IN(Equity(active,public,primary))),IN(TR.ExchangeCountryCode,"US"),TR.CompanyMarketCap>=TR.CompanyMarketCap(SDate=2007-09-09), TR.AvgDailyValTraded52W>=1000000, CURN=USD)'

companies_data, err = eikon.get_data(instruments=[screener_exp], fields=['TR.CommonName', 'TR.ExchangeCountry', 'TR.CompanyMarketCap', 'TR.AvgDailyValTraded52W', 'TR.CompanyMarketCap(SDate=2007-09-09)'])
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 1 1 3

Hi,

I have a similar query. My screener expression in excel to get the tickers is

TR("SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/), IN(TR.HQCountryCode,""AR,BR,CL,CN,HU,IN,ID,MY,MX,PL,RU,ZA,KR,TH,TR""), NOT_IN(TR.GICSIndustryCode,""401010"",""401020"",""402010"",""402020"",""402030"",""402040"",""403010""), CURN=USD)","TR.CommonName;TR.HeadquartersCountry;TR"&".GICSSector","curn=USD RH=In CH=Fd")

From the above formula, I get a list of tickers in Column A from A2:A14186. Now I get the Cash data for these tickers like this:

TR($A$2:$A$14186,"TR.CashandEquivalents(CURN=USD Scale=6) ","Period=FQ0 Frq=FQ SDate=0d EDate=2006-12-31 sortd=periodenddate CH=periodenddate NULL=blank RH=IN")

I want to understand how to replicate this query in python

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.