DEV Community

Cover image for #FOSS in Python: How To Easily Screen ETFs By Category With The OpenBB Terminal
Danglewood
Danglewood

Posted on

#FOSS in Python: How To Easily Screen ETFs By Category With The OpenBB Terminal

The OpenBB Terminal sports an entire menu dedicated to ETFs; the screener is a submenu here. To get to this menu from anywhere in the terminal, enter:

/etf/scr
Enter fullscreen mode Exit fullscreen mode

Alternatively, if launching the terminal from a command line, the terminal can start there by tagging the startup string, which looks like:

python terminal.py /etf/scr
Enter fullscreen mode Exit fullscreen mode

Screen By Category Function: /etf/scr/sbc (https://openbb-finance.github.io/OpenBBTerminal/terminal/etf/scr/sbc/)

This screener submenu has two distinct methods for filtration:

screen: this uses the .ini files, located in the installation folder, to filter based on performance metrics, like NAV, expense ratio, etc.

ETF Screener Preset: /etf/scr/sbc (https://openbb-finance.github.io/OpenBBTerminal/terminal/etf/scr/screen/)

sbc: Screen By Category allows the user to discover ETFs offering specific exposure to a risk category, asset class, sector, or industry.

This second method is our focus. To see the help dialogue, in the submenu, enter:

sbc -h
Enter fullscreen mode Exit fullscreen mode

Returns this dialogue:

usage: sbc [-c CATEGORY [CATEGORY ...]] [-l LIMIT] [-h] [--export EXPORT]

Search by category [Source: FinanceDatabase/StockAnalysis.com]

optional arguments:
  -c CATEGORY [CATEGORY ...], --category CATEGORY [CATEGORY ...]
                        Category to look for (default: None)
  -l LIMIT, --limit LIMIT
                        Limit of ETFs to display (default: 5)
  -h, --help            show this help message (default: False)
  --export EXPORT       Export raw data into csv, json, xlsx (default: )
Enter fullscreen mode Exit fullscreen mode

The optional arguments for this feature are:

  1. -l, --limit (number of results to return)
  2. --export (export the procured list to a file)

For example, the top 20 ETFs by total assets in the category, Commodities Broad Basket.
Commodities Broad Basket ETFs (https://openbb-finance.github.io/OpenBBTerminal/terminal/etf/scr/sbc/)

2022 Apr 01, 10:36 (🦋) /etf/scr/ $ sbc Managed Futures
Enter fullscreen mode Exit fullscreen mode

Managed Futures ETFs (https://openbb-finance.github.io/OpenBBTerminal/terminal/etf/scr/sbc/)

2022 Apr 01, 10:39 (🦋) /etf/scr/ $ sbc Equity Precious Metals -l 10
Enter fullscreen mode Exit fullscreen mode

Equity Precious Metals ETFs (https://openbb-finance.github.io/OpenBBTerminal/terminal/etf/scr/sbc/)

Browsing ETFs in this way is bound to stir up some curiosity, don't be afraid to go down a few rabbit holes!
What's your jam? Let's talk about it!

https://discord.com/invite/Y4HDyB6Ypu

Oldest comments (0)