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

Best Answer

  • nick.zincone
    Answer ✓

    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.

Answers

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