question

Upvotes
Accepted
1 0 0 0

Screen for commodity instruments by source and other variables

I am looking for a way to screen for commodity instruments by source and other variables, similar to the attached screenshot. There is a sample screening query in the Data Retrieval and Discovery folder however I'm not sure how to modify the code for these parameters. I can see that these data items are available (i.e. CF_EXCHNG is the data item for Exchange) but am not sure how to incorporate this within the screen code. screenshot-2023-07-27-at-104138-am.png

#product#contentscreening-apicommodities
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.

Hi @thestonkking ,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

@thestonkking

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

Upvote
Accepted
17.1k 80 39 63

Hi @thestonkking

You can actually utilize the Search feature under the "Refinitiv Data Library" folder - specifically using the example: "Access__Search.ipynb". For example, you can create a search that looks like this:

rd.discovery.search(
    view = rd.discovery.Views.COMMODITY_QUOTES,
    filter = "( (SearchAllCategoryv2 eq 'Commodities' and " \
             "RCSUnderlyingProductGenealogy eq 'U:Q') and " \
             "(ExchangeName xeq 'Shanghai Futures Exchange'))",
    select = "DTSubjectName,DisplayName,RCSUnderlyingProductLeaf," \ 
             "RCSAssetCategoryLeaf,ExchangeName,DisplayType," \
             "RCSAssetCategoryGenealogy,RIC,Periodicity,BusinessEntity," \
             "PI,SearchAllCategoryv3,SearchAllCategoryv2," \
             "SearchAllCategory,ContractType,RCSSourceTypeLeaf," \ 
             "RCSUnderlyingProductGenealogy"
)

1690489579725.png

Within the "Advanced Search" app you are using, you can utilize the "Export Query" feature from the "Export Options" menu:

1690489751475.png

This will pull up search criteria and output options you see in the Commodities search results you have. Hope this helps.


1690489579725.png (66.6 KiB)
1690489751475.png (37.4 KiB)
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 0 0 0

Thanks for the quick response Nick. Wasn't aware of the export capabilities in the AS app - very helpful.

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.