Last Updated: August 2024
If you have a workflow which requires to search for companies that match your criteria. For example:
- "Companies that Market Cap is greater than 5,000M USD, in NYSE, in Energy business and 3 months return is more than 15%"
- "Companies that 3 months return is more than 15%, 52 weeks return is more than 10% and is in the Stock Exchange of Thailand"
This article will guide you to the following topics:
- Use the SCREENER app to define a search syntax
- Use LSEG's Refinitiv Data Library (Python) to retrieve companies list from the defined syntax.
Sample code and Jupyter notebook file is available in the top right panel of this article.
SCREENER App on Workspace Desktop
SCREENER, which can be used to screen public & private companies using a variety of criteria, is a flexible idea-generation tool that allows you to find securities in the investable universe that display certain characteristics and match your investment philosophy or style.
You can create simple and sophisticated filters and ranks on a broad range of factors to identify new investment opportunities.
Follow these steps to launch the SCREENER application
1. Type in "SCREENER" on Workspace search bar then press enter.
2. You can add filters on the SCREENER app
3. Let's apply the filters, the sample filters added are as below
LSEG's Refinitiv Data Library for Python
Use the Data Library to retrieve companies list with the defined filters.
You can follow below instruction to use defined filters with the Data Library
1. On the SCREENER app, click on an Excel icon and select Export All as Formulars
2. Open the exported file with Excel, you should see the TR function with SCREENER syntax
This is the TR function on Excel:
=@TR("SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/), TR.CompanyMarketCap(Scale=6)>=5000, IN(TR.ExchangeMarketIdCode,""XNYS""), IN(TR.TRBCBusinessSectorCode,""5010"",""5020"",""5030""), TR.TotalReturn3Mo>=15, CURN=USD)","TR.Common"&"Name;TR.CompanyMarketCap(Scale=6);TR.ExchangeName;TR.TRBCBusinessSector;TR.TotalReturn3Mo","curn=USD RH=In CH=Fd")
From this TR function, you can extract SCREENER syntax and format it in Python as the following:
Screener('U(IN(Equity(active,public,primary))/*UNV:Public*/), TR.CompanyMarketCap(Scale=6)>=5000, IN(TR.ExchangeMarketIdCode,"XNYS"), IN(TR.TRBCBusinessSectorCode,"5010","5020","5030"), TR.TotalReturn3Mo>=15, CURN=USD')
3. Now you can use the defined syntax with Screener function of the data library to retrieve list of instruments and data fields
Example code of Screener: EX-1.01.08-Screeners.ipynb
import refinitiv.data as rd
from refinitiv.data.discovery import Screener
rd.open_session()
rics = Screener('U(IN(Equity(active,public,primary))/*UNV:Public*/), TR.CompanyMarketCap(Scale=6)>=5000, IN(TR.ExchangeMarketIdCode,"XNYS"), IN(TR.TRBCBusinessSectorCode,"5010","5020","5030"), TR.TotalReturn3Mo>=15, CURN=USD')
df = rd.get_data(rics, ['TR.CommonName','TR.CompanyMarketCap(Scale=6)','TR.ExchangeName','TR.TRBCBusinessSector','TR.TotalReturn3Mo'])
display(df)
Screener function returns a Screener object that contains list of RICs that matches filters applied.